Skip to content

Commit 468c3f4

Browse files
adrinjalaliglemaitrejeremiedbb
authored
MNT replace master with main (scikit-learn#19237)
* replace master with main * fix imbalanced-learn Co-authored-by: Guillaume Lemaitre <[email protected]> * asv default branch is `master` Co-authored-by: Jérémie du Boisberranger <[email protected]> Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: Jérémie du Boisberranger <[email protected]>
1 parent 306826f commit 468c3f4

29 files changed

+150
-151
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
- run: ls -ltrh doc/_build/html/stable
133133
- deploy:
134134
command: |
135-
if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then
135+
if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then
136136
bash build_tools/circle/push_doc.sh doc/_build/html/stable
137137
fi
138138
@@ -162,6 +162,6 @@ workflows:
162162
filters:
163163
branches:
164164
only:
165-
- master
165+
- main
166166
jobs:
167167
- pypy3

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ coverage:
44
status:
55
project:
66
default:
7-
# Commits pushed to master should not make the overall
7+
# Commits pushed to main should not make the overall
88
# project coverage decrease by more than 1%:
99
target: auto
1010
threshold: 1%

.github/workflows/twitter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Tweet the URL of a commit on @sklearn_commits whenever a push event
2-
# happens on the master branch
2+
# happens on the main branch
33
name: Twitter Push Notification
44

55

66
on:
77
push:
88
branches:
9-
- master
9+
- main
1010

1111

1212
jobs:

.github/workflows/wheels.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ on:
77
- cron: "42 3 */1 * *"
88
push:
99
branches:
10-
- master
10+
- main
1111
# Release branches
1212
- "[0-9]+.[0-9]+.X"
1313
pull_request:
1414
branches:
15-
- master
15+
- main
1616
- "[0-9]+.[0-9]+.X"
1717
# Manual run
1818
workflow_dispatch:

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: type = cron OR commit_message =~ /\[icc-build\]/
3838

3939
# Manual trigger of linux/arm64 tests in PR without triggering the full
40-
# wheel building process for all the Python versions.
40+
# wheel building process for all the Python versions.
4141
- python: 3.9
4242
os: linux
4343
arch: arm64
@@ -48,7 +48,7 @@ jobs:
4848
# Linux environments to build the scikit-learn wheels for the ARM64
4949
# architecture and Python 3.6 and newer. This is used both at release time
5050
# with the manual trigger in the commit message in the release branch and as
51-
# a scheduled task to build the weekly dev build on the master branch. The
51+
# a scheduled task to build the weekly dev build on the main branch. The
5252
# weekly frequency is meant to avoid depleting the Travis CI credits too
5353
# fast.
5454
- python: 3.6

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ documentation is no less important than improving the library itself. If you
1313
find a typo in the documentation, or have made improvements, do not hesitate to
1414
send an email to the mailing list or preferably submit a GitHub pull request.
1515
Documentation can be found under the
16-
[doc/](https://github.com/scikit-learn/scikit-learn/tree/master/doc) directory.
16+
[doc/](https://github.com/scikit-learn/scikit-learn/tree/main/doc) directory.
1717

1818
But there are many other ways to help. In particular answering queries on the
1919
[issue tracker](https://github.com/scikit-learn/scikit-learn/issues),

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ code-analysis:
6565
pylint -E -i y sklearn/ -d E1103,E0611,E1101
6666

6767
flake8-diff:
68-
git diff upstream/master -u -- "*.py" | flake8 --diff
68+
git diff upstream/main -u -- "*.py" | flake8 --diff

PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Thanks for contributing a pull request! Please ensure you have taken a look at
3-
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md
3+
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
44
-->
55

66
#### Reference Issues/PRs

README.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
33
|Azure|_ |Travis|_ |Codecov|_ |CircleCI|_ |Nightly wheels|_ |PythonVersion|_ |PyPi|_ |DOI|_
44

5-
.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=master
6-
.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=master
5+
.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=main
6+
.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=main
77

8-
.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=master
8+
.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=main
99
.. _Travis: https://travis-ci.com/scikit-learn/scikit-learn
1010

11-
.. |Codecov| image:: https://codecov.io/github/scikit-learn/scikit-learn/badge.svg?branch=master&service=github
12-
.. _Codecov: https://codecov.io/github/scikit-learn/scikit-learn?branch=master
11+
.. |Codecov| image:: https://codecov.io/github/scikit-learn/scikit-learn/badge.svg?branch=main&service=github
12+
.. _Codecov: https://codecov.io/github/scikit-learn/scikit-learn?branch=main
1313

14-
.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/master.svg?style=shield&circle-token=:circle-token
14+
.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/main.svg?style=shield&circle-token=:circle-token
1515
.. _CircleCI: https://circleci.com/gh/scikit-learn/scikit-learn
1616

1717
.. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/workflows/Wheel%20builder/badge.svg?event=schedule

asv_benchmarks/asv.conf.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// The URL or local path of the source code repository for the
1313
// project being benchmarked
1414
"repo": "..",
15-
15+
1616
// The Python project's subdirectory in your repo. If missing or
1717
// the empty string, the project is assumed to be located at the root
1818
// of the repository.
@@ -28,9 +28,9 @@
2828
// "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
2929
// ],
3030

31-
// List of branches to benchmark. If not provided, defaults to "master"
31+
// List of branches to benchmark. If not provided, defaults to "master
3232
// (for git) or "default" (for mercurial).
33-
// "branches": ["master"], // for git
33+
// "branches": ["main"], // for git
3434
// "branches": ["default"], // for mercurial
3535

3636
// The DVCS being used. If not set, it will be automatically

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ schedules:
44
displayName: Run nightly build
55
branches:
66
include:
7-
- master
7+
- main
88
always: true
99

1010
jobs:

build_tools/circle/build_doc.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -e
99
# instead of relying on the subsequent rules.
1010
#
1111
# We always build the documentation for jobs that are not related to a specific
12-
# PR (e.g. a merge to master or a maintenance branch).
12+
# PR (e.g. a merge to main or a maintenance branch).
1313
#
1414
# If this is a PR, do a full build if there are some files in this PR that are
1515
# under the "doc/" or "examples/" folders, otherwise perform a quick build.
@@ -49,8 +49,8 @@ get_build_type() {
4949
echo BUILD: not a pull request
5050
return
5151
fi
52-
git_range="origin/master...$CIRCLE_SHA1"
53-
git fetch origin master >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return)
52+
git_range="origin/main...$CIRCLE_SHA1"
53+
git fetch origin main >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return)
5454
filenames=$(git diff --name-only $git_range)
5555
if [ -z "$filenames" ]
5656
then
@@ -114,7 +114,7 @@ then
114114
exit 0
115115
fi
116116

117-
if [[ "$CIRCLE_BRANCH" =~ ^master$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]]
117+
if [[ "$CIRCLE_BRANCH" =~ ^main$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]]
118118
then
119119
# ZIP linked into HTML
120120
make_args=dist
@@ -188,9 +188,9 @@ python setup.py develop
188188

189189
export OMP_NUM_THREADS=1
190190

191-
if [[ "$CIRCLE_BRANCH" =~ ^master$ && -z "$CI_PULL_REQUEST" ]]
191+
if [[ "$CIRCLE_BRANCH" =~ ^main$ && -z "$CI_PULL_REQUEST" ]]
192192
then
193-
# List available documentation versions if on master
193+
# List available documentation versions if on main
194194
python build_tools/circle/list_versions.py > doc/versions.rst
195195
fi
196196

@@ -205,7 +205,7 @@ cd -
205205
set +o pipefail
206206

207207
affected_doc_paths() {
208-
files=$(git diff --name-only origin/master...$CIRCLE_SHA1)
208+
files=$(git diff --name-only origin/main...$CIRCLE_SHA1)
209209
echo "$files" | grep ^doc/.*\.rst | sed 's/^doc\/\(.*\)\.rst$/\1.html/'
210210
echo "$files" | grep ^examples/.*.py | sed 's/^\(.*\)\.py$/auto_\1.html/'
211211
sklearn_files=$(echo "$files" | grep '^sklearn/')
@@ -216,7 +216,7 @@ affected_doc_paths() {
216216
}
217217

218218
affected_doc_warnings() {
219-
files=$(git diff --name-only origin/master...$CIRCLE_SHA1)
219+
files=$(git diff --name-only origin/main...$CIRCLE_SHA1)
220220
# Look for sphinx warnings only in files affected by the PR
221221
if [ -n "$files" ]
222222
then

build_tools/circle/checkout_merge_commit.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

33

4-
# Add `master` branch to the update list.
4+
# Add `main` branch to the update list.
55
# Otherwise CircleCI will give us a cached one.
6-
FETCH_REFS="+master:master"
6+
FETCH_REFS="+main:main"
77

88
# Update PR refs for testing.
99
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
@@ -20,13 +20,13 @@ if [[ -n "${CIRCLE_PR_NUMBER}" ]]
2020
then
2121
git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge" || (
2222
echo Could not fetch merge commit. >&2
23-
echo There may be conflicts in merging PR \#${CIRCLE_PR_NUMBER} with master. >&2;
23+
echo There may be conflicts in merging PR \#${CIRCLE_PR_NUMBER} with main. >&2;
2424
exit 1)
2525
fi
2626

2727
# Check for merge conflicts.
2828
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
2929
then
30-
git branch --merged | grep master > /dev/null
30+
git branch --merged | grep main > /dev/null
3131
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
3232
fi

build_tools/circle/linting.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ git remote --verbose
3838

3939
# Travis does the git clone with a limited depth (50 at the time of
4040
# writing). This may not be enough to find the common ancestor with
41-
# $REMOTE/master so we unshallow the git checkout
41+
# $REMOTE/main so we unshallow the git checkout
4242
if [[ -a .git/shallow ]]; then
4343
echo -e '\nTrying to unshallow the repo:'
4444
echo '--------------------------------------------------------------------------------'
@@ -59,7 +59,7 @@ if [[ "$TRAVIS" == "true" ]]; then
5959
fi
6060
else
6161
# We want to fetch the code as it is in the PR branch and not
62-
# the result of the merge into master. This way line numbers
62+
# the result of the merge into main. This way line numbers
6363
# reported by Travis will match with the local code.
6464
LOCAL_BRANCH_REF=travis_pr_$TRAVIS_PULL_REQUEST
6565
# In Travis the PR target is always origin
@@ -68,7 +68,7 @@ if [[ "$TRAVIS" == "true" ]]; then
6868
fi
6969

7070
# If not using the commit range from Travis we need to find the common
71-
# ancestor between $LOCAL_BRANCH_REF and $REMOTE/master
71+
# ancestor between $LOCAL_BRANCH_REF and $REMOTE/main
7272
if [[ -z "$COMMIT_RANGE" ]]; then
7373
if [[ -z "$LOCAL_BRANCH_REF" ]]; then
7474
LOCAL_BRANCH_REF=$(git rev-parse --abbrev-ref HEAD)
@@ -77,16 +77,16 @@ if [[ -z "$COMMIT_RANGE" ]]; then
7777
echo '--------------------------------------------------------------------------------'
7878
git --no-pager log -2 $LOCAL_BRANCH_REF
7979

80-
REMOTE_MASTER_REF="$REMOTE/master"
81-
# Make sure that $REMOTE_MASTER_REF is a valid reference
82-
echo -e "\nFetching $REMOTE_MASTER_REF"
80+
REMOTE_MAIN_REF="$REMOTE/main"
81+
# Make sure that $REMOTE_MAIN_REF is a valid reference
82+
echo -e "\nFetching $REMOTE_MAIN_REF"
8383
echo '--------------------------------------------------------------------------------'
84-
git fetch $REMOTE master:refs/remotes/$REMOTE_MASTER_REF
84+
git fetch $REMOTE main:refs/remotes/$REMOTE_MAIN_REF
8585
LOCAL_BRANCH_SHORT_HASH=$(git rev-parse --short $LOCAL_BRANCH_REF)
86-
REMOTE_MASTER_SHORT_HASH=$(git rev-parse --short $REMOTE_MASTER_REF)
86+
REMOTE_MAIN_SHORT_HASH=$(git rev-parse --short $REMOTE_MAIN_REF)
8787

88-
COMMIT=$(git merge-base $LOCAL_BRANCH_REF $REMOTE_MASTER_REF) || \
89-
echo "No common ancestor found for $(git show $LOCAL_BRANCH_REF -q) and $(git show $REMOTE_MASTER_REF -q)"
88+
COMMIT=$(git merge-base $LOCAL_BRANCH_REF $REMOTE_MAIN_REF) || \
89+
echo "No common ancestor found for $(git show $LOCAL_BRANCH_REF -q) and $(git show $REMOTE_MAIN_REF -q)"
9090

9191
if [ -z "$COMMIT" ]; then
9292
exit 1
@@ -95,7 +95,7 @@ if [[ -z "$COMMIT_RANGE" ]]; then
9595
COMMIT_SHORT_HASH=$(git rev-parse --short $COMMIT)
9696

9797
echo -e "\nCommon ancestor between $LOCAL_BRANCH_REF ($LOCAL_BRANCH_SHORT_HASH)"\
98-
"and $REMOTE_MASTER_REF ($REMOTE_MASTER_SHORT_HASH) is $COMMIT_SHORT_HASH:"
98+
"and $REMOTE_MAIN_REF ($REMOTE_MAIN_SHORT_HASH) is $COMMIT_SHORT_HASH:"
9999
echo '--------------------------------------------------------------------------------'
100100
git --no-pager show --no-patch $COMMIT_SHORT_HASH
101101

build_tools/circle/push_doc.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# This script is meant to be called in the "deploy" step defined in
2+
# This script is meant to be called in the "deploy" step defined in
33
# circle.yml. See https://circleci.com/docs/ for more details.
44
# The behavior of the script is controlled by environment variable defined
55
# in the circle.yml in the top level folder of the project.
@@ -23,7 +23,7 @@ fi
2323
# Absolute path needed because we use cd further down in this script
2424
GENERATED_DOC_DIR=$(readlink -f $GENERATED_DOC_DIR)
2525

26-
if [ "$CIRCLE_BRANCH" = "master" ]
26+
if [ "$CIRCLE_BRANCH" = "main" ]
2727
then
2828
dir=dev
2929
else
@@ -49,8 +49,8 @@ then
4949
touch $dir/index.html
5050
git add $dir
5151
fi
52-
git checkout master
53-
git reset --hard origin/master
52+
git checkout main
53+
git reset --hard origin/main
5454
if [ -d $dir ]
5555
then
5656
git rm -rf $dir/ && rm -rf $dir/
@@ -62,4 +62,4 @@ git config push.default matching
6262
git add -f $dir/
6363
git commit -m "$MSG" $dir
6464
git push
65-
echo $MSG
65+
echo $MSG

build_tools/travis/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ set -e
99
if [[ $BUILD_WHEEL == true ]]; then
1010
source build_tools/travis/install_wheels.sh
1111
else
12-
source build_tools/travis/install_master.sh
12+
source build_tools/travis/install_main.sh
1313
fi

build_tools/travis/install_master.sh build_tools/travis/install_main.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pip install joblib threadpoolctl
5555

5656
pip install $(get_dep pytest $PYTEST_VERSION) pytest-xdist
5757

58-
# Build scikit-learn in this script to collapse the
58+
# Build scikit-learn in this script to collapse the
5959
# verbose build output in the Travis output when it
6060
# succeeds
6161
python --version

doc/about.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Artwork
107107
-------
108108

109109
High quality PNG and SVG logos are available in the `doc/logos/
110-
<https://github.com/scikit-learn/scikit-learn/tree/master/doc/logos>`_
110+
<https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos>`_
111111
source directory.
112112

113113
.. image:: images/scikit-learn-logo-notext.png

doc/computing/computational_performance.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ compromise between model compactness and prediction power. One can also
336336
further tune the ``l1_ratio`` parameter (in combination with the
337337
regularization strength ``alpha``) to control this tradeoff.
338338

339-
A typical `benchmark <https://github.com/scikit-learn/scikit-learn/blob/master/benchmarks/bench_sparsify.py>`_
339+
A typical `benchmark <https://github.com/scikit-learn/scikit-learn/blob/main/benchmarks/bench_sparsify.py>`_
340340
on synthetic data yields a >30% decrease in latency when both the model and
341341
input are sparse (with 0.000024 and 0.027400 non-zero coefficients ratio
342342
respectively). Your mileage may vary depending on the sparsity and size of

doc/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
# The encoding of source files.
7979
#source_encoding = 'utf-8'
8080

81-
# The master toctree document.
82-
master_doc = 'contents'
81+
# The main toctree document.
82+
main_doc = 'contents'
8383

8484
# General information about the project.
8585
project = 'scikit-learn'
@@ -283,7 +283,7 @@
283283
'PEP440'.format(version))
284284

285285
if v.is_devrelease:
286-
binder_branch = 'master'
286+
binder_branch = 'main'
287287
else:
288288
major, minor = v.release[:2]
289289
binder_branch = '{}.{}.X'.format(major, minor)

0 commit comments

Comments
 (0)