Skip to content

No way to build packages with setup.py requirements #202

@warsaw

Description

@warsaw

This is admittedly a non-standard use case, but it breaks PyOxidizer on our internal libraries. For integration purposes we have something like the following at the top of our internal library setup.py files:

from distgradle import GradleDistribution

setup(
    distclass=GradleDistribution,
    ...
)

This works for us because our build system guarantees that distgradle will be installed in the venv before this setup.py is executed. However, this breaks PyOxidizer because even though I can add a PipInstallSimple rule to install distgradle before the PipRequirementsFile rule that pulls in all of our internal dependencies, IIUC PyOxidizer first builds dependencies in a temp venv because it might have to manipulate the built packages for static linking and such.

Thus PipInstallSimple(package='/path/to/distgradle.whl') will put distgradle in the target venv but it won't be available in the temp venv for our internal library build. For the same reason, adding distgradle to my requirements.txt also doesn't work.

While more rare, this can be a problem with PyPI packages, if they also have these kinds of implicit pre-install dependencies. I remember seeing such packages, but don't have an example handy. Another possible problem would be packages which build differently depending on what other packages are already installed (e.g. conditional dependencies, etc).

I was thinking about maybe adding a feature for "pre-installs" which would land in the temp venv before the rule would run. While ugly, it probably wouldn't be too terrible.

Another option would be to clone the target venv, or merge the target venv with the temp venv before you try to build the individual dependency. Merging and cloning venvs though is fraught with peril.

I'm open to other suggestions, and I'm motivated to help implement a solution (if it's not to complex).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions