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

AssertionError: No source dir for <project> when installing with constraints file a second time #5279

Closed
zzzeek opened this issue Apr 17, 2018 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@zzzeek
Copy link

zzzeek commented Apr 17, 2018

  • Pip version: 10.1
  • Python version: 2.7 but maybe others
  • Operating system: fedora linux

This use case works with pip 9.0.3, fails with pip 10.0. I'll illustrate this in terms of two of my packages, one of which has a dependency on the other. This is basically how my SQLAlchemy / Openstack CI servers run, where I have to inject specific git versions of SQLAlchemy into the build. Started failing as of pip 10.

# make a venv
python2 -m virtualenv .venv

# make sure we have pip 10
.venv/bin/pip install pip --upgrade

# checkout sqlalchemy and alembic, alembic has a dependency on sqlalchemy
git clone https://bitbucket.org/zzzeek/sqlalchemy
git clone https://bitbucket.org/zzzeek/alembic

# a requirements file
echo "SQLAlchemy" > requirements.txt

# make a constraints file with the "git master" of the SQLAlchemy checkout
echo "git+file://"`pwd`"/sqlalchemy@master#egg=SQLAlchemy" > constraints.txt

# install SQLAlchemy, works
.venv/bin/pip install -c constraints.txt  -r requirements.txt

# install project with a dependency on SQLAlchemy, fails
.venv/bin/pip install -c constraints.txt  -e alembic

upon installing Alembic, when it goes to install SQLAlchemy again I get this stack trace:

Traceback (most recent call last):
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 305, in run
    session=session, autobuilding=True
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 773, in build
    python_tag=python_tag,
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 633, in _build_one
    python_tag=python_tag)
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 637, in _build_one_inside_env
    if self.__build_one(req, temp_dir.path, python_tag=python_tag):
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 663, in __build_one
    base_args = self._base_setup_args(req)
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 659, in _base_setup_args
    SETUPTOOLS_SHIM % req.setup_py
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 415, in setup_py
    assert self.source_dir, "No source dir for %s" % self
AssertionError: No source dir for SQLAlchemy from git+file:///home/classic/Desktop/tmp2/sqlalchemy@master#egg=SQLAlchemy in ./.venv/lib/python2.7/site-packages (from -c constraints.txt (line 1))

Here's a full session with all output:


[classic@photon2 tmp2]$ python2 -m virtualenv .venv
New python executable in /home/classic/Desktop/tmp2/.venv/bin/python2
Also creating executable in /home/classic/Desktop/tmp2/.venv/bin/python
Installing setuptools, pip, wheel...done.
[classic@photon2 tmp2]$ .venv/bin/pip install pip --upgrade
Requirement already up-to-date: pip in ./.venv/lib/python2.7/site-packages (10.0.0)
[classic@photon2 tmp2]$ git clone https://bitbucket.org/zzzeek/sqlalchemy
Cloning into 'sqlalchemy'...
remote: Counting objects: 134717, done.
remote: Compressing objects: 100% (20714/20714), done.
remote: Total 134717 (delta 102656), reused 132244 (delta 100696)
Receiving objects: 100% (134717/134717), 27.99 MiB | 1.46 MiB/s, done.
Resolving deltas: 100% (102656/102656), done.
[classic@photon2 tmp2]$ git clone https://bitbucket.org/zzzeek/alembic
Cloning into 'alembic'...
remote: Counting objects: 8542, done.
remote: Compressing objects: 100% (2395/2395), done.
remote: Total 8542 (delta 6396), reused 7632 (delta 5665)
Receiving objects: 100% (8542/8542), 1.58 MiB | 1.34 MiB/s, done.
Resolving deltas: 100% (6396/6396), done.
[classic@photon2 tmp2]$ echo "SQLAlchemy" > requirements.txt
[classic@photon2 tmp2]$ echo "git+file://"`pwd`"/sqlalchemy@master#egg=SQLAlchemy" > constraints.txt
[classic@photon2 tmp2]$ cat constraints.txt
git+file:///home/classic/Desktop/tmp2/sqlalchemy@master#egg=SQLAlchemy
[classic@photon2 tmp2]$ .venv/bin/pip install -c constraints.txt  -r requirements.txt
Collecting SQLAlchemy from git+file:///home/classic/Desktop/tmp2/sqlalchemy@master#egg=SQLAlchemy (from -c constraints.txt (line 1))
  Cloning file:///home/classic/Desktop/tmp2/sqlalchemy (to revision master) to /tmp/pip-install-yEKWsH/SQLAlchemy
Building wheels for collected packages: SQLAlchemy
  Running setup.py bdist_wheel for SQLAlchemy ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-vH4DD5/wheels/15/7a/d3/6ddd5887b5a43082250a0b978babb3802f86939cb0252fd747
Successfully built SQLAlchemy
Installing collected packages: SQLAlchemy
Successfully installed SQLAlchemy-1.3.0b1.dev0
[classic@photon2 tmp2]$ .venv/bin/pip install -c constraints.txt  -e alembic
Obtaining file:///home/classic/Desktop/tmp2/alembic
Requirement already satisfied: SQLAlchemy from git+file:///home/classic/Desktop/tmp2/sqlalchemy@master#egg=SQLAlchemy in ./.venv/lib/python2.7/site-packages (from -c constraints.txt (line 1)) (1.3.0b1.dev0)
Collecting Mako (from alembic==0.9.10.dev0)
  Downloading https://files.pythonhosted.org/packages/eb/f3/67579bb486517c0d49547f9697e36582cd19dafb5df9e687ed8e22de57fa/Mako-1.0.7.tar.gz (564kB)
    100% |████████████████████████████████| 573kB 1.7MB/s 
Collecting python-editor>=0.3 (from alembic==0.9.10.dev0)
  Downloading https://files.pythonhosted.org/packages/65/1e/adf6e000ea5dc909aa420352d6ba37f16434c8a3c2fa030445411a1ed545/python-editor-1.0.3.tar.gz
Collecting python-dateutil (from alembic==0.9.10.dev0)
  Downloading https://files.pythonhosted.org/packages/0c/57/19f3a65bcf6d5be570ee8c35a5398496e10a0ddcbc95393b2d17f86aaaf8/python_dateutil-2.7.2-py2.py3-none-any.whl (212kB)
    100% |████████████████████████████████| 215kB 1.8MB/s 
Collecting MarkupSafe>=0.9.2 (from Mako->alembic==0.9.10.dev0)
  Downloading https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Collecting six>=1.5 (from python-dateutil->alembic==0.9.10.dev0)
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Building wheels for collected packages: SQLAlchemy, Mako, python-editor, MarkupSafe
Exception:
Traceback (most recent call last):
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 305, in run
    session=session, autobuilding=True
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 773, in build
    python_tag=python_tag,
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 633, in _build_one
    python_tag=python_tag)
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 637, in _build_one_inside_env
    if self.__build_one(req, temp_dir.path, python_tag=python_tag):
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 663, in __build_one
    base_args = self._base_setup_args(req)
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/wheel.py", line 659, in _base_setup_args
    SETUPTOOLS_SHIM % req.setup_py
  File "/home/classic/Desktop/tmp2/.venv/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 415, in setup_py
    assert self.source_dir, "No source dir for %s" % self
AssertionError: No source dir for SQLAlchemy from git+file:///home/classic/Desktop/tmp2/sqlalchemy@master#egg=SQLAlchemy in ./.venv/lib/python2.7/site-packages (from -c constraints.txt (line 1))

@techalchemy
Copy link
Member

duplicate of #5251

@zzzeek
Copy link
Author

zzzeek commented Apr 17, 2018

yup thanks!

@zzzeek zzzeek closed this as completed Apr 17, 2018
@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants