- Notifications
You must be signed in to change notification settings - Fork1.1k
Define the Python version used by PipEnv using UV to create the venv#19388
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:develop2
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| pip_env = PipEnv(self, py_version="3.11.6") | ||
| pip_env.install(["{pip_package_folder}"]) | ||
| pip_env.generate() | ||
| self.run(pip_env._get_env_python(pip_env._env_dir) + " --version") |
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 ugly access, need some nicer public API
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 only for testing purposes to verify that we are using the defined python version, but it has no real use in any recipe
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 related to the other ticket, if we want to give more visibility over the tools (uv or the Python version)
Onceuv is there, and it is possible to install different python versions inside thePipEnv i'd say it is super likely that users might want to runpython -m ... orpython -c ..., with that specific Python that they explicitly requested.
So thisself.run("python --version") is evidencing a very likely need of making that public API?
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.
Ah! In that case we can expose it without any problems, of course
conan/tools/system/pip_manager.py Outdated
| "Scripts"ifplatform.system()=="Windows"else"bin") | ||
| # init the venv | ||
| ifpy_version: | ||
| self._crete_uv_venv(py_version) |
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.
What other advantages of usinguv couldPipEnv enjoy?
Do we want a generic access interface to it like def install(self, packages, pip_args=None):?
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.
The install interface is the same, It only affects how the virtual environment is created
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Changelog: (Feature | Fix | Bugfix): Describe here your pull request
Docs:https://github.com/conan-io/docs/pull/XXXX
developbranch, documenting this one.