-
Notifications
You must be signed in to change notification settings - Fork 588
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
Codemods to automatically upgrade for newer Hypothesis versions #2705
Comments
Important note: |
I hope that they'll fix that soon! In the meantime, I'm optimistic that this will be fairly low-impact - if you're running codemods, that implies you've been using Hypothesis for a while and can probably upgrade library versions before trying the Python version upgrade. Even if some of your test files no longer compile under Python 3.9, using 3.8 to run |
Closing this because the remaining ideas don't seem worth the implementation effort; though I'd still be delighted to accept PRs if anyone would like to build more codemods 🙂 |
Hypothesis is a mature project with a stable API - but we do occasionally deprecate and eventually remove things. It would be nice if we shipped tools to automatically refactor affected code, and LibCST looks great for that!
Codemod ideas
Automatically fix deprecated code, to make updating Hypothesis easier:
min_magnitude=None
tomin_magnitude=0
(in First codemods: fix positional arguments for keyword-only parameters #2712)And of course deprecations aren't the only possible use for a refactoring tool:
assume()
calls on a single argument into.filter()
calls on the relevant strategy@st.composite
decorator for functions which could just return a strategy, because they have no dependencies between draws.General notes
The text was updated successfully, but these errors were encountered: