From 868b4e906202605d83cfccd6eb96e7ff1c2d225e 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 | 40 ++++++++++--------------------------- .pre-commit-config.yaml | 4 ++-- oxrdflib/parser.py | 4 ++-- oxrdflib/serializer.py | 4 ++-- pyproject.toml | 4 ++++ requirements-dev.txt | 1 - 6 files changed, 20 insertions(+), 37 deletions(-) delete mode 100644 requirements-dev.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ad75c7..f48b832 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,47 +14,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.13 - cache: pip - - run: pip install --upgrade pre-commit - - run: pre-commit run --all-files + - uses: astral-sh/setup-uv@v3 + - run: uv run --with pre-commit pre-commit run --all-files test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.13 - cache: pip - - run: pip install . && pip install -r requirements-dev.txt - - run: python -m unittest + - uses: astral-sh/setup-uv@v3 + - run: uv run -m unittest working-directory: ./tests test_msv: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - 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: python -m unittest + - uses: astral-sh/setup-uv@v3 + - run: uv run --python 3.8 --resolution lowest-direct -m unittest working-directory: ./tests codecov: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - 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 - - run: pytest --cov --cov-report=xml + - uses: astral-sh/setup-uv@v3 + - run: uv run --extra coverage pytest --cov --cov-report=xml - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -69,10 +53,6 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.13 - cache: pip - - run: pip install build - - run: python -m build --sdist --wheel --outdir dist/ . + - uses: astral-sh/setup-uv@v3 + - run: uv run --with build -m build --sdist --wheel --outdir dist/ . - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3619baf..63febeb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,12 +24,12 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.2 + rev: v0.9.1 hooks: - id: ruff args: [ --fix ] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy diff --git a/oxrdflib/parser.py b/oxrdflib/parser.py index 31498b0..151c8e3 100644 --- a/oxrdflib/parser.py +++ b/oxrdflib/parser.py @@ -17,11 +17,11 @@ __all__ = [ "OxigraphN3Parser", - "OxigraphTurtleParser", + "OxigraphNQuadsParser", "OxigraphNTriplesParser", "OxigraphRdfXmlParser", "OxigraphTriGParser", - "OxigraphNQuadsParser", + "OxigraphTurtleParser", ] diff --git a/oxrdflib/serializer.py b/oxrdflib/serializer.py index 2f46904..8537b18 100644 --- a/oxrdflib/serializer.py +++ b/oxrdflib/serializer.py @@ -10,11 +10,11 @@ __all__ = [ "OxigraphN3Serializer", - "OxigraphTurtleSerializer", + "OxigraphNQuadsSerializer", "OxigraphNTriplesSerializer", "OxigraphRdfXmlSerializer", "OxigraphTriGSerializer", - "OxigraphNQuadsSerializer", + "OxigraphTurtleSerializer", ] diff --git a/pyproject.toml b/pyproject.toml index fdcf93d..dbc6b5f 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~=8.0", "pytest-cov>=5,<7"] +dev = ["requests~=2.0"] + [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