Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
davidsanfal wants to merge7 commits intoconan-io:develop2
base:develop2
Choose a base branch
Loading
fromdavidsanfal:feature/uv#19297

Conversation

@davidsanfal
Copy link
Contributor

Changelog: (Feature | Fix | Bugfix): Describe here your pull request
Docs:https://github.com/conan-io/docs/pull/XXXX

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read theContributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to thedevelop branch, documenting this one.

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")
Copy link
Member

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

Copy link
ContributorAuthor

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

Copy link
Member

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?

Copy link
ContributorAuthor

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

"Scripts"ifplatform.system()=="Windows"else"bin")
# init the venv
ifpy_version:
self._crete_uv_venv(py_version)
Copy link
Member

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):?

Copy link
ContributorAuthor

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@czoidoczoidoczoido left review comments

@memshardedmemshardedmemsharded left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@davidsanfal@czoido@memsharded

[8]ページ先頭

©2009-2025 Movatter.jp