From 237b9dc9380e903295dfbf2c25465d22bd940ba7 Mon Sep 17 00:00:00 2001 From: narumi Date: Fri, 28 Jun 2024 01:27:13 +0800 Subject: [PATCH] fix python version --- .github/workflows/publish.yaml | 16 ++++----- .github/workflows/python.yaml | 32 +++++++---------- poetry.lock | 63 ++++++++++++++++++++++++++++++++-- pyproject.toml | 10 ++++++ 4 files changed, 89 insertions(+), 32 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5762937..2a23c0a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,18 +14,14 @@ jobs: python-version: ["3.11"] poetry-version: ["1.8.3"] steps: - - - uses: actions/checkout@v4 - - - name: Install Poetry - run: pipx install poetry==${{ matrix.poetry-version }} - - - uses: actions/setup-python@v5 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: poetry - - - name: Publish + - uses: narumiruna/setup-poetry@v1 + with: + poetry-version: ${{ matrix.poetry-version }} + - name: Publish env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} run: | diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 92c0f98..6e01022 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -12,30 +12,22 @@ jobs: python-version: ["3.9", "3.10", "3.11"] poetry-version: ["1.8.3"] steps: - - - uses: actions/checkout@v4 - - - name: Install Poetry - run: pipx install poetry==${{ matrix.poetry-version }} - - - uses: actions/setup-python@v5 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: poetry - - - name: Install dependencies + - uses: narumiruna/setup-poetry@v1 + with: + poetry-version: ${{ matrix.poetry-version }} + - name: Install dependencies run: poetry install - - - name: Lint + - name: Lint run: poetry run ruff check . - - - name: Type check - run: poetry run mypy --install-types --non-interactive mlconfig - - - name: Test + - name: Type check + run: poetry run mypy --install-types --non-interactive . + - name: Test run: poetry run pytest -v -s --cov=mlconfig --cov-report=xml tests - - - name: Upload coverage reports to Codecov + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/poetry.lock b/poetry.lock index c57125a..1d627b2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "antlr4-python3-runtime" @@ -361,6 +361,65 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "types-colorama" +version = "0.4.15.20240311" +description = "Typing stubs for colorama" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-colorama-0.4.15.20240311.tar.gz", hash = "sha256:a28e7f98d17d2b14fb9565d32388e419f4108f557a7d939a66319969b2b99c7a"}, + {file = "types_colorama-0.4.15.20240311-py3-none-any.whl", hash = "sha256:6391de60ddc0db3f147e31ecb230006a6823e81e380862ffca1e4695c13a0b8e"}, +] + +[[package]] +name = "types-docutils" +version = "0.21.0.20240423" +description = "Typing stubs for docutils" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-docutils-0.21.0.20240423.tar.gz", hash = "sha256:7716ec6c68b5179b7ba1738cace2f1326e64df9f44b7ab08d9904d32c23fc15f"}, + {file = "types_docutils-0.21.0.20240423-py3-none-any.whl", hash = "sha256:7f6e84ba8fcd2454c5b8bb8d77384d091a901929cc2b31079316e10eb346580a"}, +] + +[[package]] +name = "types-pygments" +version = "2.18.0.20240506" +description = "Typing stubs for Pygments" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-Pygments-2.18.0.20240506.tar.gz", hash = "sha256:4b4c37812c87bbde687dbf27adf5bac593745a321e57f678dbc311571ba2ac9d"}, + {file = "types_Pygments-2.18.0.20240506-py3-none-any.whl", hash = "sha256:11c90bc1737c9af55e5569558b88df7c2233e12325cb516215f722271444e91d"}, +] + +[package.dependencies] +types-docutils = "*" +types-setuptools = "*" + +[[package]] +name = "types-pyyaml" +version = "6.0.12.20240311" +description = "Typing stubs for PyYAML" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-PyYAML-6.0.12.20240311.tar.gz", hash = "sha256:a9e0f0f88dc835739b0c1ca51ee90d04ca2a897a71af79de9aec5f38cb0a5342"}, + {file = "types_PyYAML-6.0.12.20240311-py3-none-any.whl", hash = "sha256:b845b06a1c7e54b8e5b4c683043de0d9caf205e7434b3edc678ff2411979b8f6"}, +] + +[[package]] +name = "types-setuptools" +version = "70.1.0.20240627" +description = "Typing stubs for setuptools" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-setuptools-70.1.0.20240627.tar.gz", hash = "sha256:385907a47b5cf302b928ce07953cd91147d5de6f3da604c31905fdf0ec309e83"}, + {file = "types_setuptools-70.1.0.20240627-py3-none-any.whl", hash = "sha256:c7bdf05cd0a8b66868b4774c7b3c079d01ae025d8c9562bfc8bf2ff44d263c9c"}, +] + [[package]] name = "typing-extensions" version = "4.11.0" @@ -375,4 +434,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "6dc264f1f384342878b450f8349e5686909bbf8601a54118e418d97730963b18" +content-hash = "e75f67e481c4345445e07aa0ece918b7042b901981b101c831ab11426448762f" diff --git a/pyproject.toml b/pyproject.toml index c1ef873..8eb51e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,13 @@ ruff = "^0.5.0" toml = "^0.10.2" mypy = "^1.10.1" + +[tool.poetry.group.mypy.dependencies] +types-pyyaml = "^6.0.12.20240311" +types-pygments = "^2.18.0.20240506" +types-colorama = "^0.4.15.20240311" +types-setuptools = "^70.1.0.20240627" + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" @@ -44,3 +51,6 @@ force-single-line = true [tool.pytest.ini_options] filterwarnings = ["ignore::DeprecationWarning"] + +[tool.mypy] +ignore_missing_imports = true