2025-03-14 12:37:30 +01:00
|
|
|
# Teilchensammler: Collect parts in a list
|
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
## Badges
|
|
|
|
|
|
|
|
[](https://ci.c-base.org/repos/9)
|
2025-03-17 19:09:52 +01:00
|
|
|
[](https://hypothesis.readthedocs.io/)
|
2025-03-18 00:18:31 +01:00
|
|
|

|
|
|
|

|
2025-03-17 18:55:11 +01:00
|
|
|
|
2025-03-14 12:37:30 +01:00
|
|
|
## Development
|
|
|
|
|
|
|
|
This project makes use of [direnv] and [just].
|
|
|
|
|
|
|
|
[direnv] is used to set up environment variables and activate the virtualenv. I
|
|
|
|
recommend installing it and integrate it into your favourite shell. It works
|
|
|
|
well with fish shell.
|
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
[just] is used as a task runner.
|
|
|
|
|
|
|
|
[woodpecker-cli] is used to lint `.woodpecker/workflow.yaml`. It is available
|
|
|
|
from [homebrew].
|
|
|
|
|
|
|
|
[pytest] is the test runner. Invoke it using `just test` (any arguments will be
|
|
|
|
passed through to pytest).
|
2025-03-14 12:37:30 +01:00
|
|
|
|
|
|
|
### Getting started
|
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
Have Python >= 3.12 installed. I recommend [pyenv] (which in turn is easily
|
|
|
|
installed by [homebrew]).
|
2025-03-14 12:37:30 +01:00
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
Set up PostgreSQL, a role and a schema. I have it on localhost, using the
|
2025-03-14 14:15:39 +01:00
|
|
|
project name for role and schema name, and password. See `.env.test` for
|
2025-03-14 12:37:30 +01:00
|
|
|
providing connection information.
|
|
|
|
|
|
|
|
Clone the repo. `cd` into the project directory. ([direnv] should activate the
|
|
|
|
virtualenv.) Run `python -m pip install -U pip` to upgrade pip. Then `python -m
|
|
|
|
pip install -r requirements/dev.txt`.
|
|
|
|
|
|
|
|
Launch the dev server: `just serve` (or `python -m django runserver` when you
|
|
|
|
don't have just).
|
|
|
|
|
|
|
|
### Making changes
|
|
|
|
|
|
|
|
Change code, settings, templates, dependencies as you see fit. Run `just lint`
|
|
|
|
repeatedly. Don't forget migrations. Commit often.
|
|
|
|
|
|
|
|
### Using the App
|
|
|
|
|
|
|
|
`just serve` and open
|
|
|
|
[localhost:8000/collector](http://localhost:8000/collector/) in your browser.
|
|
|
|
|
|
|
|
## Dependency management
|
|
|
|
|
|
|
|
This project uses [pip-compile-multi] for hard-pinning dependencies versions.
|
|
|
|
Please see its documentation for usage instructions. In short,
|
|
|
|
`requirements/base.in` contains the list of direct requirements with occasional
|
|
|
|
version constraints (like `Django<2`) and `requirements/base.txt` is
|
|
|
|
automatically generated from it by adding recursive tree of dependencies with
|
|
|
|
fixed versions. The same goes for `test` and `dev`.
|
|
|
|
|
|
|
|
To upgrade dependency versions, run `just deps` (or `pip-compile-multi --uv`).
|
2025-03-17 18:55:11 +01:00
|
|
|
And to install those packages run `just sync`. To run both of those:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
just deps sync
|
|
|
|
# OR
|
|
|
|
just fd
|
|
|
|
# OR
|
|
|
|
just freshdeps
|
|
|
|
```
|
2025-03-14 12:37:30 +01:00
|
|
|
|
|
|
|
To add a new dependency without upgrade, add it to the appropriate .in file and
|
|
|
|
run `pip-compile-multi --no-upgrade` (no [just] recipe yet).
|
|
|
|
|
|
|
|
### Installing dependencies
|
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
For installation of dependencies always use `requirement/*.txt` files.
|
2025-03-14 12:37:30 +01:00
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
For example, the command `pip install -U -r requirements/dev.txt` will install
|
2025-03-14 12:37:30 +01:00
|
|
|
testing requirements and development tools.
|
|
|
|
|
2025-03-17 18:55:11 +01:00
|
|
|
A useful command is `pip-sync requirements/dev.txt`, it uninstalls packages
|
|
|
|
from your virtualenv that aren't explicitly specified as dependencies.
|
|
|
|
|
2025-03-14 12:37:30 +01:00
|
|
|
[pip-compile-multi]: https://pypi.org/project/pip-compile-multi/
|
|
|
|
[direnv]: https://direnv.net/
|
|
|
|
[just]: https://just.systems/
|
|
|
|
[pyenv]: https://github.com/pyenv/pyenv
|
|
|
|
[homebrew]: https://brew.sh/
|
2025-03-17 18:55:11 +01:00
|
|
|
[pytest]: https://pytest.org/
|