Skip to content

Commit 8799ebd

Browse files
authored
chore: Migrate from Poetry to uv (#63)
* Migrate from Poetry to uv for dependency management - Convert pyproject.toml from Poetry format to PEP 621 standard - Replace poetry.lock with uv.lock - Update CI workflow to use astral-sh/setup-uv@v4 instead of snok/install-poetry - Update all dependencies to latest versions: - infrahub-sdk: v1.12.2 -> v1.17.0 - ruff: 0.9.1 -> 0.14.10 - mypy: 1.14.1 -> 1.19.1 - pylint: 3.3.4 -> 4.0.4 - yamllint: 1.35.1 -> 1.37.1 - vale: 3.9.4.0 -> 3.13.0.0 - invoke: 2.1.2 -> 2.2.1 - types-pyyaml: 6.0.12.20250516 -> 6.0.12.20250915 * pin uv version * test ci fix * Add linting tasks and fix generated markdown documentation - Add markdownlint task to tasks/linter.py matching CI pipeline - Add pylint, ruff format check tasks to match CI - Create .markdownlintignore for node_modules and .venv - Fix Jinja templates to generate valid markdown: - Add blank lines around lists (MD032) - Use 4-space indentation for nested lists (MD007) - Trim descriptions to prevent double blank lines (MD012) - Fix table separator formatting - Disable MD060 (table column style) for dynamic tables - Fix MLAG description markdown formatting in .metadata.yml - Regenerate all reference documentation * Add markdownlint job to CI pipeline Add markdown-lint job that runs markdownlint on all .md and .mdx files when markdown files change, matching the local linter.markdown task.
1 parent 9dd38e5 commit 8799ebd

65 files changed

Lines changed: 2281 additions & 2122 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
timeout-minutes: 5
2323
outputs:
2424
documentation: ${{ steps.changes.outputs.documentation_all }}
25+
markdown: ${{ steps.changes.outputs.markdown_all }}
2526
python: ${{ steps.changes.outputs.python_all }}
2627
yaml: ${{ steps.changes.outputs.yaml_all }}
2728
steps:
@@ -38,41 +39,28 @@ jobs:
3839
if: needs.files-changed.outputs.python == 'true'
3940
needs: ["files-changed"]
4041
runs-on: "ubuntu-latest"
41-
strategy:
42-
matrix:
43-
python-version:
44-
- "3.12"
45-
poetry-version:
46-
- "1.8.5"
4742
timeout-minutes: 5
4843
steps:
4944
- name: "Check out repository code"
5045
uses: "actions/checkout@v4"
51-
- name: "Set up Python ${{ matrix.python-version }}"
46+
- name: "Set up Python"
5247
uses: "actions/setup-python@v5"
5348
with:
54-
python-version: ${{ matrix.python-version }}
55-
- name: "Install Poetry ${{ matrix.poetry-version }}"
56-
uses: "snok/install-poetry@v1"
49+
python-version: "3.12"
50+
- name: "Install uv"
51+
uses: "astral-sh/setup-uv@v5"
5752
with:
58-
version: ${{ matrix.poetry-version }}
59-
virtualenvs-create: true
60-
virtualenvs-in-project: true
61-
installer-parallel: true
62-
- name: "Setup Python environment"
63-
run: |
64-
poetry config virtualenvs.create true --local
65-
poetry env use ${{ matrix.python-version }}
53+
version: "0.9.18"
6654
- name: "Install dependencies"
67-
run: "poetry install --no-interaction --no-ansi --with dev"
55+
run: "uv sync --group dev"
6856
- name: "Linting: ruff check"
69-
run: "poetry run ruff check ."
57+
run: "uv run ruff check ."
7058
- name: "Linting: ruff format"
71-
run: "poetry run ruff format --check --diff ."
59+
run: "uv run ruff format --check --diff ."
7260
- name: "Mypy Tests"
73-
run: "poetry run mypy --show-error-codes ."
61+
run: "uv run mypy --show-error-codes ."
7462
- name: "Pylint Tests"
75-
run: "poetry run pylint --ignore .venv ."
63+
run: "uv run pylint --ignore .venv ."
7664

7765
yaml-lint:
7866
name: Run yaml lint
@@ -88,6 +76,24 @@ jobs:
8876
- name: "Linting: yamllint"
8977
run: "yamllint -s ."
9078

79+
markdown-lint:
80+
name: Run markdown lint
81+
if: needs.files-changed.outputs.markdown == 'true'
82+
needs: ["files-changed"]
83+
runs-on: "ubuntu-latest"
84+
timeout-minutes: 5
85+
steps:
86+
- name: "Check out repository code"
87+
uses: "actions/checkout@v4"
88+
- name: "Setup Node.js"
89+
uses: "actions/setup-node@v4"
90+
with:
91+
node-version: "20"
92+
- name: "Install markdownlint-cli"
93+
run: "npm install -g markdownlint-cli"
94+
- name: "Linting: markdownlint"
95+
run: "markdownlint '**/*.md' '**/*.mdx'"
96+
9197
schema-test:
9298
name: Test all schema files
9399
needs:
@@ -111,25 +117,29 @@ jobs:
111117
uses: actions/setup-python@v5
112118
with:
113119
python-version: "3.12"
114-
- name: Install Invoke
115-
run: poetry install --no-interaction --no-ansi --with dev
120+
- name: "Install uv"
121+
uses: "astral-sh/setup-uv@v5"
122+
with:
123+
version: "0.9.18"
124+
- name: Install dependencies
125+
run: uv sync --group dev
116126
- name: Set job name
117127
run: echo JOB_NAME="$GITHUB_JOB" >> $GITHUB_ENV
118128
- name: "Set environment variable INFRAHUB_BUILD_NAME"
119129
run: echo INFRAHUB_BUILD_NAME=infrahub-${{ runner.name }} >> $GITHUB_ENV
120130
- name: Initialize Infrahub
121-
run: poetry run invoke start
131+
run: uv run invoke start
122132
- name: Set infrahub address
123133
run: |
124134
PORT=$(docker compose -p $INFRAHUB_BUILD_NAME port infrahub-server 8000 | cut -d: -f2)
125135
echo "INFRAHUB_ADDRESS=http://localhost:${PORT}" >> $GITHUB_ENV
126136
- name: "Store start time"
127137
run: echo TEST_START_TIME=$(date +%s)000 >> $GITHUB_ENV
128138
- name: Load all schemas files
129-
run: poetry run invoke schemas.load-all-schemas
139+
run: uv run invoke schemas.load-all-schemas
130140
- name: "Clear docker environment and force vmagent to stop"
131141
if: always()
132-
run: poetry run invoke destroy
142+
run: uv run invoke destroy
133143

134144
documentation:
135145
defaults:
@@ -154,15 +164,22 @@ jobs:
154164
node-version: 20
155165
cache: 'npm'
156166
cache-dependency-path: docs/package-lock.json
157-
- name: "Setup Python environment"
158-
run: "pip install invoke toml"
167+
- name: "Install uv"
168+
uses: "astral-sh/setup-uv@v5"
169+
with:
170+
version: "0.9.18"
171+
- name: "Install Python dependencies"
172+
run: "uv sync"
173+
working-directory: ./
159174
- name: "Install dependencies"
160-
run: "invoke docs.install"
175+
run: "uv run invoke docs.install"
176+
working-directory: ./
161177
- name: "Generate reference documentation"
162-
run: "invoke docs.generate"
178+
run: "uv run invoke docs.generate"
163179
working-directory: ./
164180
- name: "Build docs website"
165-
run: "invoke docs.build"
181+
run: "uv run invoke docs.build"
182+
working-directory: ./
166183

167184
validate-documentation-style:
168185
if: |

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ MD034: false # no-bare-urls
1414
MD045: false # no alt text around images
1515
MD047: false # single trailing newline
1616
MD014: false # dollar signs used before commands
17+
MD060: false # table column style - disabled for generated tables

.markdownlintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/node_modules/
2+
.venv/

0 commit comments

Comments
 (0)