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..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,7 +54,9 @@ jobs: run: | make test make services-down - - name: Push Coveralls - run: | - pip install -q coveralls coveralls[yaml] - coveralls + - name: Minimize uv cache + run: uv cache prune --ci + - 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/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" 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 diff --git a/pyproject.toml b/pyproject.toml index fbe4746..6872741 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,7 +88,9 @@ 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" +asyncio_default_fixture_loop_scope = "function" +asyncio_mode = "auto" [tool.ruff] src = ["mocket", "tests"] @@ -125,7 +127,6 @@ files = [ ] strict = true warn_unused_configs = true -suppress_unused_ignore = true ignore_missing_imports = true warn_redundant_casts = true warn_unused_ignores = true