Skip to content

Commit 9762a3c

Browse files
DianjingLiufacebook-github-bot
authored andcommitted
Update branch name reference from 'master' to 'main' (#1373)
Summary: Pull Request resolved: #1373 Step 1 to update Captum OSS default branch name from 'master' to 'main'. - Context see T200490048 - Instructions see [wiki](https://www.internalfb.com/intern/wiki/Open_Source/Maintain_a_FB_OSS_Project/Default_Branch_Name_Change/#1-before-you-use-the-too) TODO: update the OSS wiki accordingly Differential Revision: D64430568
1 parent c68334b commit 9762a3c

15 files changed

+30
-30
lines changed

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
workflow_dispatch:
1010

.github/workflows/test-conda-cpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
workflow_dispatch:
1010

.github/workflows/test-pip-cpu-with-mypy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
workflow_dispatch:
1010

.github/workflows/test-pip-cpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
workflow_dispatch:
1010

.github/workflows/test-pip-gpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
workflow_dispatch:
1010

.github/workflows/website-depoy.yml .github/workflows/website-deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
# Review gh actions docs if you want to further define triggers, paths, etc
88
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
99

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The following command will both build the docs and serve the site locally:
109109
## Pull Requests
110110
We actively welcome your pull requests.
111111

112-
1. Fork the repo and create your branch from `master`.
112+
1. Fork the repo and create your branch from `main`.
113113
2. If you have added code that should be tested, add unit tests.
114114
In other words, add unit tests.
115115
3. If you have changed APIs, update the documentation. Make sure the

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![Conda Recipe](https://img.shields.io/static/v1?logo=conda-forge&style=flat&color=green&label=recipe&message=captum)][#conda-forge-feedstock]
1212
[![Docs - GitHub.io](https://img.shields.io/static/v1?logo=captum&style=flat&color=pink&label=docs&message=captum)][#docs-package]
1313

14-
[#github-license]: https://github.com/pytorch/captum/blob/master/LICENSE
14+
[#github-license]: https://github.com/pytorch/captum/blob/main/LICENSE
1515
[#pypi-package]: https://pypi.org/project/captum/
1616
[#conda-forge-package]: https://anaconda.org/conda-forge/captum
1717
[#conda-forge-feedstock]: https://github.com/conda-forge/captum-feedstock
@@ -82,7 +82,7 @@ pip install captum
8282

8383
If you'd like to try our bleeding edge features (and don't mind potentially
8484
running into the occasional bug here or there), you can install the latest
85-
master directly from GitHub. For a basic install, run:
85+
main directly from GitHub. For a basic install, run:
8686
```bash
8787
git clone https://github.com/pytorch/captum.git
8888
cd captum

docs/contribution_guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Before contributing an algorithm to Captum, please review these guidelines and p
4545

4646
If you think that proposed algorithm/feature satisfies many of the above criteria, please open an issue on GitHub (https://github.com/pytorch/captum/issues) to discuss the method with the core Captum team members before submitting a pull request. If the method seems suitable for inclusion in Captum, we will generally request a design document or proposal, explaining the proposed API and structure for the new algorithm. An example of a design proposal for LIME and Kernel SHAP can be found here (https://github.com/pytorch/captum/issues/467).
4747

48-
If an algorithm or feature adds only marginal improvements or does not meet most the criteria described above, then we would suggest including it into our AWESOME_LIST.MD (https://github.com/pytorch/captum/blob/master/AWESOME_LIST.md) instead of adding it to the core Captum library. In the future, if the algorithm gains more popularity and acceptance in the model interpretability community, we would be happy to accept a PR to add it to the Captum core library.
48+
If an algorithm or feature adds only marginal improvements or does not meet most the criteria described above, then we would suggest including it into our AWESOME_LIST.MD (https://github.com/pytorch/captum/blob/main/AWESOME_LIST.md) instead of adding it to the core Captum library. In the future, if the algorithm gains more popularity and acceptance in the model interpretability community, we would be happy to accept a PR to add it to the Captum core library.
4949

5050
*Note that we reserve the right to decide not to include any algorithms that meet the above criteria, but we are unable to support in the long run.*
5151

docs/getting_started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pip install captum
3030
<!--END_DOCUSAURUS_CODE_TABS-->
3131

3232
For more detailed installation instructions, please see the
33-
[Project Readme](https://github.com/pytorch/captum/blob/master/README.md)
33+
[Project Readme](https://github.com/pytorch/captum/blob/main/README.md)
3434
on GitHub.
3535

3636

@@ -50,5 +50,5 @@ For an in-depth reference of the various Captum internals, see our
5050
## Contributing
5151

5252
You'd like to contribute to Captum? Great! Please see
53-
[here](https://github.com/pytorch/captum/blob/master/CONTRIBUTING.md)
53+
[here](https://github.com/pytorch/captum/blob/main/CONTRIBUTING.md)
5454
for how to help out.

scripts/publish_site.sh

+15-15
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4242
WORK_DIR=$(mktemp -d)
4343
cd "${WORK_DIR}" || exit
4444

45-
# Clone both master & gh-pages branches
46-
git clone [email protected]:pytorch/captum.git captum-master
45+
# Clone both main & gh-pages branches
46+
git clone [email protected]:pytorch/captum.git captum-main
4747
git clone --branch gh-pages [email protected]:pytorch/captum.git captum-gh-pages
4848

4949
# A few notes about the script below:
@@ -75,11 +75,11 @@ git clone --branch gh-pages [email protected]:pytorch/captum.git captum-gh-pages
7575
# the site or the latest version. Instead, we determine this at runtime.
7676
# We use what's on gh-pages in the versions subdirectory as the
7777
# source of truth for available versions and use the latest tag on
78-
# the master branch as the source of truth for the latest version.
78+
# the main branch as the source of truth for the latest version.
7979

8080
if [[ $VERSION == false ]]; then
8181
echo "-----------------------------------------"
82-
echo "Updating latest (master) version of site "
82+
echo "Updating latest (main) version of site "
8383
echo "-----------------------------------------"
8484

8585
# Populate _versions.json from existing versions; this is used
@@ -89,12 +89,12 @@ if [[ $VERSION == false ]]; then
8989
CMD="import os, json; "
9090
CMD+="vs = [v for v in os.listdir('captum-gh-pages/versions') if v != 'latest' and not v.startswith('.')]; "
9191
CMD+="print(json.dumps(vs))"
92-
python3 -c "$CMD" > captum-master/website/_versions.json
92+
python3 -c "$CMD" > captum-main/website/_versions.json
9393

9494
# Move versions.js to website subdirectory.
9595
# This is the page you see when click on version in navbar.
96-
cp captum-master/scripts/versions.js captum-master/website/pages/en/versions.js
97-
cd captum-master/website || exit
96+
cp captum-main/scripts/versions.js captum-main/website/pages/en/versions.js
97+
cd captum-main/website || exit
9898

9999
# Build site, tagged with "latest" version; baseUrl set to /versions/latest/
100100
yarn
@@ -112,7 +112,7 @@ if [[ $VERSION == false ]]; then
112112
cd "${WORK_DIR}" || exit
113113
cp captum-gh-pages/versions/latest/versions.html versions.html
114114
rm -rf captum-gh-pages/versions/latest
115-
mv captum-master/website/build/captum captum-gh-pages/versions/latest
115+
mv captum-main/website/build/captum captum-gh-pages/versions/latest
116116
# versions.html goes both in top-level and under en/ (default language)
117117
cp versions.html captum-gh-pages/versions/latest/versions.html
118118
cp versions.html captum-gh-pages/versions/latest/en/versions.html
@@ -128,8 +128,8 @@ else
128128
echo "Building new version ($VERSION) of site "
129129
echo "-----------------------------------------"
130130

131-
# Checkout master branch with specified tag
132-
cd captum-master || exit
131+
# Checkout main branch with specified tag
132+
cd captum-main || exit
133133
git fetch --tags
134134
git checkout "${VERSION}"
135135

@@ -160,15 +160,15 @@ else
160160
# Move built site to new folder (new-site) & carry over old versions
161161
# from existing gh-pages
162162
cd "${WORK_DIR}" || exit
163-
rm -rf captum-master/website/build/captum/docs/next # don't need this
164-
mv captum-master/website/build/captum new-site
163+
rm -rf captum-main/website/build/captum/docs/next # don't need this
164+
mv captum-main/website/build/captum new-site
165165
mv captum-gh-pages/versions new-site/versions
166166

167167
# Build new version of site (to be placed in versions/$VERSION/)
168168
# the only thing that changes here is the baseUrl (for nav purposes)
169169
# we build this now so that in the future, we can just bump version and not move
170170
# previous stable to versions
171-
cd captum-master/website || exit
171+
cd captum-main/website || exit
172172
sed -i '' "s/baseUrl = '\/'/baseUrl = '\/versions\/${VERSION}\/'/g" siteConfig.js
173173

174174
# disable search for non-stable version (can't use sed b/c of newline)
@@ -188,14 +188,14 @@ else
188188
# newer versions. This is the only part of the old versions that
189189
# needs to be updated when a new version is built.
190190
cd "${WORK_DIR}" || exit
191-
python3 captum-master/scripts/update_versions_html.py -p "${WORK_DIR}"
191+
python3 captum-main/scripts/update_versions_html.py -p "${WORK_DIR}"
192192

193193
# Init as Git repo and push to gh-pages
194194
cd new-site || exit
195195
git init
196196
git add --all
197197
git commit -m "Publish version ${VERSION} of site"
198-
git push --force "https://github.com/pytorch/captum" master:gh-pages
198+
git push --force "https://github.com/pytorch/captum" main:gh-pages
199199

200200
fi
201201

scripts/update_versions_html.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
def updateVersionHTML(base_path, base_url=BASE_URL):
12-
with open(base_path + "/captum-master/website/_versions.json", "rb") as infile:
12+
with open(base_path + "/captum-main/website/_versions.json", "rb") as infile:
1313
versions = json.loads(infile.read())
1414

1515
with open(base_path + "/new-site/versions.html", "rb") as infile:

scripts/versions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Versions(props) {
4949
<tr>
5050
<td>
5151
{'latest'}
52-
{' (master)'}
52+
{' (main)'}
5353
</td>
5454
<td>
5555
<code>

website/siteConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const siteConfig = {
8585
docsSideNavCollapsible: false,
8686

8787
// URL for editing docs
88-
editUrl: "https://github.com/pytorch/captum/edit/master/docs/",
88+
editUrl: "https://github.com/pytorch/captum/edit/main/docs/",
8989

9090
// Disable logo text so we can just show the logo
9191
disableHeaderTitle: true,

0 commit comments

Comments
 (0)