Second level dependencies missing on for local file packages on >= 6.3.1 #1505
Closed
Description
Hi, thank you for the great tool!
There seems to be a regression with 6.3.1 (and 6.4.0). Dependencies of dependencies don't make it to the final result when using local packages.
Below is script to reproduce, problem seems to be in pip-tools as any recent tested versions of pip (21.3 and 21.2.4) produce them same problem.
Note : Tested with absolute files to remove the problematic relative files handling issues.
Environment Versions
- OS Type: Reproduced in OSX and a
python:3.8-buster
docker image - Python version:
Python 3.8.6
- pip version:
pip 21.3 from /private/tmp/pip-tools/venv/lib/python3.8/site-packages/pip (python 3.8)
- pip-tools version:
pip-compile, version 6.4.0
&&pip-compile, version 6.3.1
Steps to replicate
#!/usr/bin/env bash -x
mkdir /tmp/pip-tools && cd /tmp/pip-tools
mkdir -p project-a
cat > project-a/setup.py <<EOF
#!/usr/bin/env python
from setuptools import setup
setup(
name="project-a",
version="0.1",
install_requires=[
"pip-tools",
]
)
EOF
mkdir -p project-b
cat > project-b/setup.py <<EOF
#!/usr/bin/env python
from setuptools import setup
setup(
name="project-b",
version="0.1",
install_requires=[
"project-a",
]
)
EOF
cat > requirements.in <<EOF
file:///tmp/pip-tools/project-a#egg=project-a
file:///tmp/pip-tools/project-b#egg=project-b
EOF
virtualenv venv
venv/bin/pip install -U "pip==21.3"
venv/bin/pip install -U "pip-tools==6.3.0"
venv/bin/pip-compile -v requirements.in # Has all reqs
venv/bin/pip install -U "pip-tools==6.3.1"
venv/bin/pip-compile -v requirements.in # Has no sub reqs
venv/bin/pip install -U "pip-tools==6.4.0"
venv/bin/pip-compile -v requirements.in # Has no sub reqs
Expected result
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile requirements.in
#
click==8.0.3
# via pip-tools
pep517==0.11.0
# via pip-tools
pip-tools==6.4.0
# via project-a
project-a @ file:///tmp/pip-tools/project-a
# via
# -r requirements.in
# project-b
project-b @ file:///tmp/pip-tools/project-b
# via -r requirements.in
tomli==1.2.1
# via pep517
wheel==0.37.0
# via pip-tools
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
When it works, verbose log shows round 2 as
New dependencies found in this round:
adding ('click', '>=7', [])
adding ('pep517', '', [])
adding ('pip', '>=21.2', [])
adding ('setuptools', '', [])
adding ('wheel', '', [])
Removed dependencies in this round:
------------------------------------------------------------
Result of round 2: not stable
Actual result
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile requirements.in
#
project-a @ file:///tmp/pip-tools/project-a
# via
# -r requirements.in
# project-b
project-b @ file:///tmp/pip-tools/project-b
# via -r requirements.in
When it doesn't work, verbose log shows round 2 as
New dependencies found in this round:
adding ('click', '>=7', [])
adding ('pep517', '', [])
adding ('pip', '>=21.2', [])
adding ('setuptools', '', [])
adding ('wheel', '', [])
Removed dependencies in this round:
removing ('pip-tools', '', [])
------------------------------------------------------------
Result of round 2: not stable