-
Notifications
You must be signed in to change notification settings - Fork 47
Enable UV in build and CI #1206
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
+2,552
−141
Merged
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
8f4353e
adjust toml
TonyXiang8787 e02652f
use dependency group
TonyXiang8787 8b31067
cibuildwheel
TonyXiang8787 246d942
build sdist
TonyXiang8787 9aa3d34
remove not needed setup python
TonyXiang8787 68da4f5
update sonar
TonyXiang8787 9aee66f
adjust linter
TonyXiang8787 db074f2
uv run
TonyXiang8787 e3cdbb3
update to latest version
TonyXiang8787 5291925
check-in lock
TonyXiang8787 00d5c2e
license header
TonyXiang8787 aa4e3b7
license for python version
TonyXiang8787 efa63a6
mypy use full install
TonyXiang8787 b68bfe7
fix readthedocs
TonyXiang8787 c142f1f
ignore some mypy error for now
TonyXiang8787 8f4f5b0
uv run
TonyXiang8787 92ec254
install all for docs
TonyXiang8787 cff982d
go back to pip
TonyXiang8787 027f0c9
remove uv
TonyXiang8787 7d4eae3
try uv in readthedocs
TonyXiang8787 128a8a4
add tools back
TonyXiang8787 b267024
Merge remote-tracking branch 'origin/main' into feature/enable-uv
TonyXiang8787 9ee5381
pin manually the same version
TonyXiang8787 661a473
try render
TonyXiang8787 9814283
try render
TonyXiang8787 db7ffc2
show diff
TonyXiang8787 6b9a907
fix naming
TonyXiang8787 d1ece89
fix naming
TonyXiang8787 244734d
try create pr
TonyXiang8787 a732116
try head ref
TonyXiang8787 5fb5d69
try main
TonyXiang8787 a99ba79
[skip ci] revert, the problem is not target
TonyXiang8787 cd2b4f8
change to v7
TonyXiang8787 326206c
retry
TonyXiang8787 0ba56a9
test good, revert
TonyXiang8787 3a52611
add pre-commit check install
TonyXiang8787 00b1e88
add source
TonyXiang8787 8304203
[skip ci] remove dockerfile
TonyXiang8787 945b6c8
[skip ci] modify container
TonyXiang8787 23fb4e9
[skip ci] part documentation
TonyXiang8787 40940b3
Merge remote-tracking branch 'origin/main' into feature/enable-uv
TonyXiang8787 5bacc15
documentation clear
TonyXiang8787 0ed9cf2
add uv run
TonyXiang8787 060a49e
add true back
TonyXiang8787 683ba9c
fix mypy issue
TonyXiang8787 0e6dc44
remove refresh lock in pr build
TonyXiang8787 3156ac5
fix issue
TonyXiang8787 f5da0c7
Merge branch 'main' into feature/enable-uv
TonyXiang8787 0e08c15
Update pyproject.toml
TonyXiang8787 2aa5b05
Update .github/workflows/refresh-lock-and-linter-dependencies.yml
TonyXiang8787 1c4bbba
update uv lock
TonyXiang8787 6cf8c0d
Merge branch 'main' into feature/enable-uv
TonyXiang8787 bfed4fc
remove environment limitations
TonyXiang8787 8b3564a
pytest failed assign to object instead of directly import as
mgovers 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
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
100 changes: 100 additions & 0 deletions
100
.github/workflows/refresh-lock-and-linter-dependencies.yml
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,100 @@ | ||
| # 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 | ||
TonyXiang8787 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 | ||
|
|
||
| - name: create pull request | ||
| if: ${{ inputs.create-pr || github.event_name == 'schedule' }} | ||
| uses: peter-evans/create-pull-request@v7 | ||
| 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 | ||
| delete-branch: true | ||
| base: ${{ github.head_ref }} | ||
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
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.