Skip to content

Commit

Permalink
chore: replace poetry with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
leifwar committed Oct 2, 2024
1 parent 5456310 commit ebed3aa
Show file tree
Hide file tree
Showing 70 changed files with 83 additions and 1,989 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install and configure Poetry
uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: 1.8.2
- name: Install dynamic versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: build package
run: |
poetry build
run: uv build
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -61,21 +56,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install and configure Poetry
uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: 1.8.2
- name: Install dynamic versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies
shell: bash
run: poetry install
- name: install dependencies
run: |
poetry install --with docs
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: build docs
run: |
poetry run sphinx-build docs html
run: uvx --with cimsparql --with sphinx-autodoc-typehints --with recommonmark --with sphinx-rtd-theme --from sphinx sphinx-build docs html
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/poetry.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/ruff.yml

This file was deleted.

36 changes: 8 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Get full python version
id: full-python-version
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

- name: Install and configure Poetry
uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: 1.8.3

- name: Set poetry virtualenv to local
run: poetry config virtualenvs.in-project true
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: |
poetry install --no-interaction
run: uv sync

- name: Linting
run: poetry run pre-commit run --all-files
run: uvx pre-commit run --all-files

Tests:
needs: Linting
Expand All @@ -42,7 +31,6 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: ['3.11', '3.12']
poetry-version: [1.8.3]

services:
rdf4j:
Expand All @@ -60,24 +48,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Set poetry virtualenv to local
run: poetry config virtualenvs.in-project true
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Get full python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

- name: Install dependencies
run: poetry install --no-interaction

- name: Export virtual env path
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
run: uvx sync

- name: Static type checking
uses: jakebailey/pyright-action@v2.3.2
Expand All @@ -91,7 +71,7 @@ jobs:

- name: Run pytest with coverage
if: ${{ ( runner.os == 'Linux' ) && ( matrix.python-version == '3.10' ) }}
run: poetry run pytest -q --cov=cimsparql --cov-report=xml tests
run: uv run pytest -q --cov=cimsparql --cov-report=xml tests

- name: Upload coverage
if: ${{ ( runner.os == 'Linux' ) && ( matrix.python-version == '3.10' ) }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.py[cod]
__pycache__
*.lock

# C extensions
*.so
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include src/pkg_data/*
include src/cimsparql/sparql/*.sparql
Loading

0 comments on commit ebed3aa

Please sign in to comment.