-
Notifications
You must be signed in to change notification settings - Fork 81
Adding CI for PR's -- uv lockfile verification, ruff lint, unit test suite #35
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
24 commits
Select commit
Hold shift + click to select a range
f681fd9
add lightweight PR CI checks and pre-commit config
jgoldberg-nvidia 6005d95
test commit to trigger pipeline
jgoldberg-nvidia c4db845
format existing code with black and isort
jgoldberg-nvidia 76330ce
changing to ruff
jgoldberg-nvidia 316ec6c
Unit tests and new pipeline stage for them
jgoldberg-nvidia 666af32
fix unit test paths
jgoldberg-nvidia 4ebbced
fix unit tests breaking
jgoldberg-nvidia e0036c1
fix unit test solverror
jgoldberg-nvidia fba3037
More unit tests for eff frontier and rebalancing
jgoldberg-nvidia af9645a
Reverting the one per line list of tickets
jgoldberg-nvidia 216d894
Revert notebooks to OG and remove linting from them
jgoldberg-nvidia cf602f3
pre commit version locks
jgoldberg-nvidia dffdae9
add uv lock --locked check to PR CI to catch uv sync resolution breaks
jgoldberg-nvidia 90cf7e6
matrix install-and-test over Python 3.10 and 3.12 to catch min-versio…
jgoldberg-nvidia 26be0b3
regenerate uv.lock to match pyproject.toml so --locked passes
jgoldberg-nvidia b95d78d
drop 3.10 from CI matrix; minimum supported is now 3.11
jgoldberg-nvidia 341bd1e
merge origin/fix/python-311-floor-for-cuml-26.4 into add-pr-ci-checks
jgoldberg-nvidia 0bf77bd
make src/ ruff-compliant, fix tests for pydantic settings API
jgoldberg-nvidia 1cadd55
Merge pull request #1 from jgoldberg-nvidia/add-pr-ci-checks
jgoldberg-nvidia 03623d9
Merge remote-tracking branch 'origin/main' into add-pr-ci-checks
jgoldberg-nvidia 11bcbe8
Merge branch 'add-pr-ci-checks' into fork-main
jgoldberg-nvidia f5afac0
Update src/backtest.py
jgoldberg-nvidia 4ac0d3c
pin uv to 0.11.7 in pr.yaml for CI reproducibility
jgoldberg-nvidia b916016
fix notebook cuOpt presolve setting: False -> 0 for cuOpt 26.4 compat
jgoldberg-nvidia 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
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,91 @@ | ||
| name: PR Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lockfile-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| version: "0.11.7" | ||
|
|
||
| - name: Verify lockfile resolves across all extras and Python range | ||
| run: uv lock --locked | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| version: "0.11.7" | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --extra dev | ||
|
|
||
| - name: Check formatting | ||
| run: uv run ruff format --check src/ | ||
|
|
||
| - name: Lint | ||
| run: uv run ruff check src/ | ||
|
|
||
| install-and-test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.11", "3.12"] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| version: "0.11.7" | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install package | ||
| run: uv sync --extra dev --python ${{ matrix.python-version }} | ||
|
|
||
| - name: Verify import | ||
| run: uv run python -c "import cufolio" | ||
|
|
||
| - name: Run tests | ||
| run: uv run pytest tests/ -v | ||
|
|
||
| pr-builder: | ||
| if: always() | ||
| needs: [lockfile-check, lint, install-and-test] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check job results | ||
| run: | | ||
| if [[ "${{ needs.lockfile-check.result }}" != "success" || "${{ needs.lint.result }}" != "success" || "${{ needs.install-and-test.result }}" != "success" ]]; then | ||
| echo "One or more required jobs failed." | ||
| exit 1 | ||
| fi | ||
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,12 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.9 | ||
| hooks: | ||
| - id: ruff-check | ||
| args: [--fix, --config, pyproject.toml] | ||
| - id: ruff-format |
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
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.