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"]}