From 7da2226b712904c6673dfa42e407540040388350 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Sat, 10 Jun 2023 18:51:00 +0200 Subject: [PATCH] Update github workflows and project (#379) * Update all the action workflows * Update the poetry project file --- .github/workflows/linting.yaml | 12 ++--- .github/workflows/release.yaml | 2 +- .github/workflows/tests.yaml | 4 +- .github/workflows/typing.yaml | 2 +- pyproject.toml | 80 ++++++++++++++++------------------ 5 files changed, 47 insertions(+), 53 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 264bf56..0959c75 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -24,7 +24,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true @@ -47,7 +47,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true @@ -70,7 +70,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true @@ -93,7 +93,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true @@ -142,7 +142,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true @@ -165,7 +165,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2c200ae..1b9dbe0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5607f4d..6540d09 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -27,7 +27,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true @@ -59,7 +59,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true diff --git a/.github/workflows/typing.yaml b/.github/workflows/typing.yaml index bf687fa..fd3782a 100644 --- a/.github/workflows/typing.yaml +++ b/.github/workflows/typing.yaml @@ -24,7 +24,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: 🏗 Install workflow dependencies run: | poetry config virtualenvs.create true diff --git a/pyproject.toml b/pyproject.toml index 9ab81da..0b85aa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,19 +11,19 @@ repository = "https://github.com/klaasnicolaas/python-gridnet" documentation = "https://github.com/klaasnicolaas/python-gridnet" keywords = ["net2grid", "energy", "device", "power", "async", "client"] classifiers = [ - "Development Status :: 5 - Production/Stable", - "Framework :: AsyncIO", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3", - "Topic :: Software Development :: Libraries :: Python Modules", + "Development Status :: 5 - Production/Stable", + "Framework :: AsyncIO", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries :: Python Modules", ] packages = [ - { include = "gridnet", from = "src" }, + { include = "gridnet", from = "src" }, ] [tool.poetry.dependencies] @@ -52,16 +52,14 @@ pytest-cov = "^4.0.0" yamllint = "^1.29.0" covdefaults = "^2.2.2" -[tool.black] -target-version = ['py39'] - -[tool.coverage.paths] -source = ["gridnet"] - [tool.coverage.run] plugins = ["covdefaults"] source = ["gridnet"] +[tool.coverage.report] +fail_under = 90 +show_missing = true + [tool.mypy] # Specify the target platform details in config, so your developers are # free to run mypy on Windows, Linux, or macOS and get consistent @@ -69,6 +67,9 @@ source = ["gridnet"] platform = "linux" python_version = "3.9" +# flake8-mypy expects the two following for sensible formatting +show_column_numbers = true + # show error messages from unrelated files follow_imports = "normal" @@ -93,43 +94,36 @@ warn_return_any = true warn_unused_configs = true warn_unused_ignores = true -[tool.pylint.MASTER] -extension-pkg-whitelist = [ - "pydantic" -] -ignore= [ - "tests" -] - [tool.pylint.BASIC] good-names = [ - "_", - "ex", - "fp", - "i", - "id", - "j", - "k", - "on", - "Run", - "T", + "_", + "ex", + "fp", + "i", + "id", + "j", + "k", + "on", + "Run", + "T", + "vw", ] -[tool.pylint.DESIGN] -max-attributes = 8 - [tool.pylint."MESSAGES CONTROL"] disable= [ - "duplicate-code", - "format", - "unsubscriptable-object", + "duplicate-code", + "format", + "unsubscriptable-object", ] [tool.pylint.SIMILARITIES] ignore-imports = true [tool.pylint.FORMAT] -max-line-length=88 +max-line-length = 88 + +[tool.pylint.DESIGN] +max-attributes = 8 [tool.pytest.ini_options] addopts = "--cov" @@ -157,5 +151,5 @@ known-first-party = ["gridnet"] max-complexity = 25 [build-system] -requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" +requires = ["poetry-core>=1.0.0"]