No description
  • Python 82.4%
  • Just 14.6%
  • Makefile 3%
Find a file
bronsen 9b69027180
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
Merge pull request 'Rewrite documentation in reStructuredText' (#22) from rewrite-in-rest into main
Reviewed-on: #22
2026-08-12 15:25:25 +02:00
.forgejo/workflows prek: use actually required dependencies 2026-06-02 00:21:41 +02:00
.woodpecker CI: install tool that we ask uv to run 2026-08-12 15:23:36 +02:00
docs prek: don't mess with generated files 2026-08-09 01:17:50 +02:00
src/teilchensammler_cli test: ensure we parse and store input data 2026-08-08 22:30:57 +02:00
testing test: ensure invalid data does not end up in the database 2026-08-08 23:03:28 +02:00
.gitignore proj: keep coverage reports off version control 2026-08-08 23:57:16 +02:00
changelog.rst docs: changelog and release notes will be in reST as well 2026-08-10 00:55:23 +02:00
conf.py w/s: shuffe comments and reformat sphinx' conf.py 2026-08-10 00:55:23 +02:00
database.db add database.db hoping it helps on CI 2026-02-14 22:46:24 +01:00
index.rst docs: render changlog into generated output 2026-08-10 00:55:23 +02:00
justfile just: shuffle recipes, sort variables 2026-08-12 13:32:31 +02:00
Makefile proj: add sphinx 2026-08-09 12:58:42 +02:00
mise.lock mise: update tooling 2026-08-09 01:20:07 +02:00
mise.toml w/s: reformat .toml files 2026-08-09 02:11:07 +02:00
prek.toml w/s: reformat .toml files 2026-08-09 02:11:07 +02:00
pyproject.toml docs: changelog and release notes will be in reST as well 2026-08-10 00:55:23 +02:00
README.rst docs: hint at "stable" segment when bumping versions 2026-08-12 14:03:52 +02:00
requirements.dev.txt Release version 0.7.1 2026-08-09 02:31:04 +02:00
requirements.txt Release version 0.7.1 2026-08-09 02:31:04 +02:00
uv.lock docs: changelog and release notes will be in reST as well 2026-08-10 00:55:23 +02:00

==================
 Teilchensammler
==================

|badge-status-pipeline|_ |badge-test-count| |badge-coverage|

----

This is a little TUI based on `Textual`_ for entering new Teilchen and for
searching for existing Teilchen. Data is kept in a sqlite database.

It has tests.

------------------
 Running tests
------------------

.. code-block:: shell

  uv run pytest
  # or, if you have just
  just test

-----------------------------
 Observing the app's console
-----------------------------

The console can be used to observe log messages, since those logs really should
not go to the terminal.

You will need two terminals:

  1. One for showing the console,
  2. The other to run the app.

Since we use uv, the incantation is a bit different from the `official
documentation`_.

In one terminal:

.. code-block:: bash

  uv run textual console
  # or if you have just
  just console

And in the other:

.. code-block:: bash

  uv run textual run --dev src/teilchensammler_cli/__init__.py
  # or if you have just
  just run-console

------------------
 Developing
------------------

To re-create bronsen's development environment (sort of), you need several
shiny new toys:

- `just`_ to run the recipes from ``justfile``
- `uv`_ for all the python executing stuff, also venv and versioning
- `prek`_ as a replacement for pre-commit
- `sphinx`_ to render reStructuredText into HTML and other formats
- `ruff`_ to lint and format the python code
- `ty`_ as LSP and type checker
- `fish`_ to be able to run all recipes

I use just; just runs uv, prek, ruff, and so on. It's indirection and
abstraction all the way down. ``just setup`` will install a few of those tools
and ``mise install`` will install a few more.

However, you can also do without all these!


~~~~~~~~~~~~~~~~~~~~~
 Commit style
~~~~~~~~~~~~~~~~~~~~~

I prefer simple commit titles. Do provide as much detail as desired in the
message's body. Commit early, commit often; rebase frequently.

~~~~~~~~~~~~~~~~~~~~~
 Tests
~~~~~~~~~~~~~~~~~~~~~

Yes! Please write tests: simple ones, trivial ones; complicated ones, slow ones.

Tests should be written in pytest fashion. Use all the plugins except brittle
ones.

~~~~~~~~~~~~~~~~~~~~~
 Notes
~~~~~~~~~~~~~~~~~~~~~

When implementing or overriding one of the ``on_*`` methods:

  - do not use ``super()``
  - maybe ``prevent_default()``
  - maybe ``event.stop()``

-------------------------------
 Bug Reports, Feature Requests
-------------------------------

Create them by clicking "Issues" at the top of the `repo page`_. Do not worry
too much about labels.

Please be specific and provide logs, screenshots, or even a test that
replicates the problem.

~~~~~~~~~~~~~~~~~~~~~~~
 Architectural Changes
~~~~~~~~~~~~~~~~~~~~~~~

These are unlikely to be accepted. This tool is not intended to scale. There
might be a web front end thing automatically provided by `Textual`_.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Configurations for tools the bronsen does not currently use
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Oh sure, I'll accept those. Please create a merge request that adds those
configuration files.

------------------
 AI
------------------

Please don't: this is my little human-created thing.

---------------------------
 Creating a new release
---------------------------

(This is so bronsen can forget.)

- run tests; make sure they pass
- commit
- ``uv version --bump {segment}``

  Where ``segment`` is one of: major, minor, patch, stable, alpha, beta, rc,
  post, dev; prefer "stable".

  Employ RC releases to make sure the pieces fit together.

- commit
- When we really really want to release:
  - make sure ``just testall`` passes
  - ``touch releasenotes.rst`` and edit that file
  - ``just release {Release Name can be several words}``
- Ponder the magnificence of what was accomplished.

.. _official documentation: https://textual.textualize.io/guide/devtools/#console
.. _Textual: https://textual.textualize.io/
.. _uv: https://astral.sh/uv
.. _ty: https://docs.astral.sh/ty/
.. _just: https://just.systems/
.. _prek: https://prek.j178.dev/
.. _ruff: https://astral.sh/ruff
.. _repo page: https://code.c-base.org/infuanfu/teilchensammler-cli
.. _fish: https://fishshell.com/#platform_tabs
.. _sphinx: https://www.sphinx-doc.org/en/master/usage/installation.html
.. |badge-test-count| image:: docs/tests-badge.svg
.. |badge-coverage| image:: docs/coverage-badge.svg
.. |badge-status-pipeline| image:: https://ci.c-base.org/api/badges/10/status.svg
.. _badge-status-pipeline: https://ci.c-base.org/repos/10