How to keep setup.py install_requires and Pipfile in sync
See original GitHub issueI am working on a Python package with pipenv and am faced with the challenge of keeping setup(install_requires=...)
in sync with my Pipfile’s runtime dependencies. Is there a recommended approach?
[Answer 2019-08-23] Best practise as also discussed below:
For applications that are deployed or distributed in installers, I just use Pipfile.
For applications that are distributed as packages with setup.py, I put all my dependencies in install_requires.
Then I make my Pipfile depend on setup.py by running
pipenv install '-e .'
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:38
- Comments:49 (17 by maintainers)
Top Results From Across the Web
How do I sync values in setup.py / install_requires with ...
Within your setup.py : Define a function to read a section: def locked_requirements(section): """Look through the 'Pipfile.lock' to fetch ...
Read more >Simplifying Python Builds. A Single Source of Truth for…
Use the following code to gather packages from your Pipfile and set them for your install_requires keyword argument in a Python setup.py.
Read more >Advanced Usage of Pipenv - Python Packaging Authority
pipenv install --ignore-pipfile is nearly equivalent to pipenv sync , but pipenv ... Library dependencies are specified via install_requires in setup.py .
Read more >pipenv-setup
A beautiful python package development tool: sync dependencies in Pipfile or Pipfile.lock to setup.py . Never need again to change dependencies manually in ......
Read more >Dependency Management - PyScaffold 4.1 documentation
The greatest advantage in packaging Python code (when compared to other forms of ... of abstract dependencies using setuptools ' install_requires .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
check out this pipenv-setup package
It syncs pipfile/lockfile to setup.py
$ pipenv-setup sync
you can do
$ pipenv-setup sync --dev
to sync development dependencies to extra requires. or$ pipenv-setup sync --pipfile
to sync pipfile insteadand
$ pipenv-setup check
to do checks onlyone command to solve them all 💯
For applications that are deployed or distributed in installers, I just use Pipfile.
For applications that are distributed as packages with setup.py, I put all my dependencies in install_requires.
Then I make my Pipfile depend on setup.py by running
pipenv install '-e .'
.[Update 2019-08-23] I keep the dev packages in Pipfile nowadays, only the runtime dependencies get to live in setup.py.