generate pip {dev-}requirements.txt from Pipfile.lock
See original GitHub issueMaybe add argument to pipenv lock --gen-pip-lockfiles(or something similar) which would generate both files automatically after vendoring. This is a must for external tools(or Heroku for example), for building packages etc …
Quick invoke task for those who stumble upon this
@task
def vendor(ctx):
with io.open('Pipfile.lock') as f:
data = json.load(f)
prod = []
dev = []
for name, meta in data['develop'].items():
dev.append('{}{}'.format(name, meta['version']))
for name, meta in data['default'].items():
prod.append('{}{}'.format(name, meta['version']))
with io.open('requirements.txt', 'wt') as r:
r.truncate(0)
r.seek(0)
r.write(u'\n'.join(sorted(prod)))
with io.open('dev-requirements.txt', 'wt') as r:
r.truncate(0)
r.seek(0)
r.write(u'\n'.join(sorted(dev)))
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Generate requirements.txt from Pipfile.lock #3493 - GitHub
When I run pipenv lock -r it ignores existing Pipfile.lock and does locking process again. There is a workaround for this: $ pipenv...
Read more >Python HOW: Create requirements.txt Using pipenv
This creates a Pipfile.lock file (or updates an existing one) in the project's directory, and of course your requirements.txt file with the required ......
Read more >How to freeze a requirement with pipenv? - Stack Overflow
This is the way that I was prompted by pipenv to generate a requirements.txt file from the project's Pipfile: pipenv lock --requirements.
Read more >Advanced Usage of Pipenv - Read the Docs
☤ Generating a requirements.txt ¶. You can convert a Pipfile and Pipfile.lock into a requirements.txt ...
Read more >Setting up a Python development environment with pipenv
Generate your own pipfile.lock · Put the requirements.txt file in your project directory · Run pipenv lock · Run pipenv install --ignore-pipfile - ......
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
This is now possible:
pipenv lock --requirements
will produce a requirements file for the non-dev requirements andpipenv lock --requirements --dev
will produce one for just the dev requirements.@frankh, this was a typo at the time, it should have been
pipenv install --requirements
. However, we’ve also changed this since then. The current version of pipenv will provide requirements with the commandpipenv lock --requirements
.