From 668aeadd7e67d435a6f5a3ee3a7619113709b111 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Fri, 6 Nov 2026 17:28:21 +0100 Subject: [PATCH] Declare the dev extra the Readme installs; test pull requests in CI The Readme told contributors to `pip install -e .[dev]` but no such extra existed, and moto (needed by tests/test_s3.py) was declared nowhere, so the S3 streaming path was skipped both locally and in CI. The extra now lists the test tooling and CI installs it. CI also runs on pull_request so contributions from forks are tested, as the Readme already claimed. requires-python is declared so pip refuses unsupported interpreters, the coverage artefacts are ignored, and the mention of a pre-commit setup that does not exist is dropped. --- .github/workflows/ci-build.yml | 7 ++++--- .gitignore | 3 +++ Readme.md | 3 --- pyproject.toml | 13 +++++++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 3f61b2f..2ec3ca2 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,6 +1,7 @@ name: Build unstable -on: [push] +# pull_request so that contributions from forks are tested too +on: [push, pull_request] concurrency: group: unstable @@ -30,8 +31,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install --upgrade flake8 pytest pycodestyle pytest-cov pytest-mock "mypy==2.3.*" - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install --upgrade pycodestyle "mypy==2.3.*" + pip install -e ".[dev]" - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/.gitignore b/.gitignore index 2d6a3de..2f5777e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ doc/ build/ dist/ grobid_client_python.egg-info/ +.coverage +coverage.xml +.pytest_cache/ diff --git a/Readme.md b/Readme.md index e5c0756..2dfff52 100644 --- a/Readme.md +++ b/Readme.md @@ -796,9 +796,6 @@ source venv/bin/activate # On Windows: venv\Scripts\activate # Install in development mode with test dependencies pip install -e .[dev] - -# Install pre-commit hooks (optional) -pre-commit install ``` ### Creating a New Release diff --git a/pyproject.toml b/pyproject.toml index 9099a19..812be21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ maintainers = [ ] description = "Simple python client for GROBID REST services" readme = "Readme.md" +requires-python = ">=3.8" dynamic = ['version', "dependencies"] @@ -27,6 +28,18 @@ dynamic = ['version', "dependencies"] # Streaming inputs directly from S3 (s3:// URIs/prefixes). smart_open provides # a seekable, range-streamed reader so remote zips are never fully downloaded. s3 = ["smart_open[s3]>=6.0", "boto3"] +# Everything the test-suite needs (moto mocks S3 for tests/test_s3.py, which +# is skipped without it). `pip install -e .[dev]` as the Readme says. +dev = [ + "pytest", + "pytest-cov", + "pytest-mock", + "mypy", + "flake8", + "moto[s3]>=4.0", + "smart_open[s3]>=6.0", + "boto3", +] [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]}