From 2257c1a775f4f5cab095ba8b4ffca6c005fb81a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Wed, 13 Dec 2023 16:11:35 +0300 Subject: [PATCH 01/14] ruff ugraded to support jupyter notebooks --- .pre-commit-config.yaml | 2 +- .vscode/settings.json | 10 ++++++++-- Makefile | 2 +- docs/poetry.md | 2 +- pyproject.toml | 5 +++-- requirements-dev.lock | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f8cce7..21dae88 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: python-use-type-annotations - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.1.3 + rev: v0.1.7 hooks: # Run the Ruff linter. - id: ruff diff --git a/.vscode/settings.json b/.vscode/settings.json index c169afb..64ee0ab 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,8 +3,8 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "charliermarsh.ruff", "editor.codeActionsOnSave": { - // "source.fixAll": true, - "source.organizeImports.ruff": true, + // "source.fixAll": "always", + "source.organizeImports.ruff": "explicit", }, "editor.rulers": [ { @@ -22,4 +22,10 @@ "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, // "python.testing.pytestArgs": [], + "notebook.formatOnSave.enabled": true, + "notebook.codeActionsOnSave": { + // "source.fixAll.ruff": "always", + "source.organizeImports.ruff": "explicit", + }, + "evenBetterToml.formatter.reorderKeys": true, } diff --git a/Makefile b/Makefile index 78ff5f6..f824a0a 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ install-precommit: ## Install pre-commit hooks pre-commit install install-lint: - pip install ruff==0.1.3 + pip install ruff==0.1.7 install-doc: pip install mkdocs mkdocs-material mkdocstrings[python] diff --git a/docs/poetry.md b/docs/poetry.md index de91047..12341e7 100644 --- a/docs/poetry.md +++ b/docs/poetry.md @@ -43,7 +43,7 @@ poetry add - Add package with specific version constraint ```bash -poetry add ruff==0.1.3 +poetry add ruff==0.1.7 ``` - Add package from git diff --git a/pyproject.toml b/pyproject.toml index 8fb3252..15b1672 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [] managed = true dev-dependencies = [ "pre-commit", - "ruff==0.1.3", + "ruff==0.1.7", "mypy", "scalene~=1.5.21.2", ## DOCS @@ -89,7 +89,7 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" [tool.ruff] target-version = "py310" -# required-version = "0.1.3" +# required-version = "0.1.7" line-length = 88 src = ["src"] select = [ @@ -119,6 +119,7 @@ unfixable = [ ] ignore-init-module-imports = true # ignore = [] +extend-include = ["*.ipynb"] extend-ignore = [ "E501", # Line too long, handled by ruff formatter "D107", # "Missing docstring in __init__", diff --git a/requirements-dev.lock b/requirements-dev.lock index f96de95..20b8ea4 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -59,7 +59,7 @@ pyyaml-env-tag==0.1 regex==2023.10.3 requests==2.31.0 rich==13.6.0 -ruff==0.1.3 +ruff==0.1.7 scalene==1.5.21.4 six==1.16.0 tomli==2.0.1 From 038b3c1712bb36c03db973cece02188026f11a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 11:04:26 +0300 Subject: [PATCH 02/14] mininum supported python version changed from 3.10 to 3.11 --- .github/workflows/doc.yaml | 4 +- .github/workflows/lint.yaml | 4 +- .github/workflows/test.yaml | 2 +- .gitlab-ci.yml | 2 +- .pre-commit-config.yaml | 2 +- .python-version | 2 +- Makefile | 4 +- docker/Dockerfile | 2 +- docs/poetry.md | 2 +- pyproject.toml | 9 ++-- requirements-dev.lock | 66 +++++++++++++++--------------- src/python_template/placeholder.py | 10 ++--- 12 files changed, 52 insertions(+), 57 deletions(-) diff --git a/.github/workflows/doc.yaml b/.github/workflows/doc.yaml index fb9b59d..d85bcde 100644 --- a/.github/workflows/doc.yaml +++ b/.github/workflows/doc.yaml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Set up cache uses: actions/cache@v2 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 56d3cb1..a6efbc9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Pip Update run: | make -s update-pip diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ac396af..73b9650 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ jobs: test: strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.11', '3.11'] # os: [ubuntu-20.04, ubuntu-22.04] runs-on: ubuntu-22.04 steps: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82555e6..53e14cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - package - doc -image: python:3.10 +image: python:3.11 lint: stage: lint diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21dae88..2e3862a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: python-use-type-annotations - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.1.7 + rev: v0.1.11 hooks: # Run the Ruff linter. - id: ruff diff --git a/.python-version b/.python-version index 09dcc78..375f5ca 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.10.11 +3.11.6 diff --git a/Makefile b/Makefile index f824a0a..4256227 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SHELL=/bin/bash ROOT_DIR=python-template PACKAGE=src/python_template PYTHON = python -PYTHON_VERSION=3.10 +PYTHON_VERSION=3.11 DOC_DIR=./docs TEST_DIR=./tests TEST_MARKER=placeholder @@ -59,7 +59,7 @@ install-precommit: ## Install pre-commit hooks pre-commit install install-lint: - pip install ruff==0.1.7 + pip install ruff==0.1.11 install-doc: pip install mkdocs mkdocs-material mkdocstrings[python] diff --git a/docker/Dockerfile b/docker/Dockerfile index b7722b2..4382683 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG PYTHON_BASE_IMAGE=3.10-slim-bookworm +ARG PYTHON_BASE_IMAGE=3.11-slim-bookworm ARG APP_NAME=python_template # diff --git a/docs/poetry.md b/docs/poetry.md index 12341e7..d0dbd36 100644 --- a/docs/poetry.md +++ b/docs/poetry.md @@ -43,7 +43,7 @@ poetry add - Add package with specific version constraint ```bash -poetry add ruff==0.1.7 +poetry add ruff==0.1.11 ``` - Add package from git diff --git a/pyproject.toml b/pyproject.toml index 15b1672..2855598 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.0.0" description = "Python Template" # NOTE: Overwrites .python-version -# requires-python = ">=3.9,<3.12" +# requires-python = ">=3.11,<3.13" authors = [ {name = "template", email = "template@github.com"}, @@ -29,9 +29,8 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: Unix", "Operating System :: MacOS", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dependencies = [] @@ -40,7 +39,7 @@ dependencies = [] managed = true dev-dependencies = [ "pre-commit", - "ruff==0.1.7", + "ruff==0.1.11", "mypy", "scalene~=1.5.21.2", ## DOCS @@ -89,7 +88,7 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" [tool.ruff] target-version = "py310" -# required-version = "0.1.7" +# required-version = "0.1.11" line-length = 88 src = ["src"] select = [ diff --git a/requirements-dev.lock b/requirements-dev.lock index 20b8ea4..dd42a5a 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -7,66 +7,64 @@ # all-features: false -e file:. -babel==2.13.1 -certifi==2023.7.22 +babel==2.14.0 +certifi==2023.11.17 cfgv==3.4.0 -charset-normalizer==3.3.1 +charset-normalizer==3.3.2 click==8.1.7 cloudpickle==3.0.0 colorama==0.4.6 -coverage==7.3.2 -distlib==0.3.7 -exceptiongroup==1.1.3 +coverage==7.4.0 +distlib==0.3.8 execnet==2.0.2 -filelock==3.12.4 +filelock==3.13.1 ghp-import==2.1.0 -griffe==0.36.7 -identify==2.5.30 -idna==3.4 +griffe==0.38.1 +identify==2.5.33 +idna==3.6 iniconfig==2.0.0 jinja2==3.1.2 -markdown==3.5 +markdown==3.5.1 markdown-it-py==3.0.0 markupsafe==2.1.3 mdurl==0.1.2 mergedeep==1.3.4 mkdocs==1.5.3 mkdocs-autorefs==0.5.0 -mkdocs-material==9.4.6 -mkdocs-material-extensions==1.3 -mkdocstrings==0.23.0 -mkdocstrings-python==1.7.3 -mypy==1.6.1 +mkdocs-material==9.5.3 +mkdocs-material-extensions==1.3.1 +mkdocstrings==0.24.0 +mkdocstrings-python==1.7.5 +mypy==1.8.0 mypy-extensions==1.0.0 nodeenv==1.8.0 packaging==23.2 paginate==0.5.6 -pathspec==0.11.2 -platformdirs==3.11.0 +pathspec==0.12.1 +platformdirs==4.1.0 pluggy==1.3.0 -pre-commit==3.5.0 -psutil==5.9.6 -pygments==2.16.1 -pymdown-extensions==10.3.1 +pre-commit==3.6.0 +psutil==5.9.7 +pygments==2.17.2 +pymdown-extensions==10.7 pynvml==11.4.1 -pytest==7.4.2 +pytest==7.4.4 pytest-cov==4.1.0 -pytest-rerunfailures==12.0 -pytest-xdist==3.3.1 +pytest-rerunfailures==13.0 +pytest-xdist==3.5.0 python-dateutil==2.8.2 pyyaml==6.0.1 pyyaml-env-tag==0.1 -regex==2023.10.3 +regex==2023.12.25 requests==2.31.0 -rich==13.6.0 -ruff==0.1.7 +rich==13.7.0 +ruff==0.1.11 scalene==1.5.21.4 six==1.16.0 -tomli==2.0.1 -typing-extensions==4.8.0 -urllib3==2.0.7 -virtualenv==20.24.6 +typing-extensions==4.9.0 +urllib3==2.1.0 +virtualenv==20.25.0 watchdog==3.0.0 -wheel==0.41.2 +wheel==0.42.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==68.2.2 +setuptools==69.0.3 diff --git a/src/python_template/placeholder.py b/src/python_template/placeholder.py index f34b86b..58f70b1 100644 --- a/src/python_template/placeholder.py +++ b/src/python_template/placeholder.py @@ -22,10 +22,8 @@ - `divide(a, b)` - Returns the quotient of two numbers. """ -from typing import Union - -def add(a: Union[float, int], b: Union[float, int]) -> float: +def add(a: float | int, b: float | int) -> float: """Compute and return the sum of two numbers. Examples: @@ -44,7 +42,7 @@ def add(a: Union[float, int], b: Union[float, int]) -> float: return float(a + b) -def subtract(a: Union[float, int], b: Union[float, int]) -> float: +def subtract(a: float | int, b: float | int) -> float: """Compute and return the substaction of two numbers. Examples: @@ -63,7 +61,7 @@ def subtract(a: Union[float, int], b: Union[float, int]) -> float: return float(a - b) -def multiply(a: Union[float, int], b: Union[float, int]) -> float: +def multiply(a: float | int, b: float | int) -> float: """Compute and return the multiplication of two numbers. Examples: @@ -82,7 +80,7 @@ def multiply(a: Union[float, int], b: Union[float, int]) -> float: return float(a * b) -def divide(a: Union[float, int], b: Union[float, int]) -> float: +def divide(a: float | int, b: float | int) -> float: """Compute and return the division of two numbers. Examples: From fc30335321e1a35d0b8d3e98629804bbf311f473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 13:45:00 +0300 Subject: [PATCH 03/14] github actions test python version fixed --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 73b9650..123b68d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ jobs: test: strategy: matrix: - python-version: ['3.8', '3.9', '3.11', '3.11'] + python-version: ['3.11', '3.12'] # os: [ubuntu-20.04, ubuntu-22.04] runs-on: ubuntu-22.04 steps: From 903cbc12a51da99d4375689ceb7c2db9b2c88cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 13:54:05 +0300 Subject: [PATCH 04/14] pkg_resources replaced with importlib --- src/python_template/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_template/__init__.py b/src/python_template/__init__.py index 8848fb3..fd1b2ab 100644 --- a/src/python_template/__init__.py +++ b/src/python_template/__init__.py @@ -1,5 +1,5 @@ """Python template package.""" -import pkg_resources # type: ignore +from importlib.metadata import version # Fetches the version of the package as defined in pyproject.toml -__version__ = pkg_resources.get_distribution("python_template").version +__version__ = version("python_template") From a463200b020f7b39d54c4ead613a611563ca7f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 13:56:41 +0300 Subject: [PATCH 05/14] fix test actions --- .github/workflows/test.yaml | 2 +- .gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 123b68d..837bb79 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,7 +29,7 @@ jobs: make -s update-pip - name: Install the Project with Test Dependencies run: | - make -s install-test + make -s install # - name: Show dependencies # run: python -m pip list - name: Test the Project diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 53e14cf..31ce050 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ tests: echo "*********** Pip Update ***********" make -s update-pip echo "*********** Install the Project with Test Dependencies ***********" - make -s install-test + make -s install echo "*********** Test the Project ***********" make -s test-parallel only: From a16365c651ae625d65dad4bffabe4f0d378ced1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 14:15:43 +0300 Subject: [PATCH 06/14] rye install added to actions --- .github/workflows/test.yaml | 5 +++++ Makefile | 1 + 2 files changed, 6 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 837bb79..0d43b31 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,6 +17,11 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - name: Install the latest version of rye + uses: eifinger/setup-rye@v1 + with: + enable-cache: true + cache-prefix: 'rye-venv-cache' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/Makefile b/Makefile index 4256227..8c4fa16 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ install-base: ## Installs only package dependencies rye sync --no-dev --no-lock install: ## Installs the development version of the package + $(MAKE) install-rye rye sync --no-lock $(MAKE) install-precommit From afe6ec6f533a139968eb6afb12474a25ec8d1ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 14:24:23 +0300 Subject: [PATCH 07/14] test action possible fix --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0d43b31..b0a0ca6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -34,7 +34,8 @@ jobs: make -s update-pip - name: Install the Project with Test Dependencies run: | - make -s install + rye sync --no-lock + pre-commit install # - name: Show dependencies # run: python -m pip list - name: Test the Project From 3bf76fa8b776876a1250f87d50f850ff6a7d284c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 14:29:33 +0300 Subject: [PATCH 08/14] test action possible fix 2 --- .github/workflows/test.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b0a0ca6..0d6a423 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,14 +31,13 @@ jobs: sed -i "s/log_cli = true/log_cli = false/" pyproject.toml - name: Pip Update run: | - make -s update-pip + rye run python -m pip install -U pip - name: Install the Project with Test Dependencies run: | rye sync --no-lock - pre-commit install - # - name: Show dependencies - # run: python -m pip list - name: Test the Project - run: make -s test-parallel + # run: make -s test-parallel + run: | + rye run python -m pytest -n auto # - name: Publish code coverage # uses: codecov/codecov-action@v3 From b248b171308feada9c183a63f353f0ce6bd77ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 14:33:22 +0300 Subject: [PATCH 09/14] test action possible fix 3 --- .github/workflows/test.yaml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0d6a423..9694ea3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,28 +10,32 @@ on: jobs: test: - strategy: - matrix: - python-version: ['3.11', '3.12'] - # os: [ubuntu-20.04, ubuntu-22.04] + # strategy: + # matrix: + # python-version: ['3.11', '3.12'] + # # os: [ubuntu-20.04, ubuntu-22.04] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - name: Install the latest version of rye - uses: eifinger/setup-rye@v1 - with: - enable-cache: true - cache-prefix: 'rye-venv-cache' - - name: Set up Python ${{ matrix.python-version }} + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: '3.11' - name: Disable Logger Outputs run: | sed -i "s/log_cli = true/log_cli = false/" pyproject.toml - - name: Pip Update - run: | - rye run python -m pip install -U pip + # - name: Pip Update + # run: | + # rye run python -m pip install -U pip + - name: Install the latest version of rye + uses: eifinger/setup-rye@v1 + with: + enable-cache: true + cache-prefix: 'rye-venv-cache' - name: Install the Project with Test Dependencies run: | rye sync --no-lock From d7dd0a32fc7a80852e8409d992084a520219152c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 15:40:26 +0300 Subject: [PATCH 10/14] test action possible fix 4 --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9694ea3..90f7e29 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,6 +42,6 @@ jobs: - name: Test the Project # run: make -s test-parallel run: | - rye run python -m pytest -n auto + python -m pytest -n auto # - name: Publish code coverage # uses: codecov/codecov-action@v3 From c054eb8f43fd7547188f9af75b901ed6e585373b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 15:42:55 +0300 Subject: [PATCH 11/14] test action possible fix 5 --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 90f7e29..e6a2355 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,16 +21,16 @@ jobs: # uses: actions/setup-python@v4 # with: # python-version: ${{ matrix.python-version }} - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: '3.11' + # - name: Set up Python 3.11 + # uses: actions/setup-python@v4 + # with: + # python-version: '3.11' - name: Disable Logger Outputs run: | sed -i "s/log_cli = true/log_cli = false/" pyproject.toml # - name: Pip Update # run: | - # rye run python -m pip install -U pip + # python -m pip install -U pip - name: Install the latest version of rye uses: eifinger/setup-rye@v1 with: From 59818fe0a464a1ce8b6a1493a7003fc9a44faa38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 15:50:48 +0300 Subject: [PATCH 12/14] test action possible fix 6 --- .github/workflows/test.yaml | 43 +++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e6a2355..5fe68d6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,38 +10,53 @@ on: jobs: test: - # strategy: - # matrix: - # python-version: ['3.11', '3.12'] - # # os: [ubuntu-20.04, ubuntu-22.04] runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Disable Logger Outputs + run: | + sed -i "s/log_cli = true/log_cli = false/" pyproject.toml + - name: Install the latest version of rye + uses: eifinger/setup-rye@v1 + with: + enable-cache: true + cache-prefix: 'rye-venv-cache' + - name: Install the Project with Test Dependencies + run: | + rye sync --no-lock + - name: Test the Project + # run: make -s test-parallel + run: | + python -m pytest -n auto + # - name: Publish code coverage + # uses: codecov/codecov-action@v3 + + test_matrix: + strategy: + matrix: + python-version: ['3.11', '3.12'] + os: [ubuntu-22.04, ubuntu-23.04] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 # - name: Set up Python ${{ matrix.python-version }} # uses: actions/setup-python@v4 # with: # python-version: ${{ matrix.python-version }} - # - name: Set up Python 3.11 - # uses: actions/setup-python@v4 - # with: - # python-version: '3.11' - name: Disable Logger Outputs run: | sed -i "s/log_cli = true/log_cli = false/" pyproject.toml - # - name: Pip Update - # run: | - # python -m pip install -U pip - name: Install the latest version of rye uses: eifinger/setup-rye@v1 with: enable-cache: true cache-prefix: 'rye-venv-cache' + - name: Pin Python Version - ${{ matrix.python-version }} + run: | + rye pin ${{ matrix.python-version }} - name: Install the Project with Test Dependencies run: | rye sync --no-lock - name: Test the Project - # run: make -s test-parallel run: | python -m pytest -n auto - # - name: Publish code coverage - # uses: codecov/codecov-action@v3 From 0c381add8cde460bebcf7d7f59001595f56dcf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 15:55:55 +0300 Subject: [PATCH 13/14] github actions - add windows to os --- .github/workflows/test.yaml | 47 +++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5fe68d6..dbef871 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,40 +9,33 @@ on: - main jobs: - test: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Disable Logger Outputs - run: | - sed -i "s/log_cli = true/log_cli = false/" pyproject.toml - - name: Install the latest version of rye - uses: eifinger/setup-rye@v1 - with: - enable-cache: true - cache-prefix: 'rye-venv-cache' - - name: Install the Project with Test Dependencies - run: | - rye sync --no-lock - - name: Test the Project - # run: make -s test-parallel - run: | - python -m pytest -n auto - # - name: Publish code coverage - # uses: codecov/codecov-action@v3 + # test: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v3 + # - name: Disable Logger Outputs + # run: | + # sed -i "s/log_cli = true/log_cli = false/" pyproject.toml + # - name: Install the latest version of rye + # uses: eifinger/setup-rye@v1 + # with: + # enable-cache: true + # cache-prefix: 'rye-venv-cache' + # - name: Install the Project with Test Dependencies + # run: | + # rye sync --no-lock + # - name: Test the Project + # run: | + # python -m pytest -n auto test_matrix: strategy: matrix: python-version: ['3.11', '3.12'] - os: [ubuntu-22.04, ubuntu-23.04] + os: [windows-latest, ubuntu-22.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - name: Disable Logger Outputs run: | sed -i "s/log_cli = true/log_cli = false/" pyproject.toml @@ -60,3 +53,5 @@ jobs: - name: Test the Project run: | python -m pytest -n auto + # - name: Publish code coverage + # uses: codecov/codecov-action@v3 From 0c69e0412b8d25156b59435826a20f454fb11c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20SI=C4=9EIRCI?= Date: Thu, 4 Jan 2024 15:57:26 +0300 Subject: [PATCH 14/14] removed windows since setup-rye doesn't support it currently --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dbef871..27bc5d0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: strategy: matrix: python-version: ['3.11', '3.12'] - os: [windows-latest, ubuntu-22.04] + os: [ubuntu-22.04] # windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3