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

Add an option to lock -r only production dependencies #260

Closed
notpushkin opened this issue Mar 10, 2017 · 2 comments
Closed

Add an option to lock -r only production dependencies #260

notpushkin opened this issue Mar 10, 2017 · 2 comments

Comments

@notpushkin
Copy link

For example, to generate requirements.txt for legacy deployments. Of course, installing all the development dependencies is an option, but it can be hard (i. e. Fabric depends on cryptography which needs some C headers installed, but we don't need Fabric on the server in first place).

This can be tricky, though, depending on how we generate the current pipenv lock -r output.

@notpushkin
Copy link
Author

I'm currently using this, but it seems like a bit of a hack:

with open("requirements.txt", "w") as req:
    req.write("# This file is generaged on deploy - do not modify\n\n")
    operations.local("pipenv lock")
    lock = json.load(open("Pipfile.lock"))
    for name, dep in lock["default"].items():
        req.write("{name}{version} --hash={hash}\n".format(
            name=name,
            version=dep["version"],
            hash=dep["hash"]))

@nateprewitt
Copy link
Member

Hey @iamale, thanks for taking the time to open this issue. It happens to be a duplicate of #245 where Kenneth decided we won't currently be supporting requirements.txt with a differentiation between dev dependencies.

You'll find a comment here in that issue which notes a slightly simpler script using Pipenv to create a simplified requirements.txt. This will accomplish what you're currently trying to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants