-
Notifications
You must be signed in to change notification settings - Fork 462
[WIP - testing integration] Switch lib-lint-and-test workflow to uv #4932
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
Open
ivanzati
wants to merge
11
commits into
develop
Choose a base branch
from
ivanzati/uv-lib-lint-workflow
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,637
−56
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0027e08
Switch lib-lint-and-test workflow to uv
ivanzati 87e7247
Merge branch 'develop' into ivanzati/uv-lib-lint-workflow
ivanzati 3e4310c
Update pre-commit hook for lib-lint-and-test workflow
ivanzati d2bf06e
Fix working directory
ivanzati a32a4b3
Fix requires-python
ivanzati 15e6bba
Fix coverage report upload
ivanzati 9d8c595
Run pre-commit with uv
ivanzati addd755
Run integration tests
ivanzati 9653873
Add wandb required for integration tests
ivanzati cc46d8d
Check integration-tests
ivanzati ba7b21b
Set CUBLAS_WORKSPACE_CONFIG in integration tests
ivanzati 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 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 | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -4,14 +4,14 @@ on: | |||||||
push: | ||||||||
branches: | ||||||||
- develop | ||||||||
- releases/** | ||||||||
- release/** | ||||||||
tags: | ||||||||
- "v*" | ||||||||
pull_request: | ||||||||
merge_group: | ||||||||
branches: | ||||||||
- develop | ||||||||
- releases/** | ||||||||
- release/** | ||||||||
workflow_dispatch: # run on request (no need for PR) | ||||||||
|
||||||||
permissions: {} # No permissions by default | ||||||||
|
@@ -66,21 +66,28 @@ jobs: | |||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||||||||
with: | ||||||||
persist-credentials: false | ||||||||
- name: Set up Python | ||||||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||||||||
|
||||||||
- name: Install uv and set the python version | ||||||||
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 | ||||||||
with: | ||||||||
enable-cache: false | ||||||||
python-version: "3.12" | ||||||||
- name: Install tox | ||||||||
version: "0.8.15" | ||||||||
|
||||||||
- name: Installing dependencies | ||||||||
working-directory: library | ||||||||
run: | | ||||||||
pip install '.[dev]' | ||||||||
- name: Code quality checks | ||||||||
run: uv sync --locked --all-extras --no-extra xpu --dev | ||||||||
|
||||||||
- name: Run pre-commit checks | ||||||||
working-directory: library | ||||||||
run: tox r -vv -e pre-commit | ||||||||
run: uv run pre-commit run --all-files | ||||||||
|
||||||||
Unit-Test: | ||||||||
runs-on: [self-hosted, linux, x64, dev, dmount] | ||||||||
permissions: | ||||||||
contents: read | ||||||||
# The id-token permission is required by Codecov to use OIDC | ||||||||
id-token: write | ||||||||
needs: | ||||||||
- Code-Quality-Checks | ||||||||
- check_paths | ||||||||
|
@@ -89,52 +96,41 @@ jobs: | |||||||
strategy: | ||||||||
fail-fast: false | ||||||||
matrix: | ||||||||
include: | ||||||||
- python-version: "3.12" | ||||||||
tox-env: "py312" | ||||||||
- python-version: "3.11" | ||||||||
tox-env: "py311" | ||||||||
python-version: ["3.11", "3.12"] | ||||||||
name: Unit-Test-with-Python${{ matrix.python-version }} | ||||||||
steps: | ||||||||
- name: Checkout repository | ||||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||||||||
with: | ||||||||
persist-credentials: false | ||||||||
- name: Install Python | ||||||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||||||||
|
||||||||
- name: Install uv and set the python version | ||||||||
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 | ||||||||
with: | ||||||||
enable-cache: false | ||||||||
python-version: ${{ matrix.python-version }} | ||||||||
- name: Install tox | ||||||||
version: "0.8.15" | ||||||||
|
||||||||
- name: Installing dependencies | ||||||||
working-directory: library | ||||||||
run: | | ||||||||
pip install '.[dev]' | ||||||||
- name: Run unit test | ||||||||
run: uv sync --locked --all-extras --no-extra xpu --dev | ||||||||
|
||||||||
- name: Unit testing | ||||||||
working-directory: library | ||||||||
run: tox r -vv -e unit-test-${{ matrix.tox-env }} | ||||||||
run: uv run pytest tests/unit --cov --cov-report=xml | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pytest command is missing the working directory specification. The command should include
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||
|
||||||||
- name: Upload coverage reports to Codecov | ||||||||
working-directory: library | ||||||||
run: | | ||||||||
# If the workflow is triggered from PR then it gets the commit id from the PR. | ||||||||
# else it uses the commit id of the latest commit. This is because the commit | ||||||||
# of the checked-out branch/commit does not exist in the tree as it is grafted. | ||||||||
# Also note: GitHub does not pass secrets to pipelines triggered from a fork. | ||||||||
# This means that upload will fail for PRs from forks. | ||||||||
if [ -n "${{ github.event.pull_request.head.sha }}" ] | ||||||||
then | ||||||||
COMMIT_ID=${{ github.event.pull_request.head.sha }} | ||||||||
else | ||||||||
COMMIT_ID=${{ github.sha }} | ||||||||
fi | ||||||||
# current version of codecov-action does not support uploading reports through the proxy | ||||||||
# so we use the latest version of codecov uploader binary | ||||||||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||||||||
chmod +x codecov | ||||||||
./codecov -t ${{ secrets.CODECOV_TOKEN }} --sha $COMMIT_ID -U $HTTP_PROXY -f .tox/coverage_unit-test-${{ matrix.tox-env }}.xml -F ${{ matrix.tox-env }} | ||||||||
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | ||||||||
with: | ||||||||
directory: library | ||||||||
flags: coverage_unit-test_Python-${{ matrix.python-version }} | ||||||||
use_oidc: true | ||||||||
|
||||||||
Integration-Test: | ||||||||
if: | | ||||||||
github.event.pull_request.draft == false && | ||||||||
!(startsWith(github.event.pull_request.title, '[WIP]')) && | ||||||||
needs.check_paths.outputs.run_workflow == 'true' | ||||||||
#if: | | ||||||||
# github.event.pull_request.draft == false && | ||||||||
# !(startsWith(github.event.pull_request.title, '[WIP]')) && | ||||||||
# needs.check_paths.outputs.run_workflow == 'true' | ||||||||
runs-on: [self-hosted, linux, x64, dev, dmount] | ||||||||
permissions: | ||||||||
contents: read | ||||||||
|
@@ -146,30 +142,44 @@ jobs: | |||||||
matrix: | ||||||||
include: | ||||||||
- task: "multi_class_cls" | ||||||||
python-version: "3.12" | ||||||||
- task: "multi_label_cls" | ||||||||
python-version: "3.12" | ||||||||
- task: "h_label_cls" | ||||||||
python-version: "3.12" | ||||||||
- task: "anomaly" | ||||||||
python-version: "3.12" | ||||||||
- task: "keypoint_detection" | ||||||||
python-version: "3.12" | ||||||||
- task: "detection" | ||||||||
python-version: "3.12" | ||||||||
- task: "instance_segmentation" | ||||||||
python-version: "3.12" | ||||||||
- task: "semantic_segmentation" | ||||||||
python-version: "3.12" | ||||||||
name: Integration-Test-${{ matrix.task }}-py312 | ||||||||
steps: | ||||||||
- name: Checkout repository | ||||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||||||||
with: | ||||||||
persist-credentials: false | ||||||||
- name: Install Python | ||||||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||||||||
|
||||||||
- name: Install uv and set the python version | ||||||||
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 | ||||||||
with: | ||||||||
python-version: "3.12" | ||||||||
- name: Install tox | ||||||||
enable-cache: false | ||||||||
python-version: ${{ matrix.python-version }} | ||||||||
version: "0.8.15" | ||||||||
|
||||||||
- name: Installing dependencies | ||||||||
working-directory: library | ||||||||
run: | | ||||||||
pip install '.[dev]' | ||||||||
- name: Run Integration Test | ||||||||
run: uv sync --locked --all-extras --no-extra xpu --dev | ||||||||
|
||||||||
- name: Integration testing | ||||||||
working-directory: library | ||||||||
run: tox r -vv -e integration-test-${{ matrix.task }} -- --task ${{ matrix.task }} --run-category-only | ||||||||
env: | ||||||||
CUBLAS_WORKSPACE_CONFIG: ":4096:8" | ||||||||
run: uv run pytest tests/integration -ra --showlocals --csv=${{ matrix.task }}_Python-${{ matrix.python-version }}.csv --task ${{ matrix.task }} --open-subprocess --run-category-only | ||||||||
|
||||||||
required_check: | ||||||||
name: Required Check lib-lint-and-test | ||||||||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
--no-extra xpu
flag excludes the xpu extra, but according to the pyproject.toml conflicts configuration, xpu and cuda extras conflict with each other. Consider documenting why xpu is explicitly excluded or verify that the conflicts configuration handles this correctly.Copilot uses AI. Check for mistakes.