-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge requirements files and document dependency management (#21838)
- Loading branch information
Showing
14 changed files
with
487 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Project Dependencies | ||
|
||
This document describes how to add/upgrade dependencies in the project. | ||
We use pip to manage dependencies and hashin to lock versions. We use npm to manage frontend dependencies. | ||
|
||
## Python | ||
|
||
### Adding Python Dependencies | ||
|
||
We have 2 requirements files for python dependencies: | ||
|
||
- prod.txt | ||
- dev.txt | ||
|
||
Prod dependencies are used by our django app in runtime. | ||
They are strictly required to be installed in the production environment. | ||
|
||
Dev dependencies are used by our django app in development or by tools we use for linting, testing, etc. | ||
|
||
> If you add just the package name the script will automatically get the latest version for you. | ||
```bash | ||
hashin -r <requirements file> <dependency> | ||
``` | ||
|
||
This will add hashes and sort the requirements for you adding comments to | ||
show any package dependencies. | ||
|
||
When it's run check the diff and make edits to fix any issues before | ||
submitting a PR with the additions. | ||
|
||
### Upgrading Python Dependencies | ||
|
||
We mostly rely on dependabot for this. TBD Add more details. | ||
|
||
## Frontend | ||
|
||
### Adding Frontend Dependencies | ||
|
||
We use npm to manage frontend dependencies. To add a new dependency, use the following command: | ||
|
||
```bash | ||
npm install [package]@[version] --save --save-dev | ||
``` | ||
|
||
NPM is a fully featured package manager and so you can use the standard CLI. | ||
|
||
## Updating/Installing dependencies | ||
|
||
To update/install all dependencies, run the following command: | ||
|
||
```bash | ||
make update_deps | ||
``` | ||
|
||
This will install all python and frontend dependencies. It also ensures olympia is installed locally. | ||
By default this command will run in a docker container, but you can run it on a host by targetting the Makefile-docker | ||
|
||
```bash | ||
make -f Makefile-docker update_deps | ||
``` | ||
|
||
This is used in github actions for example that do not need a full container to run. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Development | |
|
||
tests | ||
debugging | ||
deps | ||
dependencies | ||
error_pages | ||
testing | ||
style | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.