Pipenv: How to install packages with a vcs dependency in their setup.py

Created on 18 Dec 2018  ·  11Comments  ·  Source: pypa/pipenv

I'm working on a project at work for which one of the dependencies cannot be published to pypi, so I have to install it with the git url. Unfortunately I can't paste the setup.py here.

What I am trying to accomplish is to use the Pipfile/Pipfile.lock as a development environment for the tool and then deploy the tool with pip install. So I'm trying to specify all my dependencies in the setup.py and then just have the -e . line in my Pipfile. My package installs perfectly fine with pip install . and pipenv install --skip-lock. However, pipenv lock fails with the error (obviously redacted):

pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches packagename@ git+https://[email protected]/user/[email protected]#egg=packagename from git+https://[email protected]/user/[email protected]#egg=packagename                          
No versions found    

I know it's going to be difficult to give specific advice without more information, but I'm hoping you can give me the format and conditions that must be true (does the repo need to be tagged, etc) for pipenv to resolve this dependency the way pip does. Thanks

Dependency Resolution VCS

All 11 comments

Any thoughts here?

Can you provide the content of setup.py and how you specify your dependency? You can, of course, hide the sensitive part.

@frostming here's the setup.py with sensitive things changed

Any suggestions on the what the Pipfile should look like? My goal is now to use pipenv as the development environment and to install the package in "production" (other developer's machines and jenkins) using the requirements.txt file generated by pipenv lock -r. I've currently achieved that by installing everything BUT -e . in the pipfile directly and then requiring devs to install -e . inside the pipenv environment themselves... Is this the suggested workflow?

"""
Setup script for mypackage package
"""
import os
import sys

from subprocess import run, PIPE
from setuptools import setup, find_packages

def get_version():
    """
    Dynamically get the version for this package based on git
    """
    tag = run(['git', 'describe', '--tags', '--abbrev=0'], stdout=PIPE, universal_newlines=True)
    tag = tag.stdout[1:].strip()  # get rid of leading v for pip

    branch = run(['git', 'describe', '--all'], stdout=PIPE, universal_newlines=True)
    branch: str = branch.stdout.split('/')[-1]  # strip of 'heads/'
    if branch.startswith('prefix-'):
        branch = branch[3:].replace('-', '.')  # replace subsequent dashes with dots
        branch = ''.join(filter(lambda c: c.isdigit() or c == '.', branch))  # take all the digits and dots
        branch = branch.strip('.')  # strip unnecessary dots
        return f'{tag}.{branch}'

    return tag

try:
    TOKEN = os.environ["GITHUB_TOKEN"]
except KeyError:
    print("ERROR: Installation requires a github token be present in the environment.  Please `export GITHUB_TOKEN=<TOKEN>`.")
    sys.exit(1)

setup(
    name='mypackage',
    version=get_version(),
    packages=find_packages(),
    package_data={
        'mypackage': ['resources/*'],
    },
    include_package_data=True,
    install_requires=[
        'pip_package_dependency1',
        'pip_package_dependency2',
        f'vcs_private_dependency @ git+https://{TOKEN}@github.com/user/repo.get',

        #  These are only required for tests. setuptools doesn't like tests_require anymore for some reason
        'pytest-runner',
        'pytest-pylint',
        'pylint',
        'pytest',
    ],
    entry_points='''
        [console_scripts]
        mypackage=mypackage:cli
    ''',
)

I have a non-pypi but public github example of this issue, with the same type of setup.py trying to use a git repo as an install_requires dependency.

I attempt to install my python library using:
pipenv install -e git+https://github.com/itsayellow/mlutils.git#egg=mlutils

This has a dependency to another one of my git repo python libraries, tictoc.

pip can install mlutils fine, but pipenv fails:

[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches tictoc@ git+https://github.com/itsayellow/tictoc@master from git+https://github.com/itsayellow/tictoc@master
[pipenv.exceptions.ResolutionFailure]:       No versions found

However, pipenv will succeed if I install tictoc first using:
pipenv install -e git+https://github.com/itsayellow/tictoc.git#egg=tictoc

I can then successfully use pipenv to install mlutils that depends on tictoc:
pipenv install -e git+https://github.com/itsayellow/mlutils.git#egg=mlutils

So this depends on the order. If I try to install mlutils first with pipenv, it fails. But if I install its dependency tictoc using pipenv first, then a later install of mlutils will succeed.

https://github.com/itsayellow/mlutils
https://github.com/itsayellow/tictoc

@itsayellow I seem to be having precisely the same issue. Could it be that it is not attempting to perform a -e installation? If I attempt to install the repo using pipenv but without the -e argument it fails for me in the same way as you are reporting. So, is there some way to tell pipenv to install some VCS dependency using the -e flag?

@frostming I'm having the exact same issue outlined here--specifically that when I try to install a package using pipenv install -e git+ssh://[email protected]/my_org/[email protected]#egg=my_package if that package contains a VSC reference in it's setup.py in install_requires, e.g., "my_other_package @ git+ssh://[email protected]/my_org/[email protected]", then I get the error:

[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches my_other_package@ git+ssh://[email protected]/my_org/[email protected] from git+ssh://[email protected]/my_org/[email protected].

I can install the main package using pip just fine. This command will work:

pipenv run pip install -e git+ssh://[email protected]/my_org/[email protected]#egg=my_package

However this command will fail:
pipenv install -e git+ssh://[email protected]/my_org/[email protected]#egg=my_package

I can solve the problem by installing the package referenced in the setup.py file of my_package first:
pipenv install -e git+ssh://[email protected]/my_org/[email protected]"#egg=my_other_package

Then running:
pipenv install -e git+ssh://[email protected]/my_org/[email protected]#egg=my_package.

What's going on here? Seems like some kind of bug.

Here's the full log output using the actual packages I'm trying to install. They are private so you can't view them, but it should give you an idea of what's going on.

Setup.py file:

from setuptools import find_packages, setup

import biovault_etl

setup(
    name="biovault_etl",
    version=biovault_etl.__version__,
    description="Biovault ETL Code",
    author="BioVault",
    author_email="[email protected]",
    packages=find_packages(exclude=["tests*", "lambda*"]),
    install_requires=[
        "boto3>=1.12.37",
        "click>=7.1.1",
        "hl7>=0.3.4",
        "pdftotext>=2.1.4",
        "psycopg2-binary>=2.8.5",
        "pydantic>=1.4",
        "sqlalchemy>=1.3.16",
        "ids @ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1",
    ],
    dependency_links=[
        "git+ssh://[email protected]/qbio/[email protected]#egg=health-gorilla",
        "git+ssh://[email protected]/qbio/[email protected]#egg=ids",
    ],
    entry_points="""
        [console_scripts]
        etl=biovault_etl.cli.cli:cli
    """,
)

Failed Installation:

❯ pipenv install -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault_etl --verbose                                                                                                                                                         ─╯
Creating a virtualenv for this project…
Pipfile: /Users/cbh/dev/hacking/bvetl/Pipfile
Using /usr/local/Cellar/pipenv/2018.11.26_4/libexec/bin/python3.8 (3.8.2) to create virtualenv…
⠇ Creating virtual environment...created virtual environment CPython3.8.2.final.0-64 in 488ms
  creator CPython3Posix(dest=/Users/cbh/.local/share/virtualenvs/bvetl-i-Jw8lEd, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/cbh/Library/Application Support/virtualenv/seed-app-data/v1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

✔ Successfully created virtual environment! 
Virtualenv location: /Users/cbh/.local/share/virtualenvs/bvetl-i-Jw8lEd
Creating a Pipfile for this project…
Installing -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault_etl…
⠋ Installing...Installing 'biovault_etl'
$ ['/Users/cbh/.local/share/virtualenvs/bvetl-i-Jw8lEd/bin/pip', 'install', '--src', '/Users/cbh/.local/share/virtualenvs/bvetl-i-Jw8lEd/src', '--verbose', '--upgrade', '-e', 'git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault_etl', '-i', 'https://pypi.org/simple']
Adding biovault_etl to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
⠋ Pinning VCS Packages...INFO:pipenv.patched.notpip._internal.vcs.git:Cloning ssh://[email protected]/qbio/biovault-etl.git (to revision release/0.3.3) to /var/folders/w2/rkn1bm3d3ndclys0f81clbfw0000gn/T/requirementslibd0yxmo_5/biovault-etl
⠹ Pinning VCS Packages...Branch 'release/0.3.3' set up to track remote branch 'release/0.3.3' from 'origin'.
Switched to a new branch 'release/0.3.3'
✘ Locking Failed! 
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  biovault-etl from git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (from -r /var/folders/w2/rkn1bm3d3ndclys0f81clbfw0000gn/T/pipenvvwwqha7lrequirements/pipenv-xtt7hh1q-constraints.txt (line 2))

Finding the best candidates:
  found candidate -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (constraint was <any>)

Finding secondary dependencies:
Switched to a new branch 'release/0.3.3'
Branch 'release/0.3.3' set up to track remote branch 'release/0.3.3' from 'origin'.

New dependencies found in this round:
  adding ['boto3', '>=1.12.37', '[]']
  adding ['click', '>=7.1.1', '[]']
  adding ['hl7', '>=0.3.4', '[]']
  adding ['ids', '', '[]']
  adding ['pdftotext', '>=2.1.4', '[]']
  adding ['psycopg2-binary', '>=2.8.5', '[]']
  adding ['pydantic', '>=1.4', '[]']
  adding ['sqlalchemy', '>=1.3.16', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  biovault-etl from git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (from -r /var/folders/w2/rkn1bm3d3ndclys0f81clbfw0000gn/T/pipenvvwwqha7lrequirements/pipenv-xtt7hh1q-constraints.txt (line 2))
  boto3>=1.12.37
  click>=7.1.1
  hl7>=0.3.4
  ids@ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1 from git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1
  pdftotext>=2.1.4
  psycopg2-binary>=2.8.5
  pydantic>=1.4
  sqlalchemy>=1.3.16

Finding the best candidates:
  found candidate -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (constraint was <any>)
  found candidate boto3==1.12.42 (constraint was >=1.12.37)
  found candidate click==7.1.1 (constraint was >=7.1.1)
  found candidate hl7==0.3.4 (constraint was >=0.3.4)
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 198, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 198, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 263, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 175, in find_best_match
    raise NoCandidateFound(ireq, all_candidates, self.finder)
pipenv.patched.piptools.exceptions.NoCandidateFound: Could not find a version that matches ids@ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1 from git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1
No versions found
Was https://pypi.org/simple reachable?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 118, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 78, in _main
    results = resolve(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 61, in resolve
    return resolve_deps(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 718, in resolve_deps
    resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 395, in resolve
    raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches ids@ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1 from git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1
No versions found
Was https://pypi.org/simple reachable?
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  biovault-etl from git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (from -r /var/folders/w2/rkn1bm3d3ndclys0f81clbfw0000gn/T/pipenvvwwqha7lrequirements/pipenv-xtt7hh1q-constraints.txt (line 2))

Finding the best candidates:
  found candidate -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (constraint was <any>)

Finding secondary dependencies:
Switched to a new branch 'release/0.3.3'
Branch 'release/0.3.3' set up to track remote branch 'release/0.3.3' from 'origin'.

New dependencies found in this round:
  adding ['boto3', '>=1.12.37', '[]']
  adding ['click', '>=7.1.1', '[]']
  adding ['hl7', '>=0.3.4', '[]']
  adding ['ids', '', '[]']
  adding ['pdftotext', '>=2.1.4', '[]']
  adding ['psycopg2-binary', '>=2.8.5', '[]']
  adding ['pydantic', '>=1.4', '[]']
  adding ['sqlalchemy', '>=1.3.16', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  biovault-etl from git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (from -r /var/folders/w2/rkn1bm3d3ndclys0f81clbfw0000gn/T/pipenvvwwqha7lrequirements/pipenv-xtt7hh1q-constraints.txt (line 2))
  boto3>=1.12.37
  click>=7.1.1
  hl7>=0.3.4
  ids@ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1 from git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1
  pdftotext>=2.1.4
  psycopg2-binary>=2.8.5
  pydantic>=1.4
  sqlalchemy>=1.3.16

Finding the best candidates:
  found candidate -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault-etl (constraint was <any>)
  found candidate boto3==1.12.42 (constraint was >=1.12.37)
  found candidate click==7.1.1 (constraint was >=7.1.1)
  found candidate hl7==0.3.4 (constraint was >=0.3.4)
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 198, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 198, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 263, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 175, in find_best_match
    raise NoCandidateFound(ireq, all_candidates, self.finder)
pipenv.patched.piptools.exceptions.NoCandidateFound: Could not find a version that matches ids@ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1 from git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1
No versions found
Was https://pypi.org/simple reachable?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 118, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 78, in _main
    results = resolve(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 61, in resolve
    return resolve_deps(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 718, in resolve_deps
    resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 395, in resolve
    raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches ids@ git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1 from git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1
No versions found
Was https://pypi.org/simple reachable?

But if I run:
pipenv install -e git+ssh://[email protected]/qbio/immutable-data-store.git@release/2.3.1#egg=ids
then:
pipenv install -e git+ssh://[email protected]/qbio/biovault-etl.git@release/0.3.3#egg=biovault_etl
the installation succeeds. Here is the successful log:

Any insights?

Sorry for the issues everyone -- dependency links are deprecated, you will need to use the direct url syntax in the format of install_requires=["name@ git+ssh://github.com/org/repo.git@ref"] to include dependencies from version control. This should work as of the current _prerelease_ of pipenv which is available via pip install --upgrade --pre pipenv.

For example, using this take on the setup.py posted above:

from setuptools import find_packages, setup

setup(
    name="biovault_etl",
    version="0.0.1",
    description="Biovault ETL Code",
    author="BioVault",
    author_email="[email protected]",
    packages=find_packages(exclude=["tests*", "lambda*"]),
    install_requires=["vistir@ git+https://github.com/sarugaku/vistir.git@master"],
)

I was able to install:

 /t/test  pipenv install -e .
Installing -e .…
Adding biovault_etl to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✔ Success! 
Updated Pipfile.lock (c081cf)!
Installing dependencies from Pipfile.lock (c081cf)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 4/4 — 00:00:06
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

I believe this should be resolved with the prerelease so I will close this issue for now, the release should be live in about a week. Please feel free to open a new issue if you encounter any problems.

Thanks for your patience!

Thanks, @techalchemy for the response, and for all the work on the new release! The scenario you demonstrated above also worked on the v2018.11.26 version of pipenv too :) The problem arises when vistir package ALSO has a direct url link it its setup.py install_requires section. _This_ is when pipenv creates the error I noted above. Is this a separate issue I should open? Or perhaps maintain the thread here?

Thanks again for all the work on the new release--I know pipenv has gone through a lot of transitions over the past few years and it's great to see you carrying the project forward :)

@coltonbh so it's an issue of nesting? to put it visually:

(A): package w/ direct dependency in setup.py
(B): Random normal package
(C): Standard package
(D): another package w/ direct dependency in setup.py

This scenario would install ok:
(A)
| - (B)<-(A)

But this scenario would not:
(A)
| - (D)<-(A)

What about this one?
(C)
| - (D)<-C

i.e. A normal package as the root dependency, which depends on (D) which has a direct URL in its setup.py?

Are you saying that the last case is also broken?

Correct! The last two scenarios would fail. It appears to me, based on my understanding of the exception message, is that pipenv is literally trying to find version @ git+ssh://... of the package, which it can't find. (I think...)

Assuming we want to install D from other packages (reference D in install_requires of other packages), you'd need to place my_direct_dependency>=0.3.4 in the install_requires of D instead of the direct url. Then, since I could no longer install package D directly because my_direct_dependency doesn't exist on PyPi and installation would fail I'd need to install my_direct_dependency>=v0.3.4 "manually" so my Pipfile lists my_direct_dependency as being installed from the GitHub. Then I'd install the package I am working on that includes a reference to D>=vWhatever with pipenv install -e .. Pipenv would then correctly install my package that includes a reference to D and notice that locally my_direct_dependency, which D depends on, is already satisfied and installed from Github.

While this is somewhat annoying that we can't install packages that refer to other packages with direct dependencies, there's a case to be made that this is correct behavior based on the notion of abstract/concrete dependences. Pipenv documentation. Good blog post.

After research all this, I think the absolute purist would maintain that there should never be direct URLs in setup.py. However, if the python community feels this should be a supported feature, getting pipenv to make this work would be nice :)

Yeah the pre-release should work with this use case. Does it work if you set PIPENV_RESOLVE_VCS=1?

Was this page helpful?
0 / 5 - 0 ratings