Comments (8)
I cannot reproduce the issue in a local environment.
While you install for Python 3.12, pkg_resources
is picked up in a Python 3.10 environment: /usr/local/py-utils/shared/lib/python3.10/site-packages/pkg_resources
. These are the shared libraries of pipx if I understand correctly. Seems like an environment issue to me 😕 Needs further investigation.
from copier.
@pawamoy exactly, its only happening when you are installing a package that has an executable via pipx where pipx itself was initially installed with anything <3.12. Pipx has this mechanism where they chain virtual envs, there is a shared virtual env and a virtual env per each package you install via pipx - the shared venv is created during initial pipx install.
On all default ubuntu github actions workers as well as github codespaces, pipx is preinstalled via 3.10. Hence when you additionally install 3.12 and try to use pipx to install using 3.12 python - it will fail due to that virtual env chaining where it tries to access the 3.10 venv (containing pkg_resources). Why is it doing so in that manner? I have 0 clues.
I will open this on pipx repo as well just in case but i still think the root cause is something to do with the plumbum package that copier is using
from copier.
Thanks for the explanation @aorumbayev! I agree it's confusing and I have 0 clue either how to fix. Maybe removing the shared venv of pipx before installing your project would fix it? That's a hack though. Maybe don't install with pipx? But if your project is an extension for pipx, you definitely want to install with it to test propertly.
The use of pkg_resources
in Plumbum indicates code that could be modernized a bit indeed, as nowadays I think the preferred way is to use importlib.resources
. Feel free to open an issue on their tracker, linking back to this one 🙂
from copier.
@pawamoy thanks, sure will fill the same issue on their repo. Hopefully a quick patch from their side is all it takes
from copier.
The root issue is the environment is misconfigured; a Python 3.10 site packages is in the path below the 3.12 one; trying to import setuptools gets the 3.10 one.
However, if this is not running localization, it's supposed to take a fast path and avoid this, but it wasn't happening for the "C" locale. Fixing that (out in 1.8.3) should fix this in most cases. And it's technically not a plumbum bug.
I've also got a importlib.metadata version, but I'm not sure we have great testing for localization, so going to wait on that a bit (and likely go 3.8+ soon).
from copier.
Thanks for your help @henryiii!
I've followed along the other opened issues, and can't understand where the Python 3.10 path is coming from either.
I feel like Copier can't do anything here to fix the issue, so I'd vote to close (@copier-org/maintainers). Happy to try and help in the Plumbum/pipx issues if someone tags me there 🙂
from copier.
Definitely looks like an issue with pipx. Seems the shared env is always there in sys.path
. I don't know pipx enough to understand why a shared venv is required, but it also doesn't seem to provide an option to disable it.
from copier.
Yes, I will close it here because there seems to be nothing Copier can do to fix it 🤷🏼♂️
from copier.
Related Issues (20)
- Exclude files or directories based on answers HOT 3
- Allow configuring Jinja with StrictUndefined HOT 3
- remove flake8 HOT 2
- Documentation is unclear to available validator methods HOT 2
- Organization avatar cut off HOT 3
- Answers Groups HOT 1
- Be able to go back to a previous answer in the template generation questions menu HOT 2
- support zip template from local or http endpoint HOT 5
- ⚠ CRITICAL: Copier 9.1.1 broken by too loose `pyyaml-include` requirement ⚠ HOT 22
- Add support for source git-repos where the template is located in a subdirectory HOT 5
- Improved logic for `when` for handling initial questions HOT 14
- Supply official shields.io badges
- default option for choices with multiselect HOT 5
- Name collision which renders repo formally broken and causes several side effects HOT 4
- Don't consider tasks for template unsafety if they're being skipped
- Can't update project when copying from local template HOT 1
- Updating the project creates a new .copier-answer.yml file HOT 3
- Conditional exclude items HOT 9
- Provide a way to integrate with nix templates
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 copier.