Skip to content

Commit 5a7c6b2

Browse files
authored
Merge pull request #3801 from camptocamp/ghci/backport/3799-to-master
[Backport master] Add generated SETTINGS.md with environment variables documentation
2 parents 9c209b7 + 2ec041f commit 5a7c6b2

8 files changed

Lines changed: 288 additions & 12 deletions

File tree

.github/workflows/main.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ jobs:
5151
env:
5252
GITHUB_EVENT: ${{ toJson(github) }}
5353

54+
- name: Settings documentation
55+
run: make settings-doc
56+
- run: git diff --exit-code --color
57+
- run: git diff --patch > /tmp/settings-doc.patch; git reset --hard || true
58+
if: failure()
59+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
60+
with:
61+
name: Update settings documentation.patch
62+
path: /tmp/settings-doc.patch
63+
retention-days: 1
64+
if: failure()
65+
5466
- name: Build
5567
run: make build
5668

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ repos:
5353
- id: prettier
5454
additional_dependencies:
5555
- prettier@2.8.4
56+
exclude: |-
57+
(?x)^(
58+
tilecloud_chain/SETTINGS\.md
59+
)$
5660
- repo: https://github.com/camptocamp/jsonschema-gentypes
5761
rev: 2.13.0
5862
hooks:

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ tests: build ## Run the unit tests
4343

4444
PYTEST_ARGS ?= --last-failed --full-trace
4545

46+
.PHONY: settings-doc
47+
settings-doc: ## Generate settings documentation
48+
poetry install --no-root
49+
PYTHONPATH=. poetry run settings-doc generate \
50+
--class=tilecloud_chain.settings.Settings \
51+
--output-format=markdown \
52+
--update=tilecloud_chain/SETTINGS.md \
53+
--between "<!-- generated env. vars. start -->" "<!-- generated env. vars. end -->" \
54+
--heading-offset=1
55+
4656
.PHONY: tests-fast
4757
tests-fast:
4858
docker compose up -d

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ make tests
167167

168168
- [Usage Guide](https://github.com/camptocamp/tilecloud-chain/blob/master/tilecloud_chain/USAGE.rst)
169169
- [Configuration Reference](https://github.com/camptocamp/tilecloud-chain/blob/master/tilecloud_chain/CONFIG.md)
170-
- [Environment variables](https://github.com/camptocamp/tilecloud-chain/blob/master/tilecloud_chain/settings.py)
170+
- [Environment variables](https://github.com/camptocamp/tilecloud-chain/blob/master/tilecloud_chain/SETTINGS.md)
171171

172172
## Contributing
173173

ci/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
poetry==2.4.1
12
c2cciutils==1.7.5
23
poetry-plugin-export==1.10.0
34
pre-commit==4.6.2

poetry.lock

Lines changed: 28 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pytest-check = "2.9.1"
6363
types-pyyaml = "6.0.12.20260724"
6464
ruff = "0.16.2"
6565
pylint = "4.0.7"
66+
settings-doc = "4.3.2"
6667

6768
[tool.poetry-dynamic-versioning]
6869
enable = true

0 commit comments

Comments
 (0)