Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ on:
jobs:
linters:
name: Linting and static analysis
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.13"
- run: pip install -r requirements.txt
- run: pre-commit run --all-files
- run: mypy looptime --strict
Expand All @@ -24,13 +24,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -45,7 +45,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
- name: Publish coverage to CodeCov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
if: success()
env:
PYTHON: ${{ matrix.python-version }}
Expand All @@ -59,13 +59,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "pypy-3.7", "pypy-3.8" ]
python-version: [ "pypy-3.9", "pypy-3.10", "pypy-3.11" ]
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -76,9 +76,9 @@ jobs:
coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
- run: pip install coveralls
- run: coveralls --service=github --finish
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
jobs:
publish:
name: Build and publish
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install --upgrade setuptools wheel twine
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/thorough.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
jobs:
linters:
name: Linting and static analysis
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.13"
- run: pip install -r requirements.txt
- run: pre-commit run --all-files
- run: mypy looptime --strict
Expand All @@ -26,13 +26,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -47,7 +47,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
- name: Publish coverage to CodeCov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
if: success()
env:
PYTHON: ${{ matrix.python-version }}
Expand All @@ -61,13 +61,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "pypy-3.7", "pypy-3.8" ]
python-version: [ "pypy-3.9", "pypy-3.10", "pypy-3.11" ]
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -78,9 +78,9 @@ jobs:
coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
- run: pip install coveralls
- run: coveralls --service=github --finish
env:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exclude: |
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v5.0.0
hooks:
- id: check-ast
- id: trailing-whitespace
Expand Down Expand Up @@ -46,7 +46,7 @@ repos:
# - id: double-quote-string-fixer

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
Expand All @@ -59,7 +59,7 @@ repos:
- id: text-unicode-replacement-char

- repo: https://github.com/PyCQA/isort
rev: 5.8.0
rev: 6.0.1
hooks:
- id: isort
name: isort-source-code
2 changes: 1 addition & 1 deletion looptime/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def setup_looptime(
def time(self) -> float:
return self.__int2time(self.__now)

def run_in_executor(self, executor: Any, func: Any, *args: Any) -> AnyFuture:
def run_in_executor(self, executor: Any, func: Any, *args: Any) -> AnyFuture: # type: ignore
future = super().run_in_executor(executor, func, *args)
if isinstance(future, asyncio.Future):
self.__sync_futures.add(future)
Expand Down
4 changes: 3 additions & 1 deletion looptime/math.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import abc
from typing import Any


class Numeric(metaclass=abc.ABCMeta):
Expand Down Expand Up @@ -108,5 +109,6 @@ def __mod__(self, other: object) -> float:
else:
return NotImplemented

def __pow__(self, power: float, modulo: None = None) -> float:
# See the StdLib's comments on pow() on why it is Any, not float.
def __pow__(self, power: float, modulo: None = None) -> Any:
return pow(round(self._value * self.__rr), power, modulo) / pow(self.__rr, power, modulo)
2 changes: 1 addition & 1 deletion looptime/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from looptime import loops, patchers


@pytest.hookimpl(hookwrapper=True) # type: ignore
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_setup(fixturedef: Any, request: Any) -> Any:
if fixturedef.argname == "event_loop":
result = yield
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ codecov
coverage
coveralls
isort
# Mypy requires typed-ast, which is broken on PyPy 3.7 (could work in PyPy 3.8).
mypy==0.920; implementation_name == "cpython"
mypy==1.16.0
pre-commit
pytest
pytest-asyncio
pytest-asyncio<1.0.0
pytest-cov
pytest-mock
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
]
},

python_requires='>=3.7',
python_requires='>=3.9',
setup_requires=[
'setuptools_scm',
],
Expand Down
Loading