Skip to content

Commit 91e4594

Browse files
authored
Merge pull request #521 from flixOpt/feature/flow-system-first
Feature/flow system first
2 parents 423496a + 78969bd commit 91e4594

192 files changed

Lines changed: 63086 additions & 7730 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yaml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- 'flixopt/**'
10+
pull_request:
11+
paths:
12+
- 'docs/**'
13+
- 'mkdocs.yml'
14+
workflow_dispatch:
15+
workflow_call:
16+
inputs:
17+
deploy:
18+
type: boolean
19+
default: false
20+
version:
21+
type: string
22+
required: false
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
env:
29+
PYTHON_VERSION: "3.11"
30+
MPLBACKEND: Agg
31+
PLOTLY_RENDERER: json
32+
33+
jobs:
34+
build:
35+
name: Build documentation
36+
runs-on: ubuntu-24.04
37+
timeout-minutes: 30
38+
steps:
39+
- uses: actions/checkout@v5
40+
with:
41+
fetch-depth: 0
42+
43+
- uses: astral-sh/setup-uv@v7
44+
with:
45+
version: "0.9.10"
46+
enable-cache: true
47+
48+
- uses: actions/setup-python@v6
49+
with:
50+
python-version: ${{ env.PYTHON_VERSION }}
51+
52+
- name: Extract changelog
53+
run: |
54+
cp CHANGELOG.md docs/changelog.md
55+
python scripts/format_changelog.py
56+
57+
- name: Install dependencies
58+
run: uv pip install --system ".[docs,full]"
59+
60+
- name: Build docs
61+
run: mkdocs build --strict
62+
63+
- uses: actions/upload-artifact@v4
64+
with:
65+
name: docs
66+
path: site/
67+
retention-days: 7
68+
69+
deploy:
70+
name: Deploy documentation
71+
needs: build
72+
if: ${{ inputs.deploy == true && inputs.version != '' }}
73+
runs-on: ubuntu-24.04
74+
permissions:
75+
contents: write
76+
steps:
77+
- uses: actions/checkout@v5
78+
with:
79+
fetch-depth: 0
80+
81+
- uses: astral-sh/setup-uv@v7
82+
with:
83+
version: "0.9.10"
84+
enable-cache: true
85+
86+
- uses: actions/setup-python@v6
87+
with:
88+
python-version: ${{ env.PYTHON_VERSION }}
89+
90+
- name: Install mike
91+
run: uv pip install --system mike
92+
93+
- uses: actions/download-artifact@v4
94+
with:
95+
name: docs
96+
path: site/
97+
98+
- name: Configure Git
99+
run: |
100+
git config user.name "github-actions[bot]"
101+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
102+
103+
- name: Deploy docs
104+
run: |
105+
VERSION=${{ inputs.version }}
106+
VERSION=${VERSION#v}
107+
mike deploy --push --update-aliases --no-build $VERSION latest
108+
mike set-default --push latest

.github/workflows/release.yaml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
name: Run tests
8181
needs: [check-preparation]
8282
if: needs.check-preparation.outputs.prepared == 'true'
83-
uses: ./.github/workflows/test.yaml
83+
uses: ./.github/workflows/tests.yaml
8484

8585
build:
8686
name: Build package
@@ -188,37 +188,7 @@ jobs:
188188
name: Deploy documentation
189189
needs: [create-release]
190190
if: "!contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc')"
191-
runs-on: ubuntu-24.04
192-
permissions:
193-
contents: write
194-
steps:
195-
- uses: actions/checkout@v5
196-
with:
197-
fetch-depth: 0
198-
199-
- uses: astral-sh/setup-uv@v6
200-
with:
201-
version: "0.9.10"
202-
203-
- uses: actions/setup-python@v6
204-
with:
205-
python-version: ${{ env.PYTHON_VERSION }}
206-
207-
- name: Extract changelog
208-
run: |
209-
uv pip install --system packaging
210-
python scripts/extract_changelog.py
211-
212-
- name: Install docs dependencies
213-
run: uv pip install --system ".[docs]"
214-
215-
- name: Configure Git
216-
run: |
217-
git config user.name github-actions[bot]
218-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
219-
220-
- name: Deploy docs
221-
run: |
222-
VERSION=${GITHUB_REF#refs/tags/v}
223-
mike deploy --push --update-aliases $VERSION latest
224-
mike set-default --push latest
191+
uses: ./.github/workflows/docs.yaml
192+
with:
193+
deploy: true
194+
version: ${{ github.ref_name }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7-
branches: ["*"]
7+
branches: ["**"]
88
workflow_dispatch:
9-
workflow_call: # Allow release.yaml to call this workflow
9+
workflow_call: # Allow release.yaml to call this workflow.
1010

1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
python-version: ['3.10', '3.11', '3.12', '3.13']
48+
python-version: ['3.11', '3.12', '3.13', '3.14']
4949
steps:
5050
- uses: actions/checkout@v5
5151

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ venv/
88
.DS_Store
99
lib/
1010
temp-plot.html
11+
.cache
12+
site/
13+
*.egg-info
14+
uv.lock

.pre-commit-config.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ repos:
77
- id: check-yaml
88
exclude: ^mkdocs\.yml$ # Skip mkdocs.yml
99
- id: check-added-large-files
10+
exclude: ^examples/resources/Zeitreihen2020\.csv$
1011

1112
- repo: https://github.com/astral-sh/ruff-pre-commit
1213
rev: v0.12.4
1314
hooks:
14-
- id: ruff-check
15-
args: [ --fix ]
16-
- id: ruff-format
15+
- id: ruff-check
16+
args: [ --fix ]
17+
- id: ruff-format
18+
19+
- repo: https://github.com/kynan/nbstripout
20+
rev: 0.8.2
21+
hooks:
22+
- id: nbstripout
23+
files: ^docs/examples.*\.ipynb$

0 commit comments

Comments
 (0)