Skip to content

Commit

Permalink
Merge pull request #23 from eccenca/develop
Browse files Browse the repository at this point in the history
add pytest-html report, exclude some coverage, update dependencies and ignore pip safety issue
  • Loading branch information
seebi authored May 6, 2024
2 parents 30f0cd1 + baa934c commit c937fc3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ 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]

### Added

- pytest-html report generation

### Changed

- coverage report does some advanced exclusion:
- https://coverage.readthedocs.io/en/7.5.0/excluding.html#advanced-exclusion
- update dependencies

### Security

- ignore pips 67599 safety issue


## [6.1.0] 2024-02-02

### Fixed
Expand Down
13 changes: 8 additions & 5 deletions src/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,26 @@ tasks:
poetry run pytest --junitxml={{.JUNIT_FILE}}
--cov-report term --cov-report xml:{{.COVERAGE_FILE}}
--cov-report html:{{.COVERAGE_DIR}} --cov={{.PACKAGE}}
--html={{.HTML_FILE}} --self-contained-html
- platforms: [darwin, linux]
cmd: >
poetry run pytest --memray --junitxml={{.JUNIT_FILE}}
--cov-report term --cov-report xml:{{.COVERAGE_FILE}}
--cov-report html:{{.COVERAGE_DIR}} --cov={{.PACKAGE}}
--html={{.HTML_FILE}} --self-contained-html
- cmd: >
poetry run genbadge coverage -l
-i {{.COVERAGE_FILE}} -o {{.BADGE_COVERAGE}}
- cmd: >
poetry run genbadge tests -l
-i {{.JUNIT_FILE}} -o {{.BADGE_TESTS}}
vars:
JUNIT_FILE: ./{{.DIST_DIR}}/junit-pytest.xml
COVERAGE_FILE: ./{{.DIST_DIR}}/coverage.xml
COVERAGE_DIR: ./{{.DIST_DIR}}/coverage
BADGE_COVERAGE: ./{{.DIST_DIR}}/badge-coverage.svg
BADGE_TESTS: ./{{.DIST_DIR}}/badge-tests.svg
COVERAGE_DIR: ./{{.DIST_DIR}}/coverage
COVERAGE_FILE: ./{{.DIST_DIR}}/coverage.xml
HTML_FILE: ./{{.DIST_DIR}}/pytest.html
JUNIT_FILE: ./{{.DIST_DIR}}/junit-pytest.xml

check:mypy:
desc: Complain about typing errors
Expand All @@ -144,8 +147,8 @@ tasks:
<<: *preparation
cmds:
# ignore 51358 safety - dev dependency only
# ignore 61489 pillow - dev dependency only
- poetry run safety check -i 51358 -i 61489
# ignore 67599 pip - dev dependency only
- poetry run safety check -i 51358 -i 67599

check:ruff:
desc: Complain about everything else
Expand Down
25 changes: 19 additions & 6 deletions src/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ keywords = [
python = "^3.11"

[tool.poetry.dependencies.cmem-plugin-base]
version = "^4.3.0"
version = "^4.5.0"
allow-prereleases = false

[tool.poetry.group.dev.dependencies]
genbadge = {extras = ["coverage"], version = "^1.1.1"}
mypy = "^1.2.0"
pip = ">=23.3" # Avoid safety issue 62044 for pip less than 23.3
pytest = "^7.3.1"
mypy = "^1.10.0"
pip = "^24"
pytest = "^7.4.4"
pytest-cov = "^4.1.0"
pytest-dotenv = "^0.5.2"
pytest-memray = { version = "^1.5.0", markers = "platform_system != 'Windows'" }
ruff = "^0.1.5"
pytest-html = "^4.1.1"
pytest-memray = { version = "^1.6.0", markers = "platform_system != 'Windows'" }
ruff = "^0.1.15"
safety = "^1.10.3"

[build-system]
Expand All @@ -51,6 +52,18 @@ ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = ""

[tool.coverage.report]
exclude_also = [
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]

[tool.ruff]
line-length = 100
target-version = "py311"
Expand Down

0 comments on commit c937fc3

Please sign in to comment.