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

Add support for positional only arguments #1944

Merged
merged 3 commits into from
Apr 30, 2019

Conversation

pganssle
Copy link
Contributor

@pganssle pganssle commented Apr 29, 2019

PEP 570 adds "positional only" arguments to Python, which changes the
code object constructor. This adds support for Python 3.8.

I assume this is covered by existing tests, but it would be good to add a "nightly" build to the CI matrix.

Fixes #1943

@Zac-HD
Copy link
Member

Zac-HD commented Apr 29, 2019

Thanks @pganssle - this looks great to me! Three things before I can merge this:

  1. black would like "-quoted strings here.

  2. For our automatic deployment to work, we'll need a changelog file (hypothesis-python/RELEASE.rst). I suggest the following content:

    RELEASE_TYPE: patch
    
    This patch makes Hypothesis compatible with the Python 3.8 alpha, which
    changed the representation of code objects to support positional-only 
    arguments.  Note however that Hypothesis does not (yet) support such 
    functions as e.g. arguments to :func:`~hypothesis.strategies.builds`
    or inputs to :func:`@given <hypothesis.given>`.
    
    Thanks to Paul Ganssle for identifying and fixing this bug.
    
  3. You're also invited to add your name to the alphabetised list of authors in CONTRIBUTING.rst.

Then I'll merge ASAP - and hope to see you at PyCon!

@pganssle
Copy link
Contributor Author

Sure thing. I can do that in an hour or so.

This is also slightly tricky because it will break anyone testing with earlier alpha releases that don't include PEP 570. If that's not a concern we can leave as is, but if it is a concern, I can try and come up with a way to detec PEP 570 support and guard on that.

@Zac-HD
Copy link
Member

Zac-HD commented Apr 29, 2019

I'd prefer to keep it as simple as possible, so this form looks great 😄

(plus the string formatting thing noted above)

pganssle pushed a commit to pganssle/hypothesis that referenced this pull request Apr 29, 2019
@pganssle
Copy link
Contributor Author

Hm.. I'll rebase this once the previous release is done. I guess that's a problem with this system of "every PR triggers a release" (though presumably just a problem until the release bot or whatever removes RELEASE.rst from master.

@Zac-HD
Copy link
Member

Zac-HD commented Apr 29, 2019

Yep, sorry about that! Just a ~15 minute window where pushes get merge conflicts.

We've looked at a bors-like system but haven't quite needed it yet... though it would help at sprints.

pganssle and others added 3 commits April 29, 2019 18:27
PEP 570 adds "positional only" arguments to Python, which changes the
code object constructor. This adds support for Python 3.8.

Fixes GH HypothesisWorks#1943: HypothesisWorks#1943
@Zac-HD Zac-HD merged commit c56d14c into HypothesisWorks:master Apr 30, 2019
@pganssle
Copy link
Contributor Author

Thanks @Zac-HD, see you at PyCon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hypothesis breaks pytest on Python 3.8
2 participants