-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Describe how to use pip-tools with Flask and setup.py #787
Comments
Hello @slykar
Why not
IMO the |
Hi @atugushev I completely agree that You have an example on homepage which is great, but it's more about showing how I get questions like "How do I use it with Flask?" or "How do I use it with Django?" from colleagues I show I think I saw some other issues related to managing dev and prod dependencies on the issue tracker here, so it seems people are having some confusions / ideas / questions about using pip-tools in different scenarios. About my workflow. I'm usually putting When running in Docker i just run The That's not the point tough :) |
It's a good idea to have a cookbook for some of scenarios. Contributions are always welcomed :) |
Btw, why do you use I recommend to read this nice article https://caremad.io/posts/2013/07/setup-vs-requirement/ about when you should use setup.py or requirements.txt. Looks like you should use requirements.txt, not setup.py. |
I could use
Without installing your Flask application you won't be able to import it. So you either have to create a Using setup.py is recommended by Flask for larger apps: https://flask.palletsprojects.com/en/1.1.x/patterns/packages/ Using Maybe instead of creating a guideline for other frameworks |
It's not very clear how you should use
pip-compile
when developing a Flask application.In order to properly package a Flask application you need to create a
setup.py
file.You then install it using
python setup.py develop
to start working with the code.How I'm dealing with this:
setup.py
pip-compile
to generaterequirements.txt
filepip install -r requirements.txt -e .
to install pinned packages and Flask app in editable modeIt took me some time to figure this out (and stick to it), as I was trying too hard to make this work by just specifying
-r requirements.txt
and placing-e .
in eitherrequirements.txt
file by hand or adding this torequirements.in
.I think it might be useful to add an example usage like this, since you are using Flask in your examples anyway and it might be hard for newbies to figure this out.
The text was updated successfully, but these errors were encountered: