Comments (7)
@w4-donguk We upgraded Sphinx from 4.1.0 to 7.4.5. They removed the import of pkg_resources
since 4.4.0.
FWIW, the Sphinx upgrade only resolved our issue by not importing pkg_resources
. For other modules that really need to import pkg_resources
, they would still encounter this issue with the latest setuptools with Bazel.
I'm reporting mainly to make sure the community is aware of this unexpected side-effect. I agree with @jaraco that setuptools probably shouldn't really compromise for all kind of weirdness in the downstream systems. I personally haven't really got the time to dive into Bazel to see if there could be patches on Bazel rules to get it work as folks suggested.
from setuptools.
I'd prefer to do nothing here and to use the package naturally, and rely on downstream tooling to account for patching any jaraco.text
or to employ the proper fix using the latest Bazel, especially because the latest Setuptools no longer has control over which jaraco.text
is used (as it will prefer a site-installed copy to its own).
Actually, that gives me another idea for a workaround - if bazel (or the tooling around it) had a way to install a patched version of jaraco.text
(either without that property or with it renamed), Setuptools would use that version and not its bundled copy. One could package that up as jaraco.text-bazel-safe
and install it when installing Setuptools. It's ugly, but at least it places the maintenance responsibility nearer the cause.
I'm going to close this for now, but feel free to follow-up, especially if the proposed workarounds turn out to be too onerous, and we might consider re-introducing the patch of the vendored copy.
from setuptools.
I think this should be fixed by the just released 71.0.2, can you check against that?
from setuptools.
Seeing the same issue, wasn't fixed for me in 71.0.3.
Writing down more context to save someone else time.
bazel doesn't support whitespaces in paths There's an experimental flag that reportedly can be used if you're using bazel 7.0.0 or above.
The previous workaround looks like it was removed in this PR
Specifically this commit and this other commit removed the a regex filter that was deleting the bit of code loading the Lorem ipsum.txt file in the vendored copy of jaraco.
jaraco is unlikely to rename the file.
from setuptools.
Thanks for the report and detailed analysis. And sorry for the inconvenience while Setuptools works to clean up some cruft that's accumulated.
I'd forgotten that I'd built in a patch for jaraco.text when vendorizing it. I was really happy to be rid of all that tech debt in 9234fc3, but I'd been working from the assumption that the patches were there solely to support vendorizing and not there to support other issues, so the removal of the workaround introduced in #3077 was unintentional.
As setuptools moves toward a regime that doesn't depend on vendored packages, any workarounds that apply to the vendored package will become less viable. Setuptools 71 has a preference for naturally-installed packages. What happens in a Bazel-managed environment if jaraco.text
is installed naturally?
bazel doesn't support whitespaces in paths There's an experimental flag that reportedly can be used if you're using bazel 7.0.0 or above.
That's great news! I'd really like to know (a) if employing that flag fully addresses the issue, and (b) how viable it would be for users to adopt Bazel 7.
Assuming that's not a path to a long-term solution, is there another path by which setuptools and/or jaraco.text can be patched on import to the Bazel environment? I'd like for Setuptools not to have to bear the responsibility for compatibility with a downstream tool. I know at Google, which uses a similar tool, the jaraco.text was imported with a patch that renames the file to make it viable in that environment. Is there a way to do something similar for //target
?
from setuptools.
I can confirm that this issue still exists in 71.0.2 and 71.0.3. We are running Bazel 6.4.0. I'm not sure about what the effort would be for upgrading, so I'm leaving it for other folks who might be impacted by this to tell.
As for my particular use case, we were able to fix by upgrading the Sphinx version, which does not import pkg_resources
anymore. So, I'm no longer impacted.
from setuptools.
I can confirm that this issue still exists in 71.0.2 and 71.0.3. We are running Bazel 6.4.0. I'm not sure about what the effort would be for upgrading, so I'm leaving it for other folks who might be impacted by this to tell.
As for my particular use case, we were able to fix by upgrading the Sphinx version, which does not import
pkg_resources
anymore. So, I'm no longer impacted.
which version did you updated to?
from setuptools.
Related Issues (20)
- Instead, use pypa/build, pypa/installer or other standards-based tools. HOT 1
- importing `pkg_resources` injects setuptools's vendored dependencies in `sys.path` HOT 3
- ooo
- AttributeError and ModuleNotFoundError after release of 72.x HOT 8
- [BUG] Many packages are no longer installable after test command is removed HOT 127
- [FR] More gradual breakage of setuptools.command.test HOT 17
- [Docs] Missing recommendation on an upper bound version pin for build backends HOT 8
- [FR] Warn when metadata field is defined as dynamic, but not marked in project.dynamic HOT 1
- [Question] AttributeError: 'Extension' object has no attribute '_needs_stub' HOT 3
- Remove use of tag_build and tag_date in Setuptools HOT 6
- The docs build is failing on main.
- Equivalent for distutils.ccompiler.new_compiler needed HOT 2
- [BUG] pip install not working while installing packages defined in setup.py HOT 9
- [BUG] Vulnerabilities blocks installation on setuptools>71.0 HOT 2
- [CI] Inconsistent normalisation of requirement strings on macOS causing trouble in the CI HOT 1
- [BUG] msvc.py never checks `Microsoft.VisualStudio.Component.VC.Tools.arm64` and thus fails to detect MSVC
- Integration tests for `brotli` are failing HOT 2
- [BUG] Installation error importlib_metadata has no attribute 'EntryPoints HOT 3
- [BUG] setuptools version 73.0.0 breaks Pythran HOT 12
- CVE-2024-6345 vulnerability is not fixed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setuptools.