项目作者: pmlk

项目描述 :
Reference for pipenv usage with dependency links to git repos
高级语言: Python
项目地址: git://github.com/pmlk/pipenv-app.git
创建时间: 2018-01-20T22:34:39Z
项目社区:https://github.com/pmlk/pipenv-app

开源协议:

下载


Pipenv App

Simple reference for pipenv usage with dependency links to (private) git repos.

See pipenv dependency (dependency of this project).

New (PEP 508?) way

setup.py

  1. from setuptools import setup
  2. setup(
  3. name='pipenvapp',
  4. packages=['pipenvapp'],
  5. version='0.0.0',
  6. include_package_data=True,
  7. # new way
  8. install_requires=[
  9. 'pipenvdependency @ git+https://github.com/pmlk/pipenv-dependency.git@master'
  10. ],
  11. # old way
  12. # install_requires=['PipenvDependency==0.0.0'],
  13. # dependency_links=["git+https://github.com/pmlk/pipenv-dependency.git@master#egg=pipenvdependency-0.0.0"],
  14. )

Installation

  1. $ git clone https://github.com/pmlk/pipenv-app.git
  2. $ cd pipenv-app
  3. $ pipenv install -e .

Despite an error the package and its sub-dependencies seem to be installed just fine
(see $ pipenv graph output below). However, the Pipfile.lock is missing.

  1. $ pipenv install -e .
  2. Creating a virtualenv for this project
  3. Pipfile: /Users/<username>/SoftwareDevelopment/pipenv-app/Pipfile
  4. Using /usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/python3.7 (3.7.2) to create virtualenv
  5. Creating virtual environment...Already using interpreter /usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/python3.7
  6. Using real prefix '/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7'
  7. New python executable in /Users/<username>/.local/share/virtualenvs/pipenv-app-vN89ij2s/bin/python3.7
  8. Also creating executable in /Users/<username>/.local/share/virtualenvs/pipenv-app-vN89ij2s/bin/python
  9. Installing setuptools, pip, wheel...
  10. done.
  11. Successfully created virtual environment!
  12. Virtualenv location: /Users/<username>/.local/share/virtualenvs/pipenv-app-vN89ij2s
  13. Creating a Pipfile for this project
  14. Installing -e .…
  15. Adding pipenvapp to Pipfile's [packages]…
  16. ✔ Installation Succeeded
  17. Pipfile.lock not found, creating…
  18. Locking [dev-packages] dependencies…
  19. Locking [packages] dependencies…
  20. ✘ Locking Failed!
  21. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/resolver.py", line 69, in resolve
  22. [pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
  23. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
  24. [pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
  25. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
  26. [pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
  27. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 395, in resolve
  28. [pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
  29. [pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches pipenvdependency@ git+https://github.com/pmlk/pipenv-dependency.git@master from git+https://github.com/pmlk/pipenv-dependency.git@master
  30. [pipenv.exceptions.ResolutionFailure]: No versions found
  31. [pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  32. First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
  33. Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  34. Hint: try $ pipenv lock --pre if it is a pre-release dependency.
  35. ERROR: ERROR: Could not find a version that matches pipenvdependency@ git+https://github.com/pmlk/pipenv-dependency.git@master from git+https://github.com/pmlk/pipenv-dependency.git@master
  36. No versions found
  37. Was https://pypi.org/simple reachable?
  38. [pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
  39. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
  40. [pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
  41. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
  42. [pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
  43. [pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 395, in resolve
  44. [pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
  45. [pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches pipenvdependency@ git+https://github.com/pmlk/pipenv-dependency.git@master from git+https://github.com/pmlk/pipenv-dependency.git@master
  46. [pipenv.exceptions.ResolutionFailure]: No versions found
  47. [pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  48. First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
  49. Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  50. Hint: try $ pipenv lock --pre if it is a pre-release dependency.
  51. ERROR: ERROR: Could not find a version that matches pipenvdependency@ git+https://github.com/pmlk/pipenv-dependency.git@master from git+https://github.com/pmlk/pipenv-dependency.git@master
  52. No versions found
  53. Was https://pypi.org/simple reachable?

Dependency Graph

In the pipenv-dependency project numpy is required just for kicks.

  1. $ pipenv graph 1
  2. pipenvapp==0.0.0
  3. - pipenvdependency [required: Any, installed: 0.0.0]
  4. - numpy [required: Any, installed: 1.16.2]

Old, now deprecated way

The following used to work for pip versions that respected the --process-dependency-link flag.

This approach indirectly makes use of the pip flag --process-dependency-links which is~/was~~ deprecated. ~
Read here and here for more information.

  1. from setuptools import setup
  2. setup(
  3. name='pipenvapp',
  4. packages=['pipenvapp'],
  5. version='0.0.0',
  6. include_package_data=True,
  7. install_requires=['PipenvDependency==0.0.0'],
  8. dependency_links=["git+https://github.com/pmlk/pipenv-dependency.git@master#egg=PipenvDependency-0.0.0"],
  9. )

Installation

  1. # set environment variable for --process-dependency-links
  2. $ export PIP_PROCESS_DEPENDENCY_LINKS=1
  3. $ git clone https://github.com/pmlk/pipenv-app.git
  4. $ cd pipenv-app
  5. $ pipenv install -e .