pypa / pypa/setuptools

dependencies ignored when --root is used

Open
#570 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Hey,

This definitely seems like a bug, as I can find no reference to it (nor does it make sense) as a feature.

Issue:

When "--root" is used with setup.py (required for system package installs, e.g. RPM), dependencies listed in setup.py are ignored.

Steps to reproduce:

  1. Create a virtualenv
  2. Download a package with dependencies, like cryptography
  3. Run python setup.py install --root=anywhere

Observe that no dependencies are installed, even though listed.

Null Test:

  1. Create a virtualenv
  2. Download a package with dependencies, like cryptography
  3. Run setup.py install

Observe that dependencies ARE installed in this case.

What I would expect:

Either setup.py errors out that dependencies are missing (preferred), or it attempts to install the dependency packages into the same root.

Why this matters:

When creating RPMs or pacman pkgs of python packages (very common for production environments), you must install relative to the package root.

For example:

python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES

However, without dependency enforcement, the requirements of a package may change, and it will build without error, but portions of the installed module that reference the new requirements will fail.

If yall don't agree that the default behaviour should change, at least maybe we should add an argument like --ensure-deps which will error out if those dependencies are missing.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two setup.py install commands with --root and without it using a package such as cryptography. Trace the dependency handling for the --root path; done means dependencies are either installed into the same root or the command clearly errors when they are missing, with regression coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.