-
Notifications
You must be signed in to change notification settings - Fork 192
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
adding prod and dev requirements for the backend #476
Conversation
Thank you for the pull request!The activist team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. It'd be great to have you! Maintainer checklist
|
✅ Deploy Preview for activist-org canceled.
|
Let's discuss this in the dev sync, @to-sta, and then we can finalize the readme/contributing guide :) Feel free to send along an idea of what the changes to those should be though! |
@andrewtavis made a description here about the seperation of production and development. I am not sure where to place it in the contrib. guide. It's relevant when we need to switch between prod and dev and for installing new packages or testing. In our backend development, we maintain a clean and efficient environment by separating production and development requirements. This is achieved using pip-tools, a set of command line tools designed to keep our pip-based packages fresh, even when we’ve pinned them. We create two different requirement files: To compile these To transition between the production and development environments, you can simply use the following commands: For the production environment:
For the development environment:
Let me know what you think? |
Can you fix the merge conflict here @to-sta and I'll merge it in? :) |
Merge conflict is resolved and I also added django-cors-headers to the requirements.in and requirements.txt file. That was still missing. The mypy step in the ci_backend check discovered the missing package 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this, @to-sta! I keep on saying that the dev setup is getting so good and then it keeps getting better! 😊🚀
Contributor checklist
Description
In this PR, I seperated development requirements and production requirements for the backend with pip-tools. I adjusted the backend workflow/dockerfile to use the development requirements (
requirements-dev.txt
).General setup for this, min. requirements are in
requirements.in
and additional req. for the develpment are inrequirements-dev.in
. They are compiled to requirements.txt and requiements-dev.txt (including referenced packages).For example the djangorestframework is part of the requirements.in file and when compiled will reference necessary packages via comment in the requirements.txt file.
I have tested to run docker-compose up --build with both requirements.
Before we consider merging this, we should update the readme and/or contrib. guide 😄. Mention how to use pip-tools, pip-compile and pip-sync.
Related issue