-
Notifications
You must be signed in to change notification settings - Fork 12
Enable UV in build and CI #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bc7fce7
migrate to uv
mgovers 1f3943c
migrate remaining pipelines to uv
mgovers ca4574c
format docs
mgovers 2b14815
update readme with uv
mgovers 3529ed3
markdownlint
mgovers e5e4901
use mypy
mgovers a0d173d
re-add missing download wheelhouse
mgovers 8361de9
fix typo validation tests ci
mgovers b25af3f
mypy + bump pre-commit
mgovers c57b41f
mypy src
mgovers 3925e9e
bump markdownlint-cli in ci
mgovers f3b4be5
add recent dependabot changes
mgovers effb942
resolve comments
figueroa1395 27ff5bc
Merge branch 'main' into feature/enable-uv
figueroa1395 5c036c9
update uv lock
figueroa1395 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| # | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
|
|
||
|
|
||
| name: Check PR Labels | ||
|
|
||
| on: | ||
|
|
||
110 changes: 110 additions & 0 deletions
110
.github/workflows/refresh-lock-and-linter-dependencies.yml
figueroa1395 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| # SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org> | ||
| # | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
|
|
||
| name: Refresh lock and linter Dependencies | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| create-pr: | ||
| type: boolean | ||
| description: "Whether to create a pull request with the changes" | ||
| required: false | ||
| default: false | ||
| workflow_dispatch: | ||
| inputs: | ||
| create-pr: | ||
| type: boolean | ||
| description: "Whether to create a pull request with the changes" | ||
| required: false | ||
| default: false | ||
| schedule: | ||
| - cron: "0 2 * * 0" # Every Sunday at 2:00 UTC | ||
|
|
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }}-linter-dependencies | ||
| cancel-in-progress: true | ||
|
|
||
|
|
||
| jobs: | ||
| refresh-lock-and-linter-dependencies: | ||
| name: Refresh lock and linter Dependencies | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
|
|
||
| - name: upgrade uv lock | ||
| run: uv lock --upgrade | ||
|
|
||
| - name: Install linters from uv | ||
| run: | | ||
| uv sync --only-group lint | ||
|
|
||
| - name: retrieve versions | ||
| id: versions | ||
| run: | | ||
| grab_installed_version() { | ||
| local pkg="$1" | ||
| local version | ||
| version=$(uv pip freeze | grep -i "^$pkg==" | head -n1 | cut -d= -f3) | ||
| echo "${pkg}=$version" >> "$GITHUB_OUTPUT" | ||
| } | ||
| grab_installed_version "ruff" | ||
| grab_installed_version "clang-format" | ||
| grab_installed_version "mypy" | ||
| grab_installed_version "gersemi" | ||
|
|
||
| - name: Update .pre-commit-config.yaml | ||
| uses: cuchi/jinja2-action@v1.3.0 | ||
| with: | ||
| template: .pre-commit-config.yaml.jinja | ||
| output_file: .pre-commit-config.yaml | ||
| variables: | | ||
| ruff=${{ steps.versions.outputs.ruff }} | ||
| clang_format=${{ steps.versions.outputs.clang-format }} | ||
| mypy=${{ steps.versions.outputs.mypy }} | ||
| gersemi=${{ steps.versions.outputs.gersemi }} | ||
|
|
||
| - name: show changed files | ||
| run: | | ||
| git status | ||
| git diff .pre-commit-config.yaml | ||
|
|
||
| - name: try to install pre-commit | ||
| run: | | ||
| source .venv/bin/activate | ||
| pre-commit install | ||
| pre-commit install-hooks | ||
| pre-commit uninstall | ||
TonyXiang8787 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: generate GitHub App token | ||
| uses: actions/create-github-app-token@v2 | ||
| id: generate-token | ||
| with: | ||
| app-id: ${{ secrets.CI_BOT_APP_ID }} | ||
| private-key: ${{ secrets.CI_BOT_PRIVATE_KEY }} | ||
|
|
||
| - name: create pull request | ||
| if: ${{ inputs.create-pr || github.event_name == 'schedule' }} | ||
| uses: peter-evans/create-pull-request@v8 | ||
TonyXiang8787 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| commit-message: "Refresh lock and linter dependencies" | ||
| branch: "dependencies/refresh-lock-and-linter" | ||
| title: "Refresh lock and linter dependencies" | ||
| body: "This PR refreshes the lock file and updates linter dependencies to their latest versions." | ||
| labels: "dependencies" | ||
| signoff: true | ||
| sign-commits: true | ||
| delete-branch: true | ||
| base: ${{ github.head_ref }} | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org> | ||
| # | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
|
|
||
| # MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md001.md | ||
| MD001: false | ||
|
|
||
| # MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md013.md | ||
| line-length: | ||
| line_length: 120 | ||
| code_blocks: false | ||
| tables: false | ||
| stern: true | ||
|
|
||
| # MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md024.md | ||
| MD024: false |
mgovers marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.