-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Mark pants
as an explicit namespace package (rather than implicit)
#17563
Conversation
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.
Thanks!
You'll want to force this to build/test the wheels, to make sure it doesn't break anything in there.
(temporarily touching |
coolest touch I've seen! :D |
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.
That comment is precisely what I wanted, thanks!
pants.toml
Outdated
# ___________ ____ | ||
# ______/ \__// \__/____\ | ||
# _/ \_/ : //____\\ | ||
# /| : : .. / \ | ||
# | | :: :: \ / | ||
# | | :| || \ \______/ | ||
# | | || || |\ / | | ||
# \| || || | / | \ | ||
# | || || | / /_\ \ | ||
# | ___ || ___ || | / / \ | ||
# \_-_/ \_-_/ | ____ |/__/ \ | ||
# _\_--_/ \ / | ||
# /____ / | ||
# / \ / | ||
# \______\_________/ | ||
# |
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.
huh? nevermind
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.
(temporarily touching pants.toml to force CI to build+test wheels)
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.
huh? nevermind
was my reaction too... but I was "fortunate" enough to spot Josh's comment before saying anything ;)
ruh roh |
Oh so the failures are only on MacOS? Bother... |
What's the issue with VERSION? That has been a constant thorn in our side. |
@benjyw I updated the description to explain |
Buddy PR: pantsbuild/setup#135 |
Suggest not merging this PR until we are confident that we can update the launcher script to be useful for people who are using |
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.
I missed the VERSION shenanigans. Its not clear to me this is ship-itable. I'll bow out - the overall motivation seems weakish and this VERSION bit seems slapdashish.
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.
Not a fan of code in __init__.py
, and we don't do that anywhere else in the repo, so why here? I'm not sure it's important that the import name remain the same? This isn't part of an external API...
Also, possibly we can temporarily have a copy of VERSION in the root, temporarily, until we sort out the pants script issues?
On the contrary, the module name is An alternative solution is to keep |
@jsirois Can you be more specific? Your message only tells me how you feel about the change (and it isn't great) and not how to improve it so you feel differently. Otherwise it feels almost like criticism without the "constructive" bit 😞 |
The constructive bit is I'm clueless what is motivating this change. FWICT this shifts things around with no clear purpose or real upside. It started as that with the NS package re-jiggle and then added more apparently unmotivated changes with the VERSION thing. As such there is too much I don't understand here - clearly - to be a useful reiewer. |
Hm, perhaps I split the VERSION change off into a dedicated PR then. Hold on tight! 😄 (also, next time you're very welcome to say "hey I dont' understand why we're doing this. Can you update the description and/or make smaller PRs?". It's a lot less disheartening, and I very much value feedback. Especially yours) |
@thejcannon thanks. I'll stay bowed out of both though. It seems like others already active here may be clued in more. |
OK version moving is now in #17582. |
This moves `VERSION` to be in a subdirectory of the main `pants` package. This is because loading resources from top-level names of namespace packages is extremely hand-wavy and ambiguous (Who "owns" `pants`? The `pants` package or the `pants.testutil` package?) So now we have it unambiguously in `pants/_version/`. This pain is seen in #17563 which tries to convert `pants` to be an _explicit_ namespace package, which truly messes up resource loading via `pkgutil` and `importlib.resources` ([this long ticket](python/importlib_resources#68) has some context, too). This PR makes `_version/VERSION` a symlink to the existing `VERSION` so that https://github.com/pantsbuild/setup isn't broken. This "works" because Pants is symlink oblivious in source-tree traversal, and therefore sees `pants/_version/VERSION` as `pants/VERSION`.
Wheel building passed. |
Now we aren't touching our source tree during tests, which is causing unintended side-effects in #17520, because really we shouldn't be assuming the process sandboxes for tests are mutable (at least in the source tree). Not to mention that lengthy comment in
conftest.py
which should raise alarm.