Skip to content

Commit

Permalink
MNT replace master with main (scikit-learn#19237)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people committed Jan 22, 2021
1 parent 306826f commit 468c3f4
Show file tree
Hide file tree
Showing 29 changed files with 150 additions and 151 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
- run: ls -ltrh doc/_build/html/stable
- deploy:
command: |
if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then
if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then
bash build_tools/circle/push_doc.sh doc/_build/html/stable
fi
Expand Down Expand Up @@ -162,6 +162,6 @@ workflows:
filters:
branches:
only:
- master
- main
jobs:
- pypy3
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ coverage:
status:
project:
default:
# Commits pushed to master should not make the overall
# Commits pushed to main should not make the overall
# project coverage decrease by more than 1%:
target: auto
threshold: 1%
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/twitter.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Tweet the URL of a commit on @sklearn_commits whenever a push event
# happens on the master branch
# happens on the main branch
name: Twitter Push Notification


on:
push:
branches:
- master
- main


jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
- cron: "42 3 */1 * *"
push:
branches:
- master
- main
# Release branches
- "[0-9]+.[0-9]+.X"
pull_request:
branches:
- master
- main
- "[0-9]+.[0-9]+.X"
# Manual run
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
if: type = cron OR commit_message =~ /\[icc-build\]/

# Manual trigger of linux/arm64 tests in PR without triggering the full
# wheel building process for all the Python versions.
# wheel building process for all the Python versions.
- python: 3.9
os: linux
arch: arm64
Expand All @@ -48,7 +48,7 @@ jobs:
# Linux environments to build the scikit-learn wheels for the ARM64
# architecture and Python 3.6 and newer. This is used both at release time
# with the manual trigger in the commit message in the release branch and as
# a scheduled task to build the weekly dev build on the master branch. The
# a scheduled task to build the weekly dev build on the main branch. The
# weekly frequency is meant to avoid depleting the Travis CI credits too
# fast.
- python: 3.6
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation is no less important than improving the library itself. If you
find a typo in the documentation, or have made improvements, do not hesitate to
send an email to the mailing list or preferably submit a GitHub pull request.
Documentation can be found under the
[doc/](https://github.com/scikit-learn/scikit-learn/tree/master/doc) directory.
[doc/](https://github.com/scikit-learn/scikit-learn/tree/main/doc) directory.

But there are many other ways to help. In particular answering queries on the
[issue tracker](https://github.com/scikit-learn/scikit-learn/issues),
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ code-analysis:
pylint -E -i y sklearn/ -d E1103,E0611,E1101

flake8-diff:
git diff upstream/master -u -- "*.py" | flake8 --diff
git diff upstream/main -u -- "*.py" | flake8 --diff
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->

#### Reference Issues/PRs
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
|Azure|_ |Travis|_ |Codecov|_ |CircleCI|_ |Nightly wheels|_ |PythonVersion|_ |PyPi|_ |DOI|_

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

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

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

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

.. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/workflows/Wheel%20builder/badge.svg?event=schedule
Expand Down
6 changes: 3 additions & 3 deletions asv_benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// The URL or local path of the source code repository for the
// project being benchmarked
"repo": "..",

// The Python project's subdirectory in your repo. If missing or
// the empty string, the project is assumed to be located at the root
// of the repository.
Expand All @@ -28,9 +28,9 @@
// "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
// ],

// List of branches to benchmark. If not provided, defaults to "master"
// List of branches to benchmark. If not provided, defaults to "master
// (for git) or "default" (for mercurial).
// "branches": ["master"], // for git
// "branches": ["main"], // for git
// "branches": ["default"], // for mercurial

// The DVCS being used. If not set, it will be automatically
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schedules:
displayName: Run nightly build
branches:
include:
- master
- main
always: true

jobs:
Expand Down
16 changes: 8 additions & 8 deletions build_tools/circle/build_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
# instead of relying on the subsequent rules.
#
# We always build the documentation for jobs that are not related to a specific
# PR (e.g. a merge to master or a maintenance branch).
# PR (e.g. a merge to main or a maintenance branch).
#
# If this is a PR, do a full build if there are some files in this PR that are
# under the "doc/" or "examples/" folders, otherwise perform a quick build.
Expand Down Expand Up @@ -49,8 +49,8 @@ get_build_type() {
echo BUILD: not a pull request
return
fi
git_range="origin/master...$CIRCLE_SHA1"
git fetch origin master >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return)
git_range="origin/main...$CIRCLE_SHA1"
git fetch origin main >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return)
filenames=$(git diff --name-only $git_range)
if [ -z "$filenames" ]
then
Expand Down Expand Up @@ -114,7 +114,7 @@ then
exit 0
fi

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

export OMP_NUM_THREADS=1

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

Expand All @@ -205,7 +205,7 @@ cd -
set +o pipefail

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

affected_doc_warnings() {
files=$(git diff --name-only origin/master...$CIRCLE_SHA1)
files=$(git diff --name-only origin/main...$CIRCLE_SHA1)
# Look for sphinx warnings only in files affected by the PR
if [ -n "$files" ]
then
Expand Down
8 changes: 4 additions & 4 deletions build_tools/circle/checkout_merge_commit.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash


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

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

# Check for merge conflicts.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git branch --merged | grep master > /dev/null
git branch --merged | grep main > /dev/null
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
fi
22 changes: 11 additions & 11 deletions build_tools/circle/linting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ git remote --verbose

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

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

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

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

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

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

Expand Down
10 changes: 5 additions & 5 deletions build_tools/circle/push_doc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This script is meant to be called in the "deploy" step defined in
# This script is meant to be called in the "deploy" step defined in
# circle.yml. See https://circleci.com/docs/ for more details.
# The behavior of the script is controlled by environment variable defined
# in the circle.yml in the top level folder of the project.
Expand All @@ -23,7 +23,7 @@ fi
# Absolute path needed because we use cd further down in this script
GENERATED_DOC_DIR=$(readlink -f $GENERATED_DOC_DIR)

if [ "$CIRCLE_BRANCH" = "master" ]
if [ "$CIRCLE_BRANCH" = "main" ]
then
dir=dev
else
Expand All @@ -49,8 +49,8 @@ then
touch $dir/index.html
git add $dir
fi
git checkout master
git reset --hard origin/master
git checkout main
git reset --hard origin/main
if [ -d $dir ]
then
git rm -rf $dir/ && rm -rf $dir/
Expand All @@ -62,4 +62,4 @@ git config push.default matching
git add -f $dir/
git commit -m "$MSG" $dir
git push
echo $MSG
echo $MSG
2 changes: 1 addition & 1 deletion build_tools/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ set -e
if [[ $BUILD_WHEEL == true ]]; then
source build_tools/travis/install_wheels.sh
else
source build_tools/travis/install_master.sh
source build_tools/travis/install_main.sh
fi
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pip install joblib threadpoolctl

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

# Build scikit-learn in this script to collapse the
# Build scikit-learn in this script to collapse the
# verbose build output in the Travis output when it
# succeeds
python --version
Expand Down
2 changes: 1 addition & 1 deletion doc/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Artwork
-------

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

.. image:: images/scikit-learn-logo-notext.png
Expand Down
2 changes: 1 addition & 1 deletion doc/computing/computational_performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ compromise between model compactness and prediction power. One can also
further tune the ``l1_ratio`` parameter (in combination with the
regularization strength ``alpha``) to control this tradeoff.

A typical `benchmark <https://github.com/scikit-learn/scikit-learn/blob/master/benchmarks/bench_sparsify.py>`_
A typical `benchmark <https://github.com/scikit-learn/scikit-learn/blob/main/benchmarks/bench_sparsify.py>`_
on synthetic data yields a >30% decrease in latency when both the model and
input are sparse (with 0.000024 and 0.027400 non-zero coefficients ratio
respectively). Your mileage may vary depending on the sparsity and size of
Expand Down
6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
# The encoding of source files.
#source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'contents'
# The main toctree document.
main_doc = 'contents'

# General information about the project.
project = 'scikit-learn'
Expand Down Expand Up @@ -283,7 +283,7 @@
'PEP440'.format(version))

if v.is_devrelease:
binder_branch = 'master'
binder_branch = 'main'
else:
major, minor = v.release[:2]
binder_branch = '{}.{}.X'.format(major, minor)
Expand Down
Loading

0 comments on commit 468c3f4

Please sign in to comment.