-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
check-python-versions --add 3.8 --drop 3.4 to update packages automatically. #3
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let's pass a parser function to argparse directly so we don't have to manually try/except etc. (I want this because I intend to add a few additional arguments that take version ranges.)
check-python-versions {--add|--drop|--update} VERSIONS will attempt to update your setup.py to add/drop/set the supported version classifiers. The update script is interactive and shows you the diff and waits for confirmation before making any changes.
Fixes TypeError in difflib because new_lines happened to be None because I forgot to return a value when update_call_arg_in_source fails.
When the stdin is redirected from /dev/null, this will apply the default action (no update). When the stdin is a terminal, ^D will be the same as hitting Enter and accepting the default action (no update) once.
(tox.ini still has the --fail-under=100 commented out because I intend to do more rapid prototyping on this branch.)
Let the updaters return new file contents so we can do what we want with them.
Support testing both 32-bit and 64-bit Pythons.
as long as they fit on one line.
"Better" means if all the build jobs are defined via matrix.include or jobs.include, then we'll attempt to modify those. Also handle environment.matrix better in appveyor.yml, and here "better" means without assuming 2-space indents.
The logic here is very fragile and I think only the very last job will be kept intact.
Lists nested more deeply could've confused the "parser".
mgedmin
changed the title
WIP: check-python-versions --add 3.8 --drop 3.4 to update packages automatically.
check-python-versions --add 3.8 --drop 3.4 to update packages automatically.
Apr 17, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updating all the files by hand is boring, especially when there are many packages (see eg. zopefoundation/meta#1).
This is a proof-of-concept that can update the files if they're formatted nicely enough. Currently it can handle all of my personal projects (https://projects.gedmin.as). I intend to make it handle zopefoundation too, and then see if people report bugs.
For completeness this needs
Optionally:
I'm not going to do these at this time:
setup(..., classifiers=[...])
i.e. the closing)
is on the same line as the closing]
? do I care?setup(classifiers=[...])
i.e. the keyword arg is on the same line as the opening(
? do I care?Already done:
classifiers=[]
like in zopefoundation/z3c.schema2xmlmatrix:
in appveryor.ymlKnown problems from testing
./check-python-versions --dry-run --drop -3.4 ~/src/zopefoundation/*
(and then searching for 3.4 in the output, meaning the drop didn't succeed -- this will miss other kinds of problems with the diff):jobs
instead ofpython
)=
)matrix
instead ofpython
)- os: linux
instead of- python: ...
)- os: linux
instead of- python: ...
)(
)- os: linux
instead of- python: ...
)- os: linux
instead of- python: ...
)- os: linux
instead of- python: ...
)Other problems I've noticed:
matrix
elements so that one was dropped long ago!)