From 09baa5ae188b046e98383983910d624fea4210e5 Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Wed, 26 Mar 2025 13:17:08 +0100 Subject: [PATCH 1/6] Non-existing config. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fbe4746..41089fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,7 +125,6 @@ files = [ ] strict = true warn_unused_configs = true -suppress_unused_ignore = true ignore_missing_imports = true warn_redundant_casts = true warn_unused_ignores = true From 0db747476c3db0b8d944ad5369d444b8e8058755 Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Mon, 7 Apr 2025 12:56:15 +0200 Subject: [PATCH 2/6] Switching to `codecov.io` for coverage (#285) --- .coveralls.yml | 1 - .github/workflows/main.yml | 8 ++++---- Makefile | 2 +- README.rst | 4 ++-- pyproject.toml | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 22c6621..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: 3yI8EwDqrGZaPCnfih1fSDizXbjwwL623 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb976ac..c119d46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: run: | make test make services-down - - name: Push Coveralls - run: | - pip install -q coveralls coveralls[yaml] - coveralls + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index ff6a32e..3452a46 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ publish: clean install-test-requirements uv publish clean: - rm -rf .coverage *.egg-info dist/ requirements.txt uv.lock || true + rm -rf *.egg-info dist/ requirements.txt uv.lock || true find . -type d -name __pycache__ -exec rm -rf {} \; || true .PHONY: clean publish safetest test setup develop lint-python test-python _services-up diff --git a/README.rst b/README.rst index 8b08200..b693dd7 100644 --- a/README.rst +++ b/README.rst @@ -5,8 +5,8 @@ mocket /mɔˈkɛt/ .. image:: https://github.com/mindflayer/python-mocket/actions/workflows/main.yml/badge.svg?branch=main :target: https://github.com/mindflayer/python-mocket/actions?query=workflow%3A%22Mocket%27s+CI%22 -.. image:: https://coveralls.io/repos/github/mindflayer/python-mocket/badge.svg?branch=main - :target: https://coveralls.io/github/mindflayer/python-mocket?branch=main +.. image:: https://codecov.io/github/mindflayer/python-mocket/graph/badge.svg?token=htRySebRBt + :target: https://codecov.io/github/mindflayer/python-mocket .. image:: https://app.codacy.com/project/badge/Grade/6327640518ce42adaf59368217028f14 :target: https://www.codacy.com/gh/mindflayer/python-mocket/dashboard diff --git a/pyproject.toml b/pyproject.toml index 41089fe..be88986 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,7 +88,7 @@ exclude = [ testpaths = [ "tests", "mocket", ] -addopts = "--doctest-modules --cov=mocket --cov-report=term-missing --cov-append -v -x" +addopts = "--doctest-modules --cov=mocket --cov-report=xml --cov-report=term-missing --cov-append -v -x" [tool.ruff] src = ["mocket", "tests"] From e5dd9e1a98d941e85ec4ec347b3c91553e286f3c Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Mon, 21 Apr 2025 04:28:32 +0200 Subject: [PATCH 3/6] Update main.yml (#286) --- .github/workflows/main.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c119d46..4baa6f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,6 +23,9 @@ jobs: strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.10'] + env: + # Configure a constant location for the uv cache + UV_CACHE_DIR: /tmp/.uv-cache steps: - uses: actions/checkout@v4 @@ -30,9 +33,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - pyproject.toml + - name: Restore uv cache + uses: actions/cache@v4 + with: + path: /tmp/.uv-cache + key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + restore-keys: | + uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + uv-${{ runner.os }} - uses: hoverkraft-tech/compose-action@v2.0.2 with: compose-file: "./docker-compose.yml" @@ -46,6 +54,8 @@ jobs: run: | make test make services-down + - name: Minimize uv cache + run: uv cache prune --ci - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: From 3c7eec6b170365f32458ea740e8283d763b93bad Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Mon, 28 Apr 2025 18:27:20 +0200 Subject: [PATCH 4/6] Better conf for `pytest-asyncio`. (#288) --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index be88986..6872741 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,6 +89,8 @@ testpaths = [ "tests", "mocket", ] addopts = "--doctest-modules --cov=mocket --cov-report=xml --cov-report=term-missing --cov-append -v -x" +asyncio_default_fixture_loop_scope = "function" +asyncio_mode = "auto" [tool.ruff] src = ["mocket", "tests"] From d51a3bb06a92a29848ae52bf43e65358f7338b65 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sat, 3 May 2025 18:15:48 -0400 Subject: [PATCH 5/6] Fix test_truesendall failure on MacOS (#289) Closes: #287 Signed-off-by: Ihar Hrachyshka --- mocket/socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mocket/socket.py b/mocket/socket.py index 3b1862e..f8f77da 100644 --- a/mocket/socket.py +++ b/mocket/socket.py @@ -158,7 +158,7 @@ def getblocking(self) -> bool: return self.gettimeout() is None def getsockname(self) -> _RetAddress: - return true_gethostbyname(self._address[0]), self._address[1] + return socket.gethostbyname(self._address[0]), self._address[1] def connect(self, address: Address) -> None: self._address = self._host, self._port = address From 2ad3becdc8d0a265d0987af4508d9babe51a2443 Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Sun, 4 May 2025 00:17:18 +0200 Subject: [PATCH 6/6] Bump version. --- mocket/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mocket/__init__.py b/mocket/__init__.py index fc941ca..cd9437e 100644 --- a/mocket/__init__.py +++ b/mocket/__init__.py @@ -31,4 +31,4 @@ "FakeSSLContext", ) -__version__ = "3.13.4" +__version__ = "3.13.5"