From 6728391462963677109c866b9b1fc52c43a5f3d5 Mon Sep 17 00:00:00 2001 From: Ashley Sommer Date: Tue, 1 Oct 2024 09:52:21 +1000 Subject: [PATCH 1/4] remove drone configuration --- .drone.yml | 215 ----------------------------------------------------- 1 file changed, 215 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0a46ccc..0000000 --- a/.drone.yml +++ /dev/null @@ -1,215 +0,0 @@ - ---- -kind: pipeline -name: python-3-8 -type: docker -platform: - os: linux - arch: amd64 - -steps: -- name: test-3-8 - image: python:3.8 - environment: - TOX_WORK_DIR: /tmp/.tox - HAS_COVERALLS: true - COVERALLS_SERVICE_NAME: PySHACL-Drone - COVERALLS_REPO_TOKEN: - from_secret: coveralls_token - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e py38 -- name: type-checking-3-8 - image: python:3.8 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e type-checking -- name: lint-3-8 - image: python:3.8 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e lint -#- name: security -# image: snyk/snyk:python-3.8 -# environment: -# SNYK_TOKEN: -# from_secret: snyk_token -# PROJECT_PATH: /drone/src -# commands: -# - snyk --org=ashleysommer test -# - snyk code --org=ashleysommer test - -volumes: -- name: tox_cache - temp: {} - ---- -kind: pipeline -name: python-3-9 -type: docker -platform: - os: linux - arch: amd64 - -steps: -- name: test-3-9 - image: python:3.9 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install -U "pip>=21.0" - - pip3 install --upgrade "tox>=4.0.8" - - tox -e py39 - -volumes: -- name: tox_cache - temp: {} - ---- -kind: pipeline -name: python-3-10 -type: docker -platform: - os: linux - arch: amd64 - -steps: -- name: test-3-10 - image: python:3.10 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install -U "pip>=21.3" - - pip3 install --upgrade "tox>=4.0.8" - - tox -e py310 -- name: type-checking-3-10 - image: python:3.10 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e type-checking -- name: lint-3-10 - image: python:3.10 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e lint - -volumes: -- name: tox_cache - temp: {} - ---- -kind: pipeline -name: python-3-11 -type: docker -platform: - os: linux - arch: amd64 - -steps: -- name: test-3-11 - image: python:3.11 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e py311 -- name: type-checking-3-11 - image: python:3.11 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e type-checking -- name: lint-3-11 - image: python:3.11 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e lint - -volumes: -- name: tox_cache - temp: {} - ---- -kind: pipeline -name: python-3-12 -type: docker -platform: - os: linux - arch: amd64 - -steps: -- name: test-3-12 - image: python:3.12 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e py312 -- name: type-checking-3-12 - image: python:3.12 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e type-checking -- name: lint-3-12 - image: python:3.12 - environment: - TOX_WORK_DIR: /tmp/.tox - volumes: - - name: tox_cache - path: /tmp/.tox - commands: - - pip3 install --upgrade "tox>=4.0.8" - - tox -e lint - -volumes: -- name: tox_cache - temp: {} From a88494f4c09b1ff8e81c616378bfbc5090a07298 Mon Sep 17 00:00:00 2001 From: Ashley Sommer Date: Tue, 1 Oct 2024 09:56:50 +1000 Subject: [PATCH 2/4] Remove Travis, Drone, and Coveralls parts from tox config (its now only used for matrix testing) --- pyproject.toml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 153d404..cc12c68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -212,47 +212,18 @@ toxworkdir={env:TOX_WORK_DIR:.tox} deps = poetry>=1.8.2 passenv = - TRAVIS - TRAVIS_JOB_ID - TRAVIS_BRANCH - TRAVIS_BUILD_DIR - DRONE_BUILD_NUMBER - DRONE_STAGE_NAME - DRONE_STAGE_KIND - DRONE_REPO_NAME - DRONE_SOURCE_BRANCH - COVERALLS_SERVICE_NAME - COVERALLS_REPO_TOKEN - DRONE_COMMIT_AUTHOR_NAME - DRONE_COMMIT_AUTHOR_EMAIL - DRONE_COMMIT - HAS_COVERALLS DBUS_SESSION_BUS_ADDRESS PIP_KEYRING_PROVIDER PIP_FORCE_KEYRING PYTHON_KEYRING_BACKEND skip_install = true allowlist_externals = python3, ls, pwd, env, poetry -setenv = - COVERALLS_SERVICE_NUMBER ={env:DRONE_BUILD_NUMBER:0} - COVERALLS_SERVICE_JOB_ID = {env:DRONE_STAGE_NAME:stage} - COVERALLS_SERVICE_JOB_NUMBER = {env:DRONE_BUILD_NUMBER:0} - COVERALLS_FLAG_NAME = {env:DRONE_STAGE_KIND:build} - COVERALLS_GIT_REPO = {env:DRONE_REPO_NAME:RDFLib/pySHACL} - COVERALLS_GIT_BRANCH = {env:DRONE_SOURCE_BRANCH:master} - CI_BRANCH = {env:DRONE_SOURCE_BRANCH:master} - GIT_BRANCH = {env:DRONE_SOURCE_BRANCH:master} - GIT_AUTHOR_NAME = {env:DRONE_COMMIT_AUTHOR_NAME:nobody} - GIT_AUTHOR_EMAIL = {env:DRONE_COMMIT_AUTHOR_EMAIL:nobody@example.com} - GIT_ID = {env:DRONE_COMMIT:0} commands_pre = py39: poetry run pip3 install -U "pip>=21.0" py310: poetry run pip3 install -U "pip>=21.3" py311: poetry run pip3 install -U "pip>=22.1" poetry install -vv -n --no-root --extras "js dev-coverage" - # Coveralls required to send coverage report to coveralls.io - py38: poetry run pip3 install "coveralls>=3.3.1" commands = - poetry show @@ -260,7 +231,6 @@ commands = - poetry run coverage combine --append poetry run coverage report -m poetry run coverage html -i - py38: - coveralls [testenv:lint] commands_pre = From c6ef7161d7b5eaf35c055f68e984cc762005aabe Mon Sep 17 00:00:00 2001 From: Ashley Sommer Date: Tue, 1 Oct 2024 10:14:23 +1000 Subject: [PATCH 3/4] Add tox to github-actions using tox-gh plugin. --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- pyproject.toml | 9 +++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ab2a42..271e489 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,10 +40,33 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Run tests + - name: Install venv for test suite with Python version ${{ matrix.python-version }} run: | python3 -m venv venv source venv/bin/activate - pip install poetry + python -m pip install poetry make dev + + - name: Run linting checks + run: | + source venv/bin/activate + make lint + + - name: Run type checking + run: | + source venv/bin/activate make type-check + + - name: Install tox + run: | + source venv/bin/activate + poetry run python -m pip install "tox>=4.20.0" "tox-gh>=1.4.1" + + - name: Setup test suite + run: | + source venv/bin/activate + tox -vv --notest + - name: Run test suite + run: | + source venv/bin/activate + tox --skip-pkg-install diff --git a/pyproject.toml b/pyproject.toml index cc12c68..daa0be8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -251,4 +251,13 @@ commands = - poetry show poetry run python3 -m mypy --ignore-missing-imports pyshacl +[gh] +# Don't include lint or type-checking in gh-actions matrix +python = + 3.12 = py312 + 3.11 = py311 + 3.10 = py310 + 3.9 = py39 + 3.8 = py38 + """ From 201f496074cd653c7cd807f1a245831feab85b6b Mon Sep 17 00:00:00 2001 From: Ashley Sommer Date: Tue, 1 Oct 2024 10:21:03 +1000 Subject: [PATCH 4/4] Add all PySHACL supported python versions to test matrix --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 271e489..5c0add7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,9 @@ jobs: matrix: python-version: - '3.8' + - '3.9' + - '3.10' + - '3.11' - '3.12' steps: