Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pip-compile certain dependencies if psycopg2 is installed #1196

Closed
TjrGithub opened this issue Jul 31, 2020 · 1 comment
Closed

Cannot pip-compile certain dependencies if psycopg2 is installed #1196

TjrGithub opened this issue Jul 31, 2020 · 1 comment
Labels
bug Something is not working duplicate Duplicate of an existing issue/PR resolver Related to dependency resolver

Comments

@TjrGithub
Copy link

TjrGithub commented Jul 31, 2020

pip-compile cannot compile dependencies under certain circumstances. This setup used to work up to a few days ago. It errors out with:

RuntimeError: No stable configuration of concrete packages could be found for the given constraints after 10 rounds of resolving.
This is likely a bug.

The dependencies to compile need to include dbt.

The venv in which Pip-compile resides, needs to be "pip install -r" installed from a requirements.txt, which itself compiled from the following requirements. Simply installing the requirements with "pip install packagename" is not enough to trigger the bug.

flake8
mypy
pylint
pytest
pydocstyle
pip-tools
path
strictyaml
psycopg2
# bug disappears without psycopg2

Environment Versions

Ubuntu 19.10
Python 3.7.5
pip 20.2 from /venv/lib/python3.7/site-packages/pip (python 3.7)
pip-compile, version 5.3.0

Steps to replicate

docker container run -it -v $(pwd)/requirements.txt:/requirements.txt ubuntu:19.10 /bin/bash  -c \
'apt-get update; 
apt-get install -y python3.7 python3-venv libpq-dev postgresql-client-common postgresql-client-11 python3-dev build-essential;
/usr/bin/python3.7 -m venv venv ;
. venv/bin/activate ; 
pip install --upgrade pip ; 
pip install wheel ; 
pip install -r /requirements.txt ; 
echo 'dbt' > requirements.in ; 
pip-compile requirements.in'

where requirements.txt is the following:

#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile requirements.in
#
astroid==2.4.2            # via pylint
attrs==19.3.0             # via pytest
click==7.1.2              # via pip-tools
flake8==3.8.3             # via -r requirements.in
importlib-metadata==1.7.0  # via flake8, pluggy, pytest
iniconfig==1.0.1          # via pytest
isort==4.3.21             # via pylint
lazy-object-proxy==1.4.3  # via astroid
mccabe==0.6.1             # via flake8, pylint
more-itertools==8.4.0     # via pytest
mypy-extensions==0.4.3    # via mypy
mypy==0.782               # via -r requirements.in
packaging==20.4           # via pytest
path==15.0.0              # via -r requirements.in
pip-tools==5.3.0          # via -r requirements.in
pluggy==0.13.1            # via pytest
psycopg2==2.8.5           # via -r requirements.in
py==1.9.0                 # via pytest
pycodestyle==2.6.0        # via flake8
pydocstyle==5.0.2         # via -r requirements.in
pyflakes==2.2.0           # via flake8
pylint==2.5.3             # via -r requirements.in
pyparsing==2.4.7          # via packaging
pytest==6.0.1             # via -r requirements.in
python-dateutil==2.8.1    # via strictyaml
ruamel.yaml.clib==0.2.0   # via ruamel.yaml
ruamel.yaml==0.16.10      # via strictyaml
six==1.15.0               # via astroid, packaging, pip-tools, python-dateutil
snowballstemmer==2.0.0    # via pydocstyle
strictyaml==1.0.6         # via -r requirements.in
toml==0.10.1              # via pylint, pytest
typed-ast==1.4.1          # via astroid, mypy
typing-extensions==3.7.4.2  # via mypy
wrapt==1.12.1             # via astroid
zipp==3.1.0               # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip

Expected result

pip-compile completes running and outputs a correct requirements.txt for dbt.
...

Actual result

pip crashes:

Traceback (most recent call last):
  File "/venv/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
  File "/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/venv/lib/python3.7/site-packages/piptools/scripts/compile.py", line 458, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "/venv/lib/python3.7/site-packages/piptools/resolver.py", line 164, in resolve
    "This is likely a bug.".format(max_rounds=max_rounds)
RuntimeError: No stable configuration of concrete packages could be found for the given constraints after 10 rounds of resolving.
This is likely a bug.

...

@TjrGithub TjrGithub changed the title Cannot compile certain dependencies if psycopg2 is installed Cannot pip-compile certain dependencies if psycopg2 is installed Jul 31, 2020
@atugushev
Copy link
Member

atugushev commented Aug 1, 2020

This bug was fixed in pip-tools v5.3.1. See #1192.

@atugushev atugushev added bug Something is not working duplicate Duplicate of an existing issue/PR resolver Related to dependency resolver labels Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working duplicate Duplicate of an existing issue/PR resolver Related to dependency resolver
Projects
None yet
Development

No branches or pull requests

2 participants