Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions .github/workflows/auto-version.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Auto Versioning

on:
pull_request:
types: [closed]
push:
branches:
- master

Expand All @@ -11,29 +10,22 @@ permissions:

jobs:
bump-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Bump version
id: bump
run: python scripts/bump_version.py

- name: Generate Changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --tag v${{ steps.bump.outputs.new_version }}
outputPath: CHANGELOG.md

- name: Sync Changelogs
Expand All @@ -44,23 +36,15 @@ jobs:
fi
done

- name: Commit and Tag
- name: Stage changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add CHANGELOG.md docs/en/CHANGELOG.md docs/de/CHANGELOG.md

# Add modified files, ignore those that don't exist
FILES="pyproject.toml pyadm1/__version__.py tests/__init__.py CHANGELOG.md docs/en/metrics.md docs/de/metrics.md docs/en/CHANGELOG.md docs/de/CHANGELOG.md"
for f in $FILES; do
if [ -f "$f" ]; then
git add "$f"
fi
done

if ! git diff --cached --quiet; then
git commit -m "chore(release): bump version to ${{ steps.bump.outputs.new_version }} [skip ci]"
git tag -a v${{ steps.bump.outputs.new_version }} -m "Release v${{ steps.bump.outputs.new_version }}"
git push origin master --tags
else
echo "No changes to commit"
fi
- name: Auto Version and Badges
uses: dgaida/auto-version-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-version: true
create-badge: true
11 changes: 5 additions & 6 deletions docs/de/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Aktuelle Abdeckung: **98.1%** (Ziel: 95%)

| Modul | Abdeckung |
|-------|-----------|
| `pyadm1.core` | 98.1% |
| `pyadm1.components` | 98.5% |
| `pyadm1.simulation` | 100.0% |
| `pyadm1.configurator` | 98.2% |
| \`pyadm1.core\` | 98.1% |
| \`pyadm1.components\` | 98.5% |
| \`pyadm1.simulation\` | 100.0% |
| \`pyadm1.configurator\` | 98.2% |

## Build-Status

Expand All @@ -24,5 +24,4 @@ Aktuelle Abdeckung: **98.1%** (Ziel: 95%)

## Wartung

- **Changelog**: Aktuell (v0.1.3)
- **Zuletzt aktualisiert**: 07.04.2026
Bitte beachten Sie die [Haupt-README](../../README.md) für die aktuelle Version und den Wartungsstatus.
11 changes: 5 additions & 6 deletions docs/en/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Current coverage: **98.1%** (Target: 95%)

| Module | Coverage |
|--------|----------|
| `pyadm1.core` | 98.1% |
| `pyadm1.components` | 98.5% |
| `pyadm1.simulation` | 100.0% |
| `pyadm1.configurator` | 98.2% |
| \`pyadm1.core\` | 98.1% |
| \`pyadm1.components\` | 98.5% |
| \`pyadm1.simulation\` | 100.0% |
| \`pyadm1.configurator\` | 98.2% |

## Build Status

Expand All @@ -24,5 +24,4 @@ Current coverage: **98.1%** (Target: 95%)

## Maintenance

- **Changelog**: Up to date (v0.1.3)
- **Last Updated**: 2026-04-07
Please see the [main README](../../README.md) for the latest version and maintenance status.
12 changes: 11 additions & 1 deletion pyadm1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
>>> results = plant.simulate(duration=30, dt=1/24)
"""

from pyadm1.__version__ import __version__
try:
from importlib.metadata import version, PackageNotFoundError
except ImportError: # pragma: no cover
# For Python < 3.8
from importlib_metadata import version, PackageNotFoundError # type: ignore

try:
__version__ = version("pyadm1")
except PackageNotFoundError: # pragma: no cover
# package is not installed
__version__ = "unknown"

# Core imports
from .configurator import BiogasPlant
Expand Down
9 changes: 0 additions & 9 deletions pyadm1/__version__.py

This file was deleted.

111 changes: 0 additions & 111 deletions scripts/bump_version.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
This package contains unit tests for the PyADM1 implementation
of the Anaerobic Digestion Model No. 1.
"""

__version__ = "0.1.3"
Loading