Skip to content

Conversation

davidsanfal
Copy link
Contributor

@davidsanfal davidsanfal commented Sep 26, 2025

@davidsanfal davidsanfal requested a review from czoido September 26, 2025 08:32
@davidsanfal davidsanfal marked this pull request as ready for review September 26, 2025 08:32
@czoido
Copy link
Contributor

czoido commented Sep 26, 2025

This won't pass until we merge the PR

----------------------------------

To use a tool installed with Python, we have to install it using the ``PipEnv install`` method.
We also have to call the ``PipEnv generate`` method to create a ``Conan Environment`` to adds the ``Python virtualenv path`` to the system path.
Copy link
Contributor

@czoido czoido Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use backticks mostly for things related to source code.

:maxdepth: 2

system/package_manager
system/pip_manager
Copy link
Contributor

@czoido czoido Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file should not be named pip_manager but pipenv or something similar.

davidsanfal and others added 9 commits September 29, 2025 09:37
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Comment on lines 7 to 18
The ``PipEnv`` helper installs Python packages with **pip** inside a dedicated virtual environment (**venv**),
keeping them isolated so they don't interfere with system packages or the Conan package itself.

.. currentmodule:: conan.tools.system

.. autoclass:: PipEnv
:members:
:inherited-members:

It is designed to be used in two different ways:

1. Using a Python package in a recipe.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this, probably the whole doc need to emphasize this is only for executable Python packages. This approach doesn't work for library-like Python code that you expect to use via import

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably an important note at the beginning to clarify this would help.

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor review


These two steps appear in the following recipe in the ``generate()`` method.
Calling it in this method ensures that the **Python package** and the **Conan Environment** will be available in the following steps.
In this case, in the build step, which is where we will use it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite know what this sentence is referring to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this means is that if you haven't called it in the generate method, it won't be available in the build method, because the conan environment has to be generated before calling build.

Co-authored-by: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com>
@memsharded memsharded added this to the 2.21 milestone Sep 29, 2025
@czoido czoido assigned AbrilRBS and czoido and unassigned AbrilRBS Sep 29, 2025
Co-authored-by: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com>
davidsanfal and others added 2 commits September 29, 2025 16:04
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
@czoido czoido merged commit b4978a1 into conan-io:develop2 Sep 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants