OnroerendErfgoed / atramhasis

An online SKOS editor
http://atramhasis.readthedocs.io/
GNU General Public License v3.0
52 stars 11 forks source link

Introduce new build tools #854

Closed koenedaele closed 2 months ago

koenedaele commented 10 months ago

We're still using setup.py while there are better options around.

Wim-De-Clercq commented 9 months ago

Take care of https://github.com/OnroerendErfgoed/atramhasis/issues/711 when rewriting the hook.

The npm list command returns 1 when no match is found. subprocess.check_output has an automatic check=True internally, requiring the status to be 0.

We can use

libs = subprocess.run(["npm", "list", "-g", "grunt-cli"], stdout=subprocess.PIPE).stdout.decode()
Wim-De-Clercq commented 9 months ago

Babel

There's a tight integration between babel and setuptools which only just got updated on their master branch. commit

Currently we can hide all the required options for pybabel in the setup.cfg file. There is no proper alternative in babel. As see in the mkdocs project they replaced it by simply typing the full commands including all args.

There is a long standing open issue to support pyproject.toml in the babel project. This won't happen soon I guess.

I'm not exactly sure on what the steps are to build the wheels/sources for this project? We could probably write a build hook to automatically execute pybabel compile/extract/init/update actions before building the sources/wheel so they're always up-to-date and part of the distribution files.

Is there a value to automatically run extract, update, compile? Or any 1 of these?

koenedaele commented 9 months ago

I have very little knowledge of Babel, so I'm open to suggestion that make sense. Are we better off keeping the current setup around until Babel catches up?

Wim-De-Clercq commented 9 months ago

We don't have to. And even with my linked master commit not much would change (there would be no more setuptools dependency). My main complaint is that they don't provide an alternative to their setup.cfg integration. Usually projects would support a variety of pyproject.toml config, a babel.cfg file, environment variables, CLI args. Babel only supports setup.cfg and CLI args. Which I find a bit "meh".

But in general some commands that we may have been used to are a little longer because setup.cfg is not automatically read and there is no provided alternative.

old:
    $ python setup.py compile_catalog
new:
    $ pybabel compile --directory 'atramhasis/locale' --domain atramhasis --statistics true

(I'm updating it in docs/source/development.rst)

Wim-De-Clercq commented 7 months ago

Right now the atramhasis package does not include font-awesome fonts due to manifest.in restrictions. We have to make sure we these are added: *.ttf *.svg *.woff *.woff2 *.eot