Skip to content

Commit

Permalink
Merge pull request #1 from eccenca/develop
Browse files Browse the repository at this point in the history
merge changes from dev
  • Loading branch information
muddymudskipper authored Jun 14, 2024
2 parents f7f77b4 + 273f3a9 commit c5f12e4
Show file tree
Hide file tree
Showing 19 changed files with 1,388 additions and 2,583 deletions.
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changes here will be overwritten by Copier
_commit: v4.1.0
_commit: v6.3.1
_src_path: gh:eccenca/cmem-plugin-template
author_mail: [email protected]
author_name: eccenca GmbH
github_page: ''
github_page: https://github.com/eccenca/cmem-plugin-pyshacl
project_description: Validate your Knowledge Graphs based on tests generated from
SHACL shapes.
project_slug: pyshacl
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ on:

jobs:
check:

runs-on: ubuntu-latest
concurrency: testing_environment

steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v1
Expand All @@ -26,7 +29,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.11'

- name: Install and configure poetry
uses: snok/install-poetry@v1
Expand All @@ -35,28 +38,17 @@ jobs:
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv if cache exists
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: bandit
run: |
task check:bandit
- name: flake8
- name: Install dynamic versioning plugin
run: |
task check:flake8
poetry self add "poetry-dynamic-versioning[plugin]"
- name: mypy
run: |
task check:mypy
- name: pylint
- name: ruff
run: |
task check:pylint
task check:ruff
- name: pytest
env:
Expand All @@ -70,7 +62,7 @@ jobs:
task check:safety
- name: Publish Test Report in Action
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: dist/junit-*.xml
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v1

- name: Set up python
id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.11'

- name: Install and configure poetry
uses: snok/install-poetry@v1
Expand All @@ -39,13 +39,6 @@ jobs:
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Load cached venv if cache exists
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Publish Package
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
34 changes: 7 additions & 27 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
default:
image: docker-registry.eccenca.com/eccenca-python:v3.9.16
image: docker-registry.eccenca.com/eccenca-python:v3.11.4
# all jobs can be interrupted in case a new commit is pushed
interruptible: true
before_script:
Expand All @@ -19,25 +19,15 @@ stages:
- build
- publish

bandit:
ruff:
stage: test
script:
- task check:bandit
- task check:ruff
artifacts:
when: always
reports:
junit:
- dist/junit-bandit.xml

flake8:
stage: test
script:
- task check:flake8
artifacts:
when: always
reports:
junit:
- dist/junit-flake8.xml
- dist/junit-ruff.xml

mypy:
stage: test
Expand All @@ -49,16 +39,6 @@ mypy:
junit:
- dist/junit-mypy.xml

pylint:
stage: test
script:
- task check:pylint
artifacts:
when: always
reports:
junit:
- dist/junit-pylint.xml

pytest:
stage: test
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
Expand All @@ -70,6 +50,8 @@ pytest:
coverage_report:
coverage_format: cobertura
path: dist/coverage.xml
junit:
- dist/junit-pytest.xml
paths:
- dist/badge-coverage.svg
- dist/badge-tests.svg
Expand All @@ -84,7 +66,6 @@ safety:
build:
stage: build
needs:
- bandit
- mypy
- pytest
- safety
Expand All @@ -100,8 +81,7 @@ pypi:
# publishing only available on a tag
stage: publish
needs:
- flake8
- pylint
- ruff
- build
allow_failure: true
when: manual
Expand Down
6 changes: 3 additions & 3 deletions .idea/cmem-plugin-pyshacl.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 33 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,37 @@
repos:
- repo: local
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
exclude: '^tests/.*$'
language: system
types: [python]
- repo: local
hooks:
- id: forbidden-files
name: forbidden files
entry: found copier update rejection files; review them and remove them
language: fail
files: "\\.rej$"

- id: ruff
name: check:ruff
entry: task check:ruff
language: python
types_or: [python, pyi]
pass_filenames: false

- id: poetry-check
name: poetry-check
description: run poetry check to validate config
entry: poetry check
language: python
pass_filenames: false
files: ^(.*/)?pyproject\.toml$

- id: poetry-lock
name: poetry-lock
description: run poetry lock to update lock file
entry: poetry lock
language: python
pass_filenames: false
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$

- id: poetry-install
name: poetry-install
description: >
run poetry install to install dependencies from the lock file
entry: poetry install
language: python
pass_filenames: false
stages: [post-checkout, post-merge]
always_run: true

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
Loading

0 comments on commit c5f12e4

Please sign in to comment.