A test app for our pyapp cookiecutter.
First you'll need to install:
- Git.
On Ubuntu:
sudo apt install git
, on macOS:brew install git
. - GNU Make.
This is probably already installed, run
make --version
to check. - pyenv. Follow the instructions in pyenv's README to install it. The Homebrew method works best on macOS. The Basic GitHub Checkout method works best on Ubuntu. You don't need to set up pyenv's shell integration ("shims"), you can use pyenv without shims.
- Docker Desktop. On Ubuntu follow Install on Ubuntu. On macOS follow Install on Mac.
Then to set up your development environment:
git clone https://github.com/hypothesis/test-pyapp.git
cd test-pyapp
make services
make help
To change what version of Python the project uses:
-
Change the Python version in the cookiecutter.json file. For example:
"python_version": "3.10.4",
-
Re-run the cookiecutter template:
make template
-
Re-compile the
requirements/*.txt
files. This is necessary because the samerequirements/*.in
file can compile to differentrequirements/*.txt
files in different versions of Python:make requirements
-
Commit everything to git and send a pull request
Add the package to the appropriate requirements/*.in
file(s) and then run:
make requirements
Remove the package from the appropriate requirements/*.in
file(s) and then run:
make requirements
We rely on Dependabot to keep all our dependencies up to date by sending automated pull requests to all our repos. But if you need to upgrade or downgrade a package manually you can do that locally.
To upgrade a package to the latest version in all requirements/*.txt
files:
make requirements --always-make args='--upgrade-package <FOO>'
To upgrade or downgrade a package to a specific version:
make requirements --always-make args='--upgrade-package <FOO>==<X.Y.Z>'
To upgrade all packages to their latest versions:
make requirements --always-make args=--upgrade