-
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
Cleanups and refactors #39
base: master
Are you sure you want to change the base?
Conversation
I failed to notice f6f0ab8 meant I had not just made PEP517 the default on python 3, but actually made it the only option. Add a `--no-pep517` flag to permit overriding this default in the other direction. Considered, but rejected: - Using a `BooleanOptionalAction` to unify the two flags (would bump the minimal `argparse` version to 3.8 for marginal gain) - Keep f6f0ab8's defaulting trick for `IS_PY2` at least -- considering we also need to set defaults based on the python version requested, it makes more sense to group their setting all together
PEP517 packages still need the build backend as a `makedepend` -- build+install+wheel are insufficient to build the package. Separate this out from the other `makedepends` to highlight its importance, and share the configuration across PEP517/non-PEP517 builds.
I didn't notice wenLiangcan#30 unconditionally added space between `depends+=()` and the packaging lines in `package()`, even if no dependencies were passed. Thus, eg for `pip2pkgbuild pip` the result is ``` package() { cd "${srcdir}/${_src_folder}" python -m installer --destdir="${pkgdir}" dist/*.whl } ``` where it should be ``` package() { cd "${srcdir}/${_src_folder}" python -m installer --destdir="${pkgdir}" dist/*.whl } ```
Somehow, it escaped my notice that my addition of an |
We gave main an argv parameter without specifying a default. This breaks the default invocation by setuptools.
Ended up getting quite the scope creep on the refactors, so I'm pushing a version of the branch with just the |
5b39570
to
566841c
Compare
Pushed some of my refactors as well, so the edits are less significant (this reworked PR drops the last three refactors in my list above, cf https://github.com/wenLiangcan/pip2pkgbuild/compare/5b39570ba91512f9a0430fede1a5a4f057e95221..e5ddf1c) |
e5ddf1c
to
3bdbb72
Compare
Sorry, had just a couple trivial edits that I thought might as well get into this PR. |
(In case anyone was wondering what I meant by scope creep, I'm currently cleaning up the history of my refactors at https://github.com/hseg/pip2pkgbuild/tree/refactor) |
- Add/clarify docstrings - Remove useless lambdas (`lambda x: f(x)` is the same as `f`) - Use `is None` instead of relying on falsiness - Use list comprehensions instead of explicit loops - Use lazy substitution for logging (pylint W1201) - Use explicit encoding on files - Inline unnecessary variables - Drop unnecessary else branches - Drop unnecessary parameters - Rename Packager -> Pkgbuild for clarity - Use __private instead of _private for private methods, cf https://docs.python.org/3/reference/expressions.html#index-5 - Remove dead code: _get_source
3bdbb72
to
53c1676
Compare
Forgot to actually run the tests, everything should work now. |
Give main explicit args and add tests -- These are rudimentary for now,
but at least they check the forbidden/permitted flag combinations indeed work.
Refactors for pylint
lambda x: f(x)
is the same asf
)is None
instead of relying on falsinessRefactor CompressedFacade -- Use the class structure more
Avoid repeated appends -- Use
yield
to avoid repeated appendsRefactor Packager to reflect package splitting -- Instead of duplicating
variables for the
python2
andpython
branches, just keep a dict of thesplit metadata and iterate over it