Maintenance tasks

- switch to Poetry
- document translations
- update ChangeLog
This commit is contained in:
Jan Dittberner 2023-06-03 16:06:25 +02:00
parent d02f4906e1
commit 362b6dff35
13 changed files with 1497 additions and 173 deletions

View file

@ -39,14 +39,14 @@ templates_path = ["_templates"]
# General information about the project.
project = "Debian Member Portfolio Service"
copyright = "2009-2021, Jan Dittberner"
copyright = "2009-2023, Jan Dittberner"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "0.7.2"
version = "0.7.4-dev"
# The full version, including alpha/beta/rc tags.
release = version
@ -87,15 +87,15 @@ htmlhelp_basename = "DebianMemberPortfolioServicedoc"
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class
# [howto/manual]).
latex_documents = [
(
"index",
"DebianMemberPortfolioService.tex",
"Debian Member Portfolio Service Documentation",
"Jan Dittberner",
"manual",
),
]
#latex_documents = [
# (
# "index",
# "DebianMemberPortfolioService.tex",
# "Debian Member Portfolio Service Documentation",
# "Jan Dittberner",
# "manual",
# ),
#]
# The name of an image file (relative to this directory) to place at the top of
# the title page.

View file

@ -21,38 +21,18 @@ To start working on the source code you need to have `git`_ installed::
.. _git: http://www.git-scm.com/
The canonical git repository for the Debian Member Portfolio Service is
available at https://debianstuff.dittberner.info/git/debianmemberportfolio.git.
available at https://git.dittberner.info/jan/debianmemberportfolio
To get a clone of the source code you change to a directory of your choice and
invoke git clone::
cd ~/src
git clone https://debianstuff.dittberner.info/git/debianmemberportfolio.git
git clone https://git.dittberner.info/jan/debianmemberportfolio.git
You should use `venv`_ to separate the development environment from your
system wide Python installation. You can install virtualenv using::
We use `Poetry <https://python-poetry.org/>`_ for dependency management. Run::
sudo aptitude install python3-venv
poetry install
.. _venv: https://docs.python.org/3/library/venv.html
When you have :command:`pyvenv` installed you should create a virtual
environment for Debian Member Portfolio Service development and install the
requirements using `pip <https://pypi.python.org/pypi/pip>`_::
mkdir ~/.virtualenvs
pyvenv ~/.virtualenvs/dmportfolio
. ~/.virtualenvs/dmportfolio/bin/activate
cd ~/src/debianmemberportfolio
pip install -r stretchreq.pip
.. note::
The Debian Member Portfolio Service instance at http://portfolio.debian.net/
is running on a Debian Stretch server, therefore :file:`stretchreq.pip`
contains dependency versions matching that Debian release.
The dependency download and installation into the virtual environment takes
some time.
to install all required dependencies in a Poetry managed virtual environment.
Debian Member Portfolio Service needs the JQuery JavaScript library to function
properly. The JQuery library is not included in the git clone and must be
@ -80,9 +60,8 @@ use by the code.
When you have both installed you can run::
. ~/.virtualenvs/dmportfolio/bin/activate
./synckeyrings.sh
python3 debianmemberportfolio/model/keyringanalyzer.py
poetry run python3 debianmemberportfolio/model/keyringanalyzer.py
The first synchronizes the keyrings in :file:`$HOME/debian/keyring.debian.org`
with files on the `keyring.debian.org <http://keyring.debian.org>`_ host. And
@ -94,7 +73,7 @@ Run a development server
You can run a development server using::
python3 run.py
poetry run python3 run.py
The output of this command should look like the following::
@ -152,3 +131,28 @@ the :py:func:`~debianmemberportfolio.model.dddatabuilder.build_data` function
of the module :py:mod:`debianmemberportfolio.model.dddatabuilder`, which uses
several helper functions from :py:mod:`debianmemberportfolio.model.keyfinder`
to access the key information.
Update translations
~~~~~~~~~~~~~~~~~~~
To update the translations you need to include the weblate repository as git remote::
git remote add weblate https://hosted.weblate.org/git/debian-member-portfolio-service/translations/
git fetch --all
Run the following to merge the latest translations into your local branch::
git merge weblate main
To extract translations from source files use::
poetry run pybabel extract --mapping-file=mapping.cfg --output-file=messages.pot --input-dirs=.
To merge translations with existing catalogs use::
poetry run pybabel update -i messages.pot -d debianmemberportfolio/translations
Compile the translations to gettext's .mo format using::
poetry run pybabel compile -d debianmemberportfolio/translations