Skip to content
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

Feature/add uv project and package manager #1

Merged
merged 7 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Title: [Brief description of the change]

## Description

<!-- Describe what this PR does and how it has been implemented -->

## Checklist

- [ ] Code follows project style guidelines
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] Changelog updated (if applicable)

## Testing

<!-- Explain how this change has been tested and how the reviewer may replicate those tests.-->

## Outcome/Results

<!--
Describe the expected outcomes of this change. If applicable,
mention any metrics or KPIs that will be affected.
-->

## Additional Context:

<!--
The following sections are optional.
Feel free to delete them if they do not apply to your PR
-->

### Motivation

<!-- Explain why this change is needed and what problem it solves -->

### Related Issues/Dependencies

<!-- List any related GitHub issues or dependencies -->

### Additional Notes

<!-- Add any other context or screenshots about the pull request here -->
47 changes: 47 additions & 0 deletions .github/workflows/style-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Style check

on: push

jobs:
style-check:
env:
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/[email protected]

- name: Install uv
uses: astral-sh/[email protected]
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/[email protected]
with:
python-version-file: "pyproject.toml"

- name: Restore uv cache
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/.cache/uv
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}

- name: Install dependencies
run: uv sync --all-extras --dev

- name: Check linting with Ruff
run: uv run ruff check

- name: Check format with Ruff
run: uv run ruff format --check

- name: Check docstring coverage
run: uv run docstr-coverage ./**/*.py --fail-under 20 --skip-file-doc --verbose=2

- name: Minimize uv cache
run: uv cache prune --ci
49 changes: 49 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test Coverage

on: push

jobs:
test-coverage:
env:
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/[email protected]

- name: Install uv
uses: astral-sh/[email protected]
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/[email protected]
with:
python-version-file: "pyproject.toml"

- name: Restore uv cache
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/.cache/uv
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}

- name: Install dependencies
run: uv sync --all-extras --dev

#- name: Pyright typechecking
# uses: jakebailey/[email protected]
# with:
# version: 1.1.370
# skip-unannotated: true
# level: error

- name: Run tests and check coverage
run: |
uv run pytest --cov=. --cov-fail-under=0

- name: Minimize uv cache
run: uv cache prune --ci
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# If you make changes to this file, you should run `uv run pre-commit install` to update the hooks
# Remember to update the version of the ruff-pre-commit repo when you update Ruff
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
args: ["--maxkb=5120"]
- id: check-json
- id: check-toml
types: [toml]
- id: check-yaml
types: [yaml]
- repo: https://github.com/Yelp/detect-secrets
rev: v1.3.0
hooks:
- id: detect-secrets
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.13
hooks:
- id: uv-lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
Loading
Loading