-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
python module: allow specifying the pure kwarg in the installation object #10783
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
python module: allow specifying the pure kwarg in the installation object #10783
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10783 +/- ##
=======================================
Coverage 68.99% 68.99%
=======================================
Files 406 406
Lines 88630 88644 +14
Branches 19665 19665
=======================================
+ Hits 61148 61164 +16
+ Misses 22883 22881 -2
Partials 4599 4599
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks @eli-schwartz. I tested it with SciPy, it allowed me to remove 102 lines of pure: false
, and it caught a pretty bad bug (I had carefully checked all my install_sources()
calls, but not get_install_dir()
). Using find_installation(pure: false)
removed a couple of stray {py_purelib}
occurrences from intro-install_plan.json
.
|
||
py_plat = import('python').find_installation(pure: false) | ||
py_plat.install_sources('test.py', subdir: 'kw') | ||
py_plat.install_sources('test.py', pure: true, subdir: 'kwrevert') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be good to add a test file using get_install_dir
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eli-schwartz I just discovered that this PR in its current state actually breaks get_install_dir(pure: false)
. To reproduce:
$ # use current SciPy `main`
$ meson setup build --prefix=$PWD/build-install
$ grep purelib build/meson-info/intro-install_plan.json | wc -l
# will give 0 with meson master, and 1 with this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was dumb of me and happened because I didn't fully revert my first attempt.
This will close gh-10523. |
Thanks, I forgot there was an issue for it lol. |
9ea99ce
to
dee113b
Compare
|
||
|
||
_PURE_KW = KwargInfo('pure', bool, default=True) | ||
_PURE_KW = KwargInfo('pure', (bool, NoneType)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update the TypedDict annotations as well, and there are two, bot the PytInstallKw
is now wrong because pure
is Optional
, and the FindInstallationKw
needs the pure
kw added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a couple of small typing issues, otherwise this LGTM
dee113b
to
eb69fed
Compare
Fixes #10523
/cc @rgommers