diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e422371..c0fc8ea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] fail-fast: false steps: - name: Checkout sources @@ -41,12 +41,12 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 - if: "matrix.python-version == '3.11'" + if: "matrix.python-version == '3.12'" with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - name: Run pre-commit - if: "matrix.python-version == '3.11'" + if: "matrix.python-version == '3.12'" run: | uv run pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8a20a3..d60cf38 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,43 +2,38 @@ default_language_version: python: python3.12 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-toml - id: check-yaml - id: end-of-file-fixer - id: mixed-line-ending - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.11.5 + rev: v0.15.6 hooks: - - id: ruff + - id: ruff-check args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/PyCQA/bandit - rev: 1.8.3 + rev: 1.9.4 hooks: - id: bandit additional_dependencies: - ".[toml]" args: [--config=pyproject.toml] - - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.14.0 - hooks: - - id: pretty-format-toml - files: "^.*.toml" - args: - - "--autofix" - - repo: https://github.com/astral-sh/uv-pre-commit - # uv version. - rev: 0.9.6 + rev: 0.10.9 hooks: - id: uv-lock - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.44.0 + rev: v0.47.0 hooks: - id: markdownlint exclude: ^(CHANGELOG.md) args: - "--disable=MD013" - "--fix" + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.18.1 + hooks: + - id: pyproject-fmt diff --git a/docs/contributing.md b/docs/contributing.md index efe6039..f95ef24 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -20,14 +20,14 @@ Tests convert randomly generated data from protobuf to arrow and back, making su The tests take a long time to run. To run them faster: ```shell -pytest --numprocesses=auto -p no:benchmark ./tests +uv run pytest --numprocesses=auto -p no:benchmark ./tests ``` To Get coverage: ```shell -coverage run --branch --include "./protarrow/*" -m pytest tests -coverage report --show-missing +uv run coverage run --branch --include "./protarrow/*" -m pytest tests +uv run coverage report --show-missing ``` ## Generating the change log @@ -63,13 +63,13 @@ The CI will deploy to pypi automatically from then. ## Testing the documentation ```shell -mkdocs serve --livereload --watch=./ +uv run mkdocs serve --livereload --watch=./ ``` ## Updating dependencies -- For the repo `uv update` -- For the doc: `(cd docs/;uvx --from=pip pip-compile ./requirements.in > ./requirements.txt)` +- For the repo `uv lock --upgrade` +- For the doc: `(cd docs/;uv pip compile ./requirements.in > ./requirements.txt)` - For pre-commit: `pre-commit autoupdate; pre-commit run --all-files` ## Resources diff --git a/docs/requirements.txt b/docs/requirements.txt index ce71694..94e8925 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,26 +1,20 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile ./requirements.in -# -babel==2.17.0 +# This file was autogenerated by uv via the following command: +# uv pip compile ./requirements.in +babel==2.18.0 # via mkdocs-material -backrefs==5.9 +backrefs==6.2 # via mkdocs-material -certifi==2025.10.5 +certifi==2026.2.25 # via requests -charset-normalizer==3.4.4 +charset-normalizer==3.4.5 # via requests -click==8.3.0 +click==8.3.1 # via mkdocs colorama==0.4.6 - # via - # griffe - # mkdocs-material + # via mkdocs-material ghp-import==2.1.0 # via mkdocs -griffe==1.14.0 +griffelib==2.0.0 # via mkdocstrings-python idna==3.11 # via requests @@ -29,7 +23,7 @@ jinja2==3.1.6 # mkdocs # mkdocs-material # mkdocstrings -markdown==3.10 +markdown==3.10.2 # via # markdown-include # mkdocs @@ -38,7 +32,7 @@ markdown==3.10 # mkdocstrings # pymdown-extensions markdown-include==0.8.1 - # via -r requirements.in + # via -r ./requirements.in markupsafe==3.0.3 # via # jinja2 @@ -51,41 +45,41 @@ mergedeep==1.3.4 # mkdocs-get-deps mkdocs==1.6.1 # via - # -r requirements.in + # -r ./requirements.in # mkdocs-autorefs # mkdocs-material # mkdocstrings -mkdocs-autorefs==1.4.3 +mkdocs-autorefs==1.4.4 # via # mkdocstrings # mkdocstrings-python -mkdocs-get-deps==0.2.0 +mkdocs-get-deps==0.2.2 # via mkdocs -mkdocs-material==9.6.23 - # via -r requirements.in +mkdocs-material==9.7.5 + # via -r ./requirements.in mkdocs-material-extensions==1.3.1 # via - # -r requirements.in + # -r ./requirements.in # mkdocs-material -mkdocstrings[python]==0.30.1 +mkdocstrings==1.0.3 # via - # -r requirements.in + # -r ./requirements.in # mkdocstrings-python -mkdocstrings-python==1.18.2 +mkdocstrings-python==2.0.3 # via mkdocstrings -packaging==25.0 +packaging==26.0 # via mkdocs paginate==0.5.7 # via mkdocs-material -pathspec==0.12.1 +pathspec==1.0.4 # via mkdocs -platformdirs==4.5.0 +platformdirs==4.9.4 # via mkdocs-get-deps pygments==2.19.2 # via mkdocs-material -pymdown-extensions==10.16.1 +pymdown-extensions==10.21 # via - # -r requirements.in + # -r ./requirements.in # mkdocs-material # mkdocstrings python-dateutil==2.9.0.post0 @@ -102,7 +96,7 @@ requests==2.32.5 # via mkdocs-material six==1.17.0 # via python-dateutil -urllib3==2.5.0 +urllib3==2.6.3 # via requests watchdog==6.0.0 # via mkdocs diff --git a/pyproject.toml b/pyproject.toml index 5415f36..311e76d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,81 +1,67 @@ [build-system] build-backend = "hatchling.build" -requires = ["hatchling", "uv-dynamic-versioning"] - -[dependency-groups] -dev = [ - "Jinja2>=3.1.2", - "coverage>=6.5.0", - "flake8>=5.0.4", - "git-changelog>=2.2.0", - "grpcio-tools>=1.46.0", - "inflection>=0.5.1", - "isort>=5.10.1", - "mkdocs>=1.4.2", - "mkdocs-material>=9.0.3", - "mkdocstrings[python]>=0.21.2", - "pip-tools>=6.12.1", - "pre-commit>=2.20.0", - "pylint>=2.15.0", - "pytest>=7.2.0", - "pytest-benchmark>=4.0.0", - "pytest-cov", - "pytest-xdist>=3.1.0", - "ruff" -] +requires = [ "hatchling", "uv-dynamic-versioning" ] [project] -authors = [{name = "Tradewell Tech", email = "engineering@tradewelltech.co"}] +name = "protarrow" +description = "Convert from protobuf to arrow and back" +readme = "README.md" +keywords = [ "apache-arrow", "data", "protobuf" ] +license = "Apache-2.0" +maintainers = [ { name = "0x26res", email = "0x26res@gmail.com" } ] +authors = [ { name = "Tradewell Tech", email = "engineering@tradewelltech.co" } ] +requires-python = ">=3.9,<4" classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13" -] -dependencies = [ - "googleapis-common-protos", - "protobuf", - "pyarrow" + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -description = "Convert from protobuf to arrow and back" +dynamic = [ "version" ] +dependencies = [ "googleapis-common-protos", "protobuf", "pyarrow" ] +urls."Bug Tracker" = "https://github.com/tradewelltech/protarrow/issues" +urls.Changelog = "https://github.com/tradewelltech/protarrow/blob/main/CHANGELOG.md" documentation = "https://protarrow.readthedocs.io/en/latest/" -dynamic = ["version"] -keywords = ["apache-arrow", "protobuf", "data"] -license = "Apache-2.0" -maintainers = [{name = "0x26res", email = "0x26res@gmail.com"}] -name = "protarrow" -packages = [ - {include = "protarrow"} -] -readme = "README.md" +packages = [ { include = "protarrow" } ] repository = "https://github.com/tradewelltech/protarrow" -requires-python = ">=3.9,<4" - -[project.urls] -"Bug Tracker" = "https://github.com/tradewelltech/protarrow/issues" -"Changelog" = "https://github.com/tradewelltech/protarrow/blob/main/CHANGELOG.md" -[tool.bandit] -skips = ["B101", "B311"] - -[tool.hatch.build.hooks.version] -path = "protarrow/_version.py" -template = ''' -version = "{version}" -''' +[dependency-groups] +dev = [ + "coverage>=6.5", + "flake8>=5.0.4", + "git-changelog>=2.2", + "grpcio-tools>=1.46", + "inflection>=0.5.1", + "isort>=5.10.1", + "jinja2>=3.1.2", + "mkdocs>=1.4.2", + "mkdocs-material>=9.0.3", + "mkdocstrings[python]>=0.21.2", + "pip-tools>=6.12.1", + "pre-commit>=2.20", + "pylint>=2.15", + "pytest>=7.2", + "pytest-benchmark>=4", + "pytest-cov", + "pytest-xdist>=3.1", + "ruff" +] -[tool.hatch.version] -source = "uv-dynamic-versioning" +[tool.hatch] +build.hooks.version.path = "protarrow/_version.py" +build.hooks.version.template = """version = "{version}" +""" +version.source = "uv-dynamic-versioning" [tool.ruff] line-length = 88 +lint.select = [ "C", "E", "F", "I", "PERF" ] -[tool.ruff.lint] -select = ["E", "F", "C", "I", "PERF"] - -[tool.ruff.lint.isort] -known-first-party = ["protarrow", "protarrow_protos"] +[tool.bandit] +skips = [ "B101", "B311" ] diff --git a/tests/test_coverage.py b/tests/test_coverage.py index f3a3c0e..3229546 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -517,14 +517,14 @@ def test_arrow_missing_function(): with pytest.raises( pa.ArrowNotImplementedError, match="DictionaryArray converter for type" - " dictionary\ not implemented", + r" dictionary\ not implemented", ): pa.array([], pa.dictionary(pa.int32(), pa.large_string())) with pytest.raises( pa.ArrowNotImplementedError, match="DictionaryArray converter for type" - " dictionary\ not implemented", + r" dictionary\ not implemented", ): pa.array([], pa.dictionary(pa.int32(), pa.large_binary()))