From c595bf410abb83a88d5f540be8ef7bb97975297b Mon Sep 17 00:00:00 2001 From: Thomas Tanon Date: Sat, 2 Nov 2024 06:48:09 +0100 Subject: [PATCH] Migrate to UV --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++------------- pyproject.toml | 4 ++++ requirements-dev.txt | 1 - 3 files changed, 29 insertions(+), 14 deletions(-) delete mode 100644 requirements-dev.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b0e962..85f5f0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,27 +9,34 @@ on: types: - published +env: + UV_SYSTEM_PYTHON: 1 + jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + enable-cache: true - uses: actions/setup-python@v5 with: - python-version: 3.13 - cache: pip - - run: pip install --upgrade pre-commit + python-version-file: "pyproject.toml" + - run: uv pip install --upgrade pre-commit - run: pre-commit run --all-files test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + enable-cache: true - uses: actions/setup-python@v5 with: - python-version: 3.13 - cache: pip - - run: pip install . && pip install -r requirements-dev.txt + python-version-file: "pyproject.toml" + - run: uv sync - run: python -m unittest working-directory: ./tests @@ -37,11 +44,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + enable-cache: true - uses: actions/setup-python@v5 with: python-version: 3.8 cache: pip - - run: pip install . && pip install -r requirements-dev.txt && pip install 'rdflib==6.3.0' + - run: uv sync --resolution lowest-direct - run: python -m unittest working-directory: ./tests @@ -49,11 +59,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + enable-cache: true - uses: actions/setup-python@v5 with: - python-version: 3.13 - cache: pip - - run: pip install -e . && pip install pytest pytest-cov -r requirements-dev.txt + python-version-file: "pyproject.toml" + - run: uv sync --extra coverage - run: pytest --cov --cov-report=xml - uses: codecov/codecov-action@v4 with: @@ -69,10 +81,10 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 with: - python-version: 3.13 - cache: pip - - run: pip install build + python-version-file: "pyproject.toml" + - run: uv pip install build - run: python -m build --sdist --wheel --outdir dist/ . - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index fdcf93d..4913c71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,10 @@ name = "oxrdflib" readme = "README.md" requires-python = ">=3.8" +[project.optional-dependencies] +coverage = ["pytest", "pytest-cov"] +dev = ["requests"] + [project.entry-points."rdf.plugins.store"] Oxigraph = "oxrdflib.store:OxigraphStore" oxigraph = "oxrdflib.store:OxigraphStore" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index f229360..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1 +0,0 @@ -requests