Skip to content

Commit

Permalink
updated CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
tholzheim committed May 14, 2024
1 parent a8aff77 commit d1052ab
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 18 deletions.
19 changes: 17 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,28 @@ before_script:
test:
script:
- tox -e py
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- coverage.xml
when: always
reports:
junit: report.xml
lint:
script:
- tox -e format
- tox -e lint
coverage:
script:
- tox -e coverage
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- coverage.xml
when: always
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
path: coverage.xml
static type check:
script:
- tox -e type
50 changes: 34 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ dependencies = [
'sqlmodel>=0.0.16',
# https://pypi.org/project/wdgrid/
'wdgrid>=0.1.0',
"requests"
"requests",
"tabulate"
]

requires-python = ">=3.9"
Expand Down Expand Up @@ -82,7 +83,8 @@ test = [
"tox",
"pytest",
"pytest-cov",
"ruff"
"ruff",
"mypy"
]

[tool.hatch.build.targets.wheel]
Expand Down Expand Up @@ -127,7 +129,7 @@ line-ending = "auto"
legacy_tox_ini = """
[tox]
env_list = lint, type, py{310,311,312}
minversion = 4.12.1
minversion = 4.15.0
[testenv]
description = run the tests with pytest
Expand All @@ -141,27 +143,43 @@ legacy_tox_ini = """
pytest-cov
httpx
commands =
scripts/getVolumes
pytest --junitxml=report.xml --cov --cov-append {tty:--color=yes} {posargs}
pytest --junitxml=report.xml {tty:--color=yes} {posargs}
[testenv:coverage]
description = run terst coverage
deps =
.[test]
commands =
pytest --cov --cov-append {tty:--color=yes} {posargs}
coverage xml
[testenv:format]
description = install ruff and format the project code
deps =
ruff
commands =
ruff format
[testenv:lint]
description = run linters
skip_install = true
deps =
ruff
commands =
ruff check
# [testenv:type]
# description = run type checks
# deps =
# mypy>=0.991
# commands =
# mypy {posargs:ceurws tests}
ruff check --fix
[testenv:type]
description = run type checks
deps =
mypy>=1.1
commands =
mypy {posargs:ceurws}
"""
[tool.mypy]
follow_imports = "skip"
strict_optional = true
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "yaml,dateutil.parser"
module = ["yaml","dateutil.parser", "dateutil", "tabulate", "requests"]
ignore_missing_imports = true
follow-imports = "skip"
strict-optional = true

0 comments on commit d1052ab

Please sign in to comment.