Comments (12)
Try removing the configuration? This is the logic that happens
hatch/src/hatch/env/virtual.py
Lines 202 to 210 in 6153632
from hatch.
Oh, I see what you're saying. The Pythons that you've been managing with the CLI I'm assuming you have not been using the flag to add that to PATH. If you do that then it should pick that up because then it counts as "external". If you don't, then you can actually modify the python-sources
option: https://hatch.pypa.io/latest/plugins/environment/virtual/#options
from hatch.
Adding Hatch's Python to the PATH allowed the environment to find the correct install. I'm not sure why the original command did not do it, but it appears to be working now. Thanks for your help!
from hatch.
Happy to help and sorry for the issues! Documentation is improving albeit slowly 🙂
from hatch.
https://hatch.pypa.io/latest/plugins/environment/virtual/#python-resolution
from hatch.
Right, maybe I'm not understanding the philosophy properly, but this seems to say that the python
option overrides HATCH_PYTHON which makes sense except the python
option installs a new copy of the distribution in the hatch/env/virtual/.pythons/...
directory rather than use the existing install of that distribution that was installed by Hatch in hatch/pythons/...
My HATCH_PYTHON env variable points to hatch/pythons/...
. What I am suggesting is that Hatch should recognize that it has already installed a version of python in hatch/pythons/...
and use that rather than reinstall under hatch/env/virtual/.pythons/...
. Is that a valid suggestion?
from hatch.
I suppose this works for local setups, but not for CI/CD tools where that python
config is there to inform the instance of Hatch on the runner. Thanks for pointing out the code logic though. Perhaps a rule or a configuration can be added to use the Hatch-installed versions of Python.
from hatch.
Interesting... so if the installed Python was in my path it would've used that? I noticed the install command seems to have failed to add Python to my path even though I did not use the --private
flag.
from hatch.
Oh I forgot that it adds by default. Which shell are you using?
from hatch.
Both Powershell and ZSH? I use both.
from hatch.
- If you're on Windows then it should be supported in all cases: https://github.com/ofek/userpath/blob/981085be7669815a186420e1211ed9944ab928ba/userpath/interface.py#L40
- If not, then it appears that on non-Windows systems PowerShell is not supported. I have no idea how I would do that actually. https://github.com/ofek/userpath/blob/981085be7669815a186420e1211ed9944ab928ba/userpath/shells.py#L105
from hatch.
So if it didn't work on the first pass is the solution to just add it to my path after the fact?
from hatch.
Related Issues (20)
- Install a package from apt or source HOT 1
- Support for PEP 514 (Python registration in the Windows registry) in `hatch python install` HOT 1
- Running hatch build doesn't produce any executables, only wheel and stdist. HOT 15
- Hatch config set not working with pyproject.toml HOT 3
- Docs releases are tied to hatch version, not hatchling HOT 2
- Full feature/extra support HOT 2
- Feature: Pass version to custom metadata hook
- Feature: Support dynamic `optional-dependencies` in `hatch env` HOT 2
- hatch commands do not handle case-insensitive paths as cwd on Windows HOT 3
- Composite license expressions in template.licenses do not result in multiple licenses HOT 4
- `post-install-commands` are run before installing environment dependencies HOT 4
- Running pip show after hatch shell fails to show summary information from pyproject.toml HOT 1
- Error self-resolves during `hatch new --init` workflow HOT 3
- raised "SyntaxError: invalid syntax" in a /usr/bin/python2.7 environment HOT 2
- Environment Variables for all environments HOT 13
- When using MetadataHookInterface, `gui-script` is not generating entry point in wheel HOT 6
- Please make trove classifier validation optional/non-fatal HOT 2
- MetadataHookInterface with logging leads to failures HOT 3
- Ensure Environment Plugin Dependencies for `hatch fmt` HOT 6
- A direct reference with context formatting causes an error violating URL validation of packaging HOT 2
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 hatch.