Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace all mentions of master to main #4109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch:
# # Enable this and reduce the timeout below to check a PR is working
# pull_request:
# branches: [ master ]
# branches: [ main ]

jobs:
fuzz:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ env:

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]
workflow_dispatch:

# Cancel in-progress PR builds if another commit is pushed.
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Engine changes need to be approved by Zac-HD, as per
# https://github.com/HypothesisWorks/hypothesis/blob/master/guides/review.rst#engine-changes
# https://github.com/HypothesisWorks/hypothesis/blob/main/guides/review.rst#engine-changes
/hypothesis-python/src/hypothesis/internal/conjecture/ @Zac-HD

# Changes to the paper also need to be approved by DRMacIver or Zac, as authors
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ free to have a read of it in advance and go through it yourself if you'd like to
required, but it might speed up the process.

Once your pull request has a green build and has passed review, it will be merged to
master fairly promptly. This will immediately trigger a release! Don't be scared. If that
main fairly promptly. This will immediately trigger a release! Don't be scared. If that
breaks things, that's our fault not yours - the whole point of this process is to ensure
that problems get caught before we merge rather than after.

Expand Down
2 changes: 1 addition & 1 deletion conjecture-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "conjecture"
version = '0.7.0'
authors = ["David R. MacIver <david@drmaciver.com>"]

homepage = "https://github.com/HypothesisWorks/hypothesis/tree/master/conjecture-rust"
homepage = "https://github.com/HypothesisWorks/hypothesis/tree/main/conjecture-rust"
repository = "https://github.com/HypothesisWorks/hypothesis/"

keywords = ["testing", "fuzzing", "shrinking", "property-based"]
Expand Down
6 changes: 3 additions & 3 deletions guides/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Useful Files to Know About
--------------------------

The code associated with Conjecture lives in
`src/hypothesis/internal/conjecture <https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python/src/hypothesis/internal/conjecture>`_.
`src/hypothesis/internal/conjecture <https://github.com/HypothesisWorks/hypothesis/tree/main/hypothesis-python/src/hypothesis/internal/conjecture>`_.
There are a number of files in there,
but the most important ones are ``engine.py`` and ``data.py``.
``data.py`` defines the core type that is used to represent test cases,
Expand All @@ -98,13 +98,13 @@ the `testing guide <testing-hypothesis.rst>`_, but there are a couple
of areas that it's worth specifically highlighting for making changes
to the engine:

The first is `tests/conjecture/ <https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python/tests/conjecture>`_,
The first is `tests/conjecture/ <https://github.com/HypothesisWorks/hypothesis/tree/main/hypothesis-python/tests/conjecture>`_,
which is a set of unit tests designed to put the engine into particular scenarios to exercise specific behaviours,
with a goal of achieving 100% coverage on it in isolation (though it currently does not quite achieve that for some specific edge cases.
We may fix and enforce this later).

The other set of tests that are worth knowing about are the quality tests,
in `tests/quality <https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python/tests/quality>`_.
in `tests/quality <https://github.com/HypothesisWorks/hypothesis/tree/main/hypothesis-python/tests/quality>`_.
These assert specific hard to satisfy properties about the examples that Hypothesis finds -
either their existence, or something about the final shrunk result.

Expand Down
2 changes: 1 addition & 1 deletion guides/review.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Public API changes must satisfy the following:
Bug Fixes
~~~~~~~~~

1. All bug fixes must come with a test that demonstrates the bug on master and
1. All bug fixes must come with a test that demonstrates the bug on main and
which is fixed in this branch. An exception *may* be made here if the submitter
can convincingly argue that testing this would be prohibitively difficult.
2. Where possible, a fix that makes it impossible for similar bugs to occur is
Expand Down
2 changes: 1 addition & 1 deletion guides/strategies-that-shrink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ object at the same time, again so they can be modified or deleted together.

The exact behaviour of the shrinking is a topic of active research and
development, so if you are interested in the details we recommend reading
the `internals guide <https://github.com/HypothesisWorks/hypothesis/blob/master/guides/internals.rst>`_
the `internals guide <https://github.com/HypothesisWorks/hypothesis/blob/main/guides/internals.rst>`_
and the well-commented source code in
``hypothesis.internal.conjecture`` as well as David's ECOOP 2020 paper
`Test-Case Reduction via Test-Case Generation: Insights From the Hypothesis Reducer
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ and a mailing list <https://hypothesis.readthedocs.io/en/latest/community.html>`
If you want to receive occasional updates about Hypothesis, including useful tips and tricks, there's a
`TinyLetter mailing list to sign up for them <https://tinyletter.com/DRMacIver/>`_.

If you want to contribute to Hypothesis, `instructions are here <https://github.com/HypothesisWorks/hypothesis-python/blob/master/CONTRIBUTING.rst>`_.
If you want to contribute to Hypothesis, `instructions are here <https://github.com/HypothesisWorks/hypothesis-python/blob/main/CONTRIBUTING.rst>`_.

If you want to hear from people who are already using Hypothesis, some of them `have written
about it <https://hypothesis.readthedocs.io/en/latest/endorsements.html>`_.
Expand Down
12 changes: 6 additions & 6 deletions hypothesis-python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

source_suffix = ".rst"

# The master toctree document.
master_doc = "index"
# The main toctree document.
main_doc = "index"

# General information about the project.
project = "Hypothesis"
Expand Down Expand Up @@ -138,7 +138,7 @@ def setup(app):
_repo = "https://github.com/HypothesisWorks/hypothesis/"
extlinks = {
"commit": (_repo + "commit/%s", "commit %s"),
"gh-file": (_repo + "blob/master/%s", "%s"),
"gh-file": (_repo + "blob/main/%s", "%s"),
"gh-link": (_repo + "%s", "%s"),
"issue": (_repo + "issues/%s", "issue #%s"),
"pull": (_repo + "pull/%s", "pull request #%s"),
Expand Down Expand Up @@ -169,14 +169,14 @@ def setup(app):
latex_elements = {}

latex_documents = [
(master_doc, "Hypothesis.tex", "Hypothesis Documentation", author, "manual")
(main_doc, "Hypothesis.tex", "Hypothesis Documentation", author, "manual")
]

man_pages = [(master_doc, "hypothesis", "Hypothesis Documentation", [author], 1)]
man_pages = [(main_doc, "hypothesis", "Hypothesis Documentation", [author], 1)]

texinfo_documents = [
(
master_doc,
main_doc,
"Hypothesis",
"Hypothesis Documentation",
author,
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you want to detect this, you can

We use continuous deployment to ensure that you can always use our newest and
shiniest features - every change to the source tree is automatically built and
published on PyPI as soon as it's merged onto master, after code review and
published on PyPI as soon as it's merged onto main, after code review and
passing our extensive test suite.


Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/docs/packaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If you want to test Hypothesis as part of your packaging you will probably not w
Hypothesis itself uses for running its tests, because it has a lot of logic for installing and testing against
different versions of Python.

The tests must be run with fairly recent tooling; check the :gh-link:`tree/master/requirements/`
The tests must be run with fairly recent tooling; check the :gh-link:`tree/main/requirements/`
directory for details.

The organisation of the tests is described in the :gh-file:`hypothesis-python/tests/README.rst`.
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def local_file(name):
package_data={"hypothesis": ["py.typed", "vendor/tlds-alpha-by-domain.txt"]},
url="https://hypothesis.works",
project_urls={
"Source": "https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python",
"Source": "https://github.com/HypothesisWorks/hypothesis/tree/main/hypothesis-python",
"Changelog": "https://hypothesis.readthedocs.io/en/latest/changes.html",
"Documentation": "https://hypothesis.readthedocs.io",
"Issues": "https://github.com/HypothesisWorks/hypothesis/issues",
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-ruby/hypothesis-specs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DESCRIPTION
'Cargo.toml', 'LICENSE.txt', 'README.markdown', 'Rakefile',
'CHANGELOG.md'
]
s.homepage = 'https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-ruby'
s.homepage = 'https://github.com/HypothesisWorks/hypothesis/tree/main/hypothesis-ruby'
s.license = 'MPL-2.0'
s.extensions = Dir['ext/extconf.rb']
s.add_dependency 'rutie', '~> 0.0.3'
Expand Down
2 changes: 1 addition & 1 deletion tooling/scripts/ensure-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if [ ! -e "$TARGET/bin/python" ] ; then
back=$PWD
cd "$PYENV"
git fetch || echo "Update failed to complete. Ignoring"
git reset --hard origin/master
git reset --hard origin/main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is pyenv, which still uses master.

cd "$back"
fi

Expand Down
2 changes: 1 addition & 1 deletion tooling/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def local_file(name):
author_email="david@drmaciver.com",
packages=setuptools.find_packages(SOURCE),
package_dir={"": SOURCE},
url="https://github.com/HypothesisWorks/hypothesis-python/tree/master/tooling",
url="https://github.com/HypothesisWorks/hypothesis-python/tree/main/tooling",
license="MPL v2",
description="A library for property-based testing",
python_requires=">=3.7",
Expand Down
10 changes: 5 additions & 5 deletions tooling/src/hypothesistooling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def merge_base(a, b):


def point_of_divergence():
return merge_base("HEAD", "origin/master")
return merge_base("HEAD", "origin/main")


def has_changes(files):
Expand Down Expand Up @@ -105,7 +105,7 @@ def create_tag(tagname):
def push_tag(tagname):
assert_can_release()
subprocess.check_call(["git", "push", "origin", shlex.quote(tagname)])
subprocess.check_call(["git", "push", "origin", "HEAD:master"])
subprocess.check_call(["git", "push", "origin", "HEAD:main"])


def assert_can_release():
Expand Down Expand Up @@ -143,11 +143,11 @@ def all_files():
]


def changed_files_from_master():
def changed_files_from_main():
"""Returns a list of files which have changed between a branch and
master."""
main."""
files = set()
command = ["git", "diff", "--name-only", "HEAD", "master"]
command = ["git", "diff", "--name-only", "HEAD", "main"]
diff_output = subprocess.check_output(command).decode("ascii")
for line in diff_output.splitlines():
filepath = line.strip()
Expand Down
8 changes: 4 additions & 4 deletions tooling/src/hypothesistooling/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def do_release(package):
@task()
def deploy():
HEAD = tools.hash_for_name("HEAD")
MASTER = tools.hash_for_name("origin/master")
MASTER = tools.hash_for_name("origin/main")

print("Current head: ", HEAD)
print("Current master:", MASTER)
print("Current main:", MASTER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's rename this constant too


if not tools.is_ancestor(HEAD, MASTER):
print("Not deploying due to not being on master")
print("Not deploying due to not being on main")
sys.exit(0)

if "TWINE_PASSWORD" not in os.environ:
Expand Down Expand Up @@ -271,7 +271,7 @@ def update_python_versions():
install.ensure_python(PYTHONS[ci_version])
where = os.path.expanduser("~/.cache/hypothesis-build-runtimes/pyenv/")
subprocess.run(
"git fetch && git reset --hard origin/master",
"git fetch && git reset --hard origin/main",
Comment on lines 272 to +274
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyenv again. It's pretty weird that our scripts operate an entirely separate git repo, but here we are.

cwd=where,
shell=True,
capture_output=True,
Expand Down
4 changes: 2 additions & 2 deletions website/content/2016-04-19-rule-based-stateful-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ This feature is currently somewhat under-documented so hasn't seen as widespread
it could. However, there are at least two interesting real world examples:

1. Hypothesis uses it to test itself. Hypothesis has [tests of its example database](
https://github.com/HypothesisWorks/hypothesis-python/blob/master/tests/cover/test_database_agreement.py)
https://github.com/HypothesisWorks/hypothesis-python/blob/main/tests/cover/test_database_agreement.py)
which work very much like the above, and [a small model of its test API](
https://github.com/HypothesisWorks/hypothesis-python/blob/master/tests/nocover/test_strategy_state.py)
https://github.com/HypothesisWorks/hypothesis-python/blob/main/tests/nocover/test_strategy_state.py)
which generates random strategies and runs tests using them.
2. It's being used to [test Mercurial](https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-February/080037.html)
generating random. So far it's found [bug 5112](https://bz.mercurial-scm.org/show_bug.cgi?id=5112) and
Expand Down
2 changes: 1 addition & 1 deletion website/content/2016-05-31-looking-for-guest-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Details of how to guest post on here:
1. This site is [a Jekyll site on GitHub](https://github.com/HypothesisWorks/HypothesisWorks.github.io).
To add a post, create a markdown file in the _posts directory with the
appropriate structure and send a pull request.
2. You will want to add an entry for yourself to [the authors data file](https://github.com/HypothesisWorks/HypothesisWorks.github.io/blob/master/_data/authors.yml)
2. You will want to add an entry for yourself to [the authors data file](https://github.com/HypothesisWorks/HypothesisWorks.github.io/blob/main/_data/authors.yml)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (much) later: ooh, on top of the general finish-the-website-update #2943, I should make sure that all the urls point to this repo and archive the old one.

3. You of course retain all copyright to your work. All you're granting is the right to publish it on this site.

I'd particularly like to hear from:
Expand Down
26 changes: 13 additions & 13 deletions website/content/2016-06-05-incremental-property-based-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ List branches:

$ tlr branch
foo
* master
* main

Switch to an existing branch:

$ tlr checkout foo
* foo
master
main

Create a branch and switch to it:

$ tlr checkout -b new-branch
$ tlr branch
foo
master
main
* new-branch

Early on, my colleague and I found a bug: when you created a new branch with
Expand All @@ -48,10 +48,10 @@ this:
$ tlr checkout -b new-branch
$ tlr branch
foo
* master
* main
new-branch

The previously active branch (in this case, `master`) stayed active, rather
The previously active branch (in this case, `main`) stayed active, rather
than switching to the newly-created branch (`new-branch`).

Before we fixed the bug, we decided to write a test. I thought this would be a
Expand Down Expand Up @@ -204,8 +204,8 @@ Adding edge cases
-----------------

There's one valid branch name that this strategy *could* generate, but
probably won't: `master`. If we left the test just as it is, then one time in
a hojillion the strategy would generate `"master"` and the test would fail.
probably won't: `main`. If we left the test just as it is, then one time in
a hojillion the strategy would generate `"main"` and the test would fail.

Rather than waiting on chance, we encoded this in the `valid_branch_names`
strategy, to make it more likely:
Expand All @@ -214,31 +214,31 @@ strategy, to make it more likely:
def valid_branch_names():
return st.text(alphabet=letters, min_size=1, max_size=112).map(
lambda t: t.lower()
) | st.just("master")
) | st.just("main")
```

When we ran the tests now, they failed with an exception due to the branch
`master` already existing. To fix this, we used `assume`:
`main` already existing. To fix this, we used `assume`:

```python
from hypothesis import assume


@given(branch_name=valid_branch_names())
def test_checkout_new_branch(self, branch_name):
assume(branch_name != "master")
assume(branch_name != "main")
tmpdir = FilePath(self.mktemp())
tmpdir.makedirs()
repo = Repository.initialize(tmpdir.path)
repo.checkout(branch_name, create=True)
self.assertEqual(branch_name, repo.get_active_branch())
```

Why did we add `master` to the valid branch names if we were just going to
Why did we add `main` to the valid branch names if we were just going to
exclude it anyway? Because when other tests say "give me a valid branch name",
we want *them* to make the decision about whether `master` is appropriate or
we want *them* to make the decision about whether `main` is appropriate or
not. Any future test author will be compelled to actually think about whether
handling `master` is a thing that they want to do. That's one of the great
handling `main` is a thing that they want to do. That's one of the great
benefits of Hypothesis: it's like having a rigorous design critic in your
team.

Expand Down
2 changes: 1 addition & 1 deletion website/content/2017-09-14-multi-bug-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ avoiding slipping to new errors all together. Zac pushed back with some good que
around whether this was really the correct thing to do, and after some experimentation
and feedback I eventually hit on the design that lead to displaying all of the errors.

Our [review handbook](https://github.com/HypothesisWorks/hypothesis-python/blob/master/guides/review.rst)
Our [review handbook](https://github.com/HypothesisWorks/hypothesis-python/blob/main/guides/review.rst)
emphasises that code review is a collaborative design process, and I feel this was
a particularly good example of that. We've created a great culture of code review,
and we're reaping the benefits (and if you want to get in on it, we could always
Expand Down
Loading