Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v7.3.0-23-g37cff5f
_commit: v8.3.1
_src_path: gh:eccenca/cmem-plugin-template
author_mail: cmempy-developer@eccenca.com
author_name: eccenca GmbH
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5

- name: Cache Trivy DB
id: cache-trivydb
uses: actions/cache@v4
with:
path: .trivycache
key: ${{ runner.os }}-trivydb

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

Expand Down Expand Up @@ -62,9 +69,13 @@ jobs:
run: |
task check:deptry

- name: safety
- name: trivy
env:
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
TRIVY_DISABLE_VEX_NOTICE: "true"
run: |
task check:safety
task check:trivy

- name: Publish Test Report in Action
uses: mikepenz/action-junit-report@v4
Expand Down
13 changes: 10 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,24 @@ deptry:
script:
- task check:deptry

safety:
trivy:
stage: test
variables:
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
TRIVY_DISABLE_VEX_NOTICE: "true"
script:
- task check:safety
- task check:trivy
cache:
paths:
- .trivycache/

build:
stage: build
needs:
- mypy
- pytest
- safety
- trivy
- deptry
script:
- task build
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
default_language_version:
python: python3.13

repos:
- repo: local
hooks:
Expand Down Expand Up @@ -36,3 +39,9 @@ repos:
stages: [post-checkout, post-merge]
always_run: true

- id: trivy
name: check:trivy
description: run trivy to scan for vulnerabilities
entry: task check:trivy
language: python
pass_filenames: false
4 changes: 4 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .trivyignore

# ignore 51358 safety - dev dependency only
CVE-2022-39280
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/)

## [Unreleased]

### Changed

- Updated template

## [4.15.0] 2025-10-15

### Changed
Expand Down
16 changes: 10 additions & 6 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ tasks:
Check poetry versioning plugin. Currently not under Windows
run: once
preconditions:
- sh: '[ -d .git ]'
- sh: git -C . rev-parse
msg: >
Your newly created project directory needs to be initialized
as a git repository.
Expand Down Expand Up @@ -112,7 +112,7 @@ tasks:
- task: check:ruff
- task: check:mypy
- task: check:deptry
- task: check:safety
- task: check:trivy

check:pytest:
desc: Run unit and integration tests
Expand Down Expand Up @@ -154,12 +154,16 @@ tasks:
vars:
JUNIT_FILE: ./{{.DIST_DIR}}/junit-mypy.xml

check:safety:
desc: Complain about vulnerabilities in dependencies
check:trivy:
desc: Scan for vulnerabilities using Trivy
<<: *preparation
cmds:
# ignore 51358 safety - dev dependency only
- poetry run safety check -i 51358
- >
poetry run trivy fs
--include-dev-deps
--scanners vuln
--exit-code 1
.

check:deptry:
desc: Complain about unused or missing dependencies
Expand Down
2 changes: 1 addition & 1 deletion cmem_plugin_base/dataintegration/typed_entities/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def close(self) -> None:
"""Close the underlying text stream."""
self._text_stream.close()

def __enter__(self) -> "_TextToBytesWrapper":
def __enter__(self) -> "_TextToBytesWrapper": # noqa: PYI034
return self

def __exit__(self, *args: object) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TypedEntitySchema(EntitySchema, Generic[T]):
# Class variable to store singleton instances for each subclass
_instances: ClassVar[dict[type["TypedEntitySchema"], "TypedEntitySchema"]] = {}

def __new__(cls, *args, **kwargs) -> "TypedEntitySchema": # noqa: ANN002, ANN003, ARG004
def __new__(cls, *args, **kwargs) -> "TypedEntitySchema": # noqa: ANN002, ANN003, ARG004 PYI034
"""Implement singleton pattern for all subclasses of TypedEntitySchema."""
if cls not in cls._instances:
cls._instances[cls] = super().__new__(cls)
Expand Down
2 changes: 1 addition & 1 deletion cmem_plugin_base/dataintegration/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def split_task_id(task_id: str) -> tuple:

"""
try:
project_part = task_id.split(":")[0]
project_part = task_id.split(":", maxsplit=1)[0]
task_part = task_id.split(":")[1]
except IndexError as error:
raise ValueError(f"{task_id} is not a valid task ID.") from error
Expand Down
Loading