[project] create pyproject.toml, readme, version file

`pdm build` even builds this package; no idea if it would be
installable/usable though
This commit is contained in:
bronsen 2025-03-14 12:37:30 +01:00
parent a3a71f318d
commit 474df0342c
3 changed files with 91 additions and 0 deletions

67
README.md Normal file
View file

@ -0,0 +1,67 @@
# Teilchensammler: Collect parts in a list
## 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.
[just] ist used as a task runner.
### Getting started
Have Python >= 3.12 installed. I use [pyenv] (which in turn is installed by [homebrew]).
Set up Postgresql, a role and a schema. I have it on localhost, using the
project name for role and schema name, and password. See `.env.sample` for
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`).
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
For installation always use `.txt` files.
A useful command is `pip-sync requirements/dev.txt`, it uninstalls packages
from your virtualenv that aren't listed in the file.
For example, command `pip install -Ue
. -r requirements/dev.txt` will install this project in development mode,
testing requirements and development tools.
[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/

3
VERSION.py Normal file
View file

@ -0,0 +1,3 @@
# calver schema YYYY.0M.Micro (see also https://calver.org/#scheme)
__version__ = "2025.03.1"

View file

@ -1,3 +1,16 @@
[project]
name = "teilchensammler"
description = "Build a list of parts in a pile to help sorting and categorization"
readme = "README.md"
dynamic = [
"version",
]
requires-python = ">= 3.12"
# dependencies are in folder .dependencies/*.in
authors = [
{ name = "bronsen", email = "kontakt+teilchensammler@nrrd.de" },
]
[tool.pytest.ini_options]
pythonpath = "."
python_files = [
@ -10,3 +23,11 @@ addopts = [
"--capture=sys",
]
[build-system]
requires = [
"pdm-backend",
]
build-backend = "pdm.backend"
[tool.pdm.version]
source = "file"
path = "VERSION.py"