diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 79dd2af..78bea30 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -65,11 +65,11 @@ jobs: - name: Run audit run: | pipx inject poetry poetry-audit-plugin - poetry audit + poetry audit $(poetry run python -c "import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); ignore_codes = data['tool']['quality']['audit']['ignore-code']; print('--ignore-code=' + ','.join(ignore_codes)) if ignore_codes else print('')") - name: Run xenon run: | poetry install --only xenon - poetry run xenon . -a A -b A -m A + poetry run xenon -a $(poetry run python -c "import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['average'])") -b $(poetry run python -c "import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['block'])") -m $(poetry run python -c "import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['module'])") . - name: Run mypy run: | poetry install --with mypy diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c6306bc..a45089b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,3 +17,18 @@ repos: entry: poetry run ruff check --fix language: system types: [file, python] + - id: bandit + name: bandit + entry: poetry run bandit -c pyproject.toml -r . + language: system + types: [file, python] + - id: xenon + name: xenon + entry: bash -c "poetry run xenon -a $(poetry run python -c \"import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['average'])\") -b $(poetry run python -c \"import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['block'])\") -m $(poetry run python -c \"import tomllib; f = open('pyproject.toml','rb') ; data = tomllib.load(f); f.close(); print(data['tool']['quality']['mccabe']['module'])\") . " + language: system + types: [file, python] + - id: mypy + name: mypy + entry: poetry run mypy --no-namespace-packages --exclude esgf_playground_utils/models/__init__.py + language: system + types: [ file, python ] diff --git a/README.md b/README.md index ec19a35..f5eaa31 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,5 @@ Common models, configuration and functionality for the ESGF-Playground. -## How to contribute? -This is simple library and is expected to undergo many changes as it matures towards the expected outcome of a suite -for the new ESGF publication system. - -To contribute, you should be using `poetry` as your python package manager, see https://python-poetry.org for -installation instructions. - -To install all package and development dependencies: - -```shell -foo@bar:~$ poetry install -``` - -To activate the `pre-commit hooks` run: - -```shell -foo@bar:~$ poetry run install pre-commit ``` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 810d661..b4e30ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "esgf-playground-utils" -version = "0.3.0" +version = "0.3.1-alpha" description = "Common library and models for the ESGF-Playground" authors = ["David Poulter "] readme = "README.md" @@ -60,9 +60,23 @@ target-version = "py39" docstring-code-format = true indent-style = "space" +[tool.coverage.run] +branch = true + [tool.coverage.report] fail_under = 100 +[tool.quality.mccabe] +average = "A" +block = "A" +module = "A" + +[tool.bandit] +skips = [] + +[tool.quality.audit] +ignore-code = ["CVE-2019-8341"] + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"