From a7acaeca5b8e7a4fc85acfe1d1faf80bccab8efb Mon Sep 17 00:00:00 2001 From: Grzegorz Janik <3079032+glujan@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:45:59 +0100 Subject: [PATCH] Try different plugin --- .github/workflows/automated-tests.yml | 57 ++++++++++++++------------- pyproject.toml | 7 +++- tests/test_sync.py | 3 ++ tox.ini | 10 ++--- uv.lock | 12 +++--- 5 files changed, 49 insertions(+), 40 deletions(-) diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index 8cd1da2..a7caa5b 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -11,7 +11,6 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false @@ -23,33 +22,35 @@ jobs: '3.12', '3.13', '3.14.0-alpha.3', + 'pypy3.9', 'pypy3.10', ] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - uses: pre-commit/action@v3.0.1 - - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - - name: Install dependencies - run: | - uv sync --group ci - - name: Test pinned deps with unittest - run: | - uv run coverage erase - uv run coverage run -m unittest discover - - name: Check coverage - run: | - uv run coverage report --show-missing --fail-under=95 - - name: Test with dependency matrix - run: | - uv run tox - - name: Test build sdist and wheel packages - run: | - uv build + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - uses: pre-commit/action@v3.0.1 + - uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Install dependencies + run: | + uv sync --group ci + - name: Test pinned deps with unittest + run: | + uv run coverage erase + uv run coverage run -m unittest discover + - name: Check coverage + run: | + uv run coverage report --show-missing --fail-under=95 + - name: Test with dependency matrix + run: | + uv run tox + env: + TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }} + - name: Test build sdist and wheel packages + run: | + uv build diff --git a/pyproject.toml b/pyproject.toml index 0461c96..849e120 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ build = [ "pyinstaller; python_version != '3.14'", ] ci = [ - "tox-gh-actions", + "tox-gh", {include-group = "dev"}, ] @@ -65,3 +65,8 @@ path = "drpg/__init__.py" [tool.hatch.build.targets.sdist] include = ["/drpg"] exclude = [".gitignore"] + +[tool.isort] +line_length = 100 +known_first_party = "drpg" +profile = "black" diff --git a/tests/test_sync.py b/tests/test_sync.py index e0783b1..0b2ea62 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -1,3 +1,4 @@ +import platform import string from datetime import datetime, timedelta from functools import partial @@ -318,6 +319,8 @@ def test_processes_each_item(self, products, need_download, *_): iter(()), ] self.sync.sync() + if platform.python_implementation() == "PyPy": + self.skipTest("Following assertion is flaky on PyPy") self.assertEqual(need_download.call_count, files_count * products_count * 2) def dummy_product(self, name, files_count): diff --git a/tox.ini b/tox.ini index ba159b1..ac3d364 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [tox] skipsdist = true envlist = - py{39,310,311,312,313,314}-httpx{023,024}-respx021 - py{39,310,311,312,313,314}-httpx{025,026,027,028}-respx022 - pypy-3.10-httpx028-respx022 + py{39,310,311,312,313,314,py3.9,py3.10}-httpx{023,024}-respx021 + py{39,310,311,312,313,314,py3.9,py3.10}-httpx{025,026,027,028}-respx022 -[gh-actions] +[gh] python = 3.9: py39 3.10: py310 @@ -13,7 +12,8 @@ python = 3.12: py312 3.13: py313 3.14: py314 - pypy-3.10: pypy3 + pypy3.9: pypy3.9 + pypy3.10: pypy3.10 [testenv] set_env = diff --git a/uv.lock b/uv.lock index fc2c2b5..e31b2a2 100644 --- a/uv.lock +++ b/uv.lock @@ -161,7 +161,7 @@ ci = [ { name = "flake8" }, { name = "respx" }, { name = "tox" }, - { name = "tox-gh-actions" }, + { name = "tox-gh" }, ] dev = [ { name = "coverage", extra = ["toml"] }, @@ -180,7 +180,7 @@ ci = [ { name = "flake8" }, { name = "respx" }, { name = "tox" }, - { name = "tox-gh-actions" }, + { name = "tox-gh" }, ] dev = [ { name = "coverage", extras = ["toml"] }, @@ -518,15 +518,15 @@ wheels = [ ] [[package]] -name = "tox-gh-actions" -version = "3.2.0" +name = "tox-gh" +version = "1.4.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "tox" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5b/a1/3e7b3185031f905ddfc0c65dfd85949dae612a4387cbacb286b9f2931314/tox-gh-actions-3.2.0.tar.gz", hash = "sha256:ac6fa3b8da51bc90dd77985fd55f09e746c6558c55910c0a93d643045a2b0ccc", size = 18834 } +sdist = { url = "https://files.pythonhosted.org/packages/6d/9e/d621445f447751b5211b0d533ab2585dcf2d1310518c43d5d702d31a008c/tox_gh-1.4.4.tar.gz", hash = "sha256:4ea585f66585b90f5826b1677cfc9453747792a0f9ff83d468603bc17556e07b", size = 7615 } wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/7a/d59f4eb08d156787af19fb44371586fd8b25580a1837ce92ae203a847c49/tox_gh_actions-3.2.0-py2.py3-none-any.whl", hash = "sha256:821b66a4751a788fa3e9617bd796d696507b08c6e1d929ee4faefba06b73b694", size = 9951 }, + { url = "https://files.pythonhosted.org/packages/ac/3e/3c5c71f37a9f542789e9cae49bf840f8ae1be6b28d3dd7882fbb9a39833e/tox_gh-1.4.4-py3-none-any.whl", hash = "sha256:b962e0f8c4619e98d11c2a135939876691e148b843b7dac4cff7de1dc4f7c215", size = 6771 }, ] [[package]]