diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 2365e81a04..ba70600b16 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -27,11 +27,19 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest, macos-latest, windows-latest] + # This is used for injecting additional tests for a specific python + # version and OS. + suffix: [""] include: - python-version: "3.7" os: ubuntu-latest extensive-tests: true TOXENV_SUFFIX: "-docs" + - python-version: "3.7" + os: ubuntu-latest + extensive-tests: true + suffix: "-min" + TOXENV_SUFFIX: "-min" - python-version: "3.8" os: ubuntu-latest TOX_EXTRA_COMMAND: "- isort --check-only --diff ." @@ -80,10 +88,11 @@ jobs: task \ TOX_EXTRA_COMMAND="${{ matrix.TOX_EXTRA_COMMAND }}" \ OS=${{ matrix.os }} \ + MATRIX_SUFFIX=${{ matrix.suffix }} \ EXTENSIVE=${{ matrix.extensive-tests || 'false' }} \ TOX_PYTHON_VERSION=${{ matrix.python-version }} \ TOXENV_SUFFIX=${{ matrix.TOXENV_SUFFIX }} \ - TOX_JUNIT_XML_PREFIX=${{ matrix.python-version }}-${{ matrix.os }}- \ + TOX_JUNIT_XML_PREFIX=${{ matrix.python-version }}-${{ matrix.os }}${{matrix.suffix}}- \ gha:validate env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -91,12 +100,12 @@ jobs: if: ${{ (success() || failure()) }} with: name: ${{ matrix.python-version }}-${{ matrix.os }}-mypy-junit-xml - path: test_reports/${{ matrix.python-version }}-${{ matrix.os }}-mypy-junit.xml + path: test_reports/${{ matrix.python-version }}-${{ matrix.os }}${{matrix.suffix}}-mypy-junit.xml - uses: actions/upload-artifact@v3 if: ${{ (success() || failure()) }} with: name: ${{ matrix.python-version }}-${{ matrix.os }}-pytest-junit-xml - path: test_reports/${{ matrix.python-version }}-${{ matrix.os }}-pytest-junit.xml + path: test_reports/${{ matrix.python-version }}-${{ matrix.os }}${{matrix.suffix}}-pytest-junit.xml extra-tasks: permissions: contents: read diff --git a/Taskfile.yml b/Taskfile.yml index 75cced21d6..b1c6cc0f46 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -241,7 +241,7 @@ tasks: desc: GitHub Actions Validation Workflow env: COVERALLS_PARALLEL: true - COVERALLS_FLAG_NAME: "{{.OS}}-{{.TOX_PYTHON_VERSION}}" + COVERALLS_FLAG_NAME: "{{.OS}}-{{.TOX_PYTHON_VERSION}}{{.MATRIX_SUFFIX}}" COVERALLS_SERVICE_NAME: '{{.COVERALLS_SERVICE_NAME | default (env "COVERALLS_SERVICE_NAME") | default "github"}}' cmds: - task: install:system-deps diff --git a/devtools/constraints-min.txt b/devtools/constraints-min.txt new file mode 100644 index 0000000000..7779da3fb8 --- /dev/null +++ b/devtools/constraints-min.txt @@ -0,0 +1,9 @@ +# This file selects minimum versions to ensure that the test suite passes on +# these versions. +isodate==0.6.0 +pyparsing==2.1.0 +importlib-metadata==4.0.0 +berkeleydb==18.1.2 +networkx==2.0 +html5lib==1.0.1 +lxml==4.3.0 diff --git a/poetry.lock b/poetry.lock index 463e15efc2..cbe7c5faf8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1413,4 +1413,4 @@ networkx = ["networkx"] [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "9ee7938916acb320dd76eba382b450a3e4e24dc1ae05569dbea3f2d35ab9bf75" +content-hash = "9d02b28eb490584cc2bd1accb2006ea12ee19991511dadf9971204c9697c235f" diff --git a/pyproject.toml b/pyproject.toml index fa53b06f0a..a2ff4e700d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,13 +32,13 @@ rdfgraphisomorphism = 'rdflib.tools.graphisomorphism:main' [tool.poetry.dependencies] python = "^3.7" -isodate = "^0.6.1" -pyparsing = "^3.0.9" -importlib_metadata = {version = "^4.2.0", python = ">=3.7,<3.8"} -berkeleydb = {version = "^18.1.5", optional = true} -networkx = {version = "^2.6.2", optional = true} -html5lib = {version = "^1.1", optional = true} -lxml = {version = "^4.9.2", optional = true} +isodate = "^0.6.0" +pyparsing = ">=2.1.0,<4" +importlib-metadata = {version = "^4.0.0", python = ">=3.7,<3.8"} +berkeleydb = {version = "^18.1.0", optional = true} +networkx = {version = "^2.0.0", optional = true} +html5lib = {version = "^1.0", optional = true} +lxml = {version = "^4.3.0", optional = true} [tool.poetry.group.dev.dependencies] black = "22.12.0" diff --git a/test/test_sparql/test_prefixed_name.py b/test/test_sparql/test_prefixed_name.py index ca793ef775..99d2fb108b 100644 --- a/test/test_sparql/test_prefixed_name.py +++ b/test/test_sparql/test_prefixed_name.py @@ -76,10 +76,10 @@ def blank_graph() -> Graph: ["pname_ns", "pname", "expected_result"], itertools.chain( [ - ("eg", "invalid/PN_PREFIX", pyparsing.exceptions.ParseException), + ("eg", "invalid/PN_PREFIX", pyparsing.ParseException), ("", "eg:a", Exception), - ("", ":invalid PN_LOCAL", pyparsing.exceptions.ParseException), - ("", ":invalid/PN_LOCAL", pyparsing.exceptions.ParseException), + ("", ":invalid PN_LOCAL", pyparsing.ParseException), + ("", ":invalid/PN_LOCAL", pyparsing.ParseException), ("", ":a:b:c", PNAME_PREFIX["a:b:c"]), ("", ":", URIRef(f"{PNAME_PREFIX}")), ("", ":a", PNAME_PREFIX.a), diff --git a/tox.ini b/tox.ini index 2d61a81f5c..ea294b696c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,4 @@ +# https://tox.wiki/en/latest/user_guide.html # https://tox.wiki/en/latest/config.html [tox] envlist = @@ -56,6 +57,25 @@ commands_pre = commands = poetry run sphinx-build -T -W -b html -d {envdir}/doctree docs docs/_build/html +[testenv:py37-extensive-min] +base = void +deps = + pytest==7.* + pytest-cov==4.* +setenv = + BERKELEYDB_DIR = /usr + COVERAGE_FILE = {env:COVERAGE_FILE:{toxinidir}/.coverage.{envname}} + PIP_CONSTRAINT = devtools/constraints-min.txt +extras = + berkeleydb + networkx + lxml + html +commands = + {envpython} --version + pip freeze + {posargs:{envpython} -m pytest -ra --tb=native {env:TOX_PYTEST_ARGS:--junit-xml=test_reports/{env:TOX_JUNIT_XML_PREFIX:}pytest-junit.xml --cov --cov-report=}} + [testenv:precommit{,all}] skip_install = true deps = pre-commit