Skip to content

Chore/move to uv #24

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 3 commits into from
Mar 13, 2025
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
56 changes: 30 additions & 26 deletions .github/workflows/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,58 @@ on: [push]

jobs:
test:
name: Setup tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
poetry-version: ['2.1.1']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
run: poetry run pytest --cov=./ --cov-report=xml
run: uv run pytest --cov=./ --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

code-quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
poetry-version: ['2.1.1']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install

- name: Install the project
run: uv sync --all-extras --dev

- name: Run ruff
run: poetry run ruff check .
run: uv run ruff check .

- name: Run mypy
run: poetry run mypy .
run: uv run mypy .

- name: Run bandit
run: poetry run bandit .
run: uv run bandit .

- name: Run safety
run: poetry run safety check
run: uv run safety check

- name: Check for acceptable licenses
run: poetry run pip-licenses --allow-only="MIT License;BSD License;Python Software Foundation License;Apache Software License;Mozilla Public License 2.0 (MPL 2.0);ISC License (ISCL);The Unlicense (Unlicense)"
run: uv run pip-licenses --allow-only="MIT License;BSD License;Python Software Foundation License;Apache Software License;Mozilla Public License 2.0 (MPL 2.0);ISC License (ISCL);The Unlicense (Unlicense)"
17 changes: 7 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,22 @@ on:

jobs:
publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
poetry-version: ['2.1.1']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
uv build
uv publish --token $PYPI_TOKEN
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# NGI Python SGF Parser Package

_2025-03-13_

Version 0.0.6

- Converting from Poetry to uv. No functional changes.

_2025-03-10_

Version 0.0.5
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ len(method.method_data)
1. Software dependencies

- Python 3.11 or higher
- Poetry 2
- uv
- ruff code formatter

2. Clone this repository

3. Install

`poetry install`
`uv sync`


# Build and Test

Run in the project root folder:

poetry shell pytest
uv run pytest

Build the package wheel:

poetry build
uv build

# Publish

Expand Down
Loading