Commit 7c050fe7 authored by Jakub Ružička's avatar Jakub Ružička
Browse files

compat: introduce apkg compat level

in order to allow config file changes without disruption in the future.

Fixes: #48
parent e073b173
Pipeline #81704 passed with stage
in 6 minutes and 18 seconds
# current apkg version
from ._version import __version__ # noqa from ._version import __version__ # noqa
# current apkg compatibility level
COMPAT_LEVEL = 1
[project] [project]
# optional - is guessed from project dir name by default # recommended - guessed from project dir name by default
name = "apkg" name = "apkg"
# needed for make-archive # recommended - script to create project archive, needed for make-archive
make_archive_script = "scripts/make-dev-archive.sh" make_archive_script = "scripts/make-dev-archive.sh"
[upstream] [upstream]
# needed for get-archive # optional - needed for get-archive
archive_url = "https://gitlab.nic.cz/packaging/apkg/-/archive/v{{ version }}/apkg-v{{ version }}.tar.gz" archive_url = "https://gitlab.nic.cz/packaging/apkg/-/archive/v{{ version }}/apkg-v{{ version }}.tar.gz"
# script to check latest upstream version # optional - script to check latest upstream version
version_script = "scripts/upstream-version.py" version_script = "scripts/upstream-version.py"
[apkg]
# recommended - apkg compat level
compat = 1
...@@ -3,6 +3,7 @@ generate docs from apkg code/docstrings using mkdocs-macros-plugin ...@@ -3,6 +3,7 @@ generate docs from apkg code/docstrings using mkdocs-macros-plugin
""" """
import inspect import inspect
from apkg import COMPAT_LEVEL
from apkg import ex from apkg import ex
from apkg import pkgstyle from apkg import pkgstyle
from apkg.cli import cmd2mod from apkg.cli import cmd2mod
...@@ -21,6 +22,7 @@ def define_env(env): ...@@ -21,6 +22,7 @@ def define_env(env):
env.variables.pkgstyles = pkgstyle.PKGSTYLES env.variables.pkgstyles = pkgstyle.PKGSTYLES
env.variables.new_issue_url = APKG_NEW_ISSUE_URL env.variables.new_issue_url = APKG_NEW_ISSUE_URL
env.variables.exceptions = get_exceptions() env.variables.exceptions = get_exceptions()
env.variables.compat_level = COMPAT_LEVEL
@env.filter @env.filter
def relpath(path): def relpath(path):
......
...@@ -79,3 +79,22 @@ version_script = "scripts/upstream-version.py" ...@@ -79,3 +79,22 @@ version_script = "scripts/upstream-version.py"
This option overrides default auto-detection mechanism. This option overrides default auto-detection mechanism.
script example: {{ 'scripts/upstream-version.py' | file_link }} script example: {{ 'scripts/upstream-version.py' | file_link }}
## [apkg]
Config section related to `apkg` configuration and settings.
### apkg.compat
In order to allow config file format changes without breaking compatibility,
it's **strongly recommended** to include current apkg compatibility level in the config file.
That way `apkg` will be able work with old and new config formats without disruption in the future.
**current apkg compat level: {{ compat_level }}**
```
[apkg]
compat = {{ compat_level }}
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment