-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
615 additions
and
1,025 deletions.
There are no files selected for viewing
This file contains 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,33 +2,31 @@ name: Publish to PyPI | |
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
pypi_release: | ||
name: Builds Using Poetry and Publishes to PyPI | ||
name: Builds Using UV and Publishes to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
python-version-file: "pyproject.toml" | ||
- name: Restore uv cache | ||
uses: actions/cache@v4 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
- name: Configure Poetry | ||
run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_TOKEN }}" | ||
path: /tmp/.uv-cache | ||
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
restore-keys: | | ||
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
uv-${{ runner.os }} | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Build the project | ||
run: uv build | ||
- name: Publish package | ||
run: poetry publish --build | ||
run: uv publish | ||
- name: Minimize uv cache | ||
run: uv cache prune --ci |
This file contains 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 |
---|---|---|
@@ -1,54 +1,31 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
python-version-file: "pyproject.toml" | ||
- name: Restore uv cache | ||
uses: actions/cache@v4 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
#---------------------------------------------- | ||
# run test suite and output coverage file | ||
#---------------------------------------------- | ||
path: /tmp/.uv-cache | ||
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
restore-keys: | | ||
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
uv-${{ runner.os }} | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Test with pytest | ||
run: poetry run pytest | ||
run: uv run pytest |
This file contains 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 |
---|---|---|
@@ -1,16 +1,10 @@ | ||
fail_fast: true | ||
repos: | ||
- repo: local | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.9.4 | ||
hooks: | ||
- id: system | ||
name: Black | ||
entry: poetry run black . | ||
pass_filenames: false | ||
language: system | ||
- repo: local | ||
hooks: | ||
- id: system | ||
name: Isort | ||
entry: poetry run isort . | ||
pass_filenames: false | ||
language: system | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format |
This file contains 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 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[tools] | ||
poetry = "latest" | ||
python = "3.12" | ||
uv = "latest" |
Oops, something went wrong.