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
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: main
on: [push]
jobs:
check-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.7', '3.11', 'pypy3.10']
python-version: ['3.9', '3.13', 'pypy3.10']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -15,12 +15,12 @@ jobs:
- run: poetry install
- run: poetry run make check-tests
check-dev:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.13'
- run: pip install --upgrade pip poetry
- run: poetry install
- run: poetry run make check-lint
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.13'
- run: pip install --upgrade pip poetry
- run: poetry build
- uses: pypa/gh-action-pypi-publish@master
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

* Drop support for Python 3.7, Python 3.8 and PyPy3.8.
* Add tests with Python 3.13 and PyPy3.10.

## [1.1.0] - 2022-12-29

* Improve performance.
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ SRC=benchmark src tests
.PHONY: check-format
check-format:
ruff check --select I ${SRC}
black --check ${SRC}
ruff format --diff ${SRC}

.PHONY: check-tests
check-tests:
pytest --cov=src --cov-report=term --cov-report=html tests

.PHONY: check-lint
check-lint:
mypy --python-version 3.10 ${SRC}
mypy --python-version 3.7 ${SRC}
mypy --python-version 3.13 ${SRC}
mypy --python-version 3.9 ${SRC}
ruff check --ignore I ${SRC}

.PHONY: check
Expand All @@ -21,7 +21,7 @@ check: | check-lint check-tests check-format
.PHONY: format
format:
ruff check --select I --fix ${SRC}
black ${SRC}
ruff format ${SRC}

.PHONY: benchmark
benchmark:
Expand Down
756 changes: 314 additions & 442 deletions poetry.lock

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ classifiers = [
keywords = ["random", "integer", "iterator"]

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.9"
cryptography = "*"

[tool.poetry.group.dev.dependencies]
black = "^23.3.0"
mypy = "^1.4.1"
pytest = "^7.4.4"
pytest-benchmark = "^4.0.0"
pytest-cov = "^4.0.0"
ruff = "^0.2.2"
mypy = "^1.15.0"
pytest = "^8.3.4"
pytest-benchmark = "^5.1.0"
pytest-cov = "^6.0.0"
ruff = "^0.9.5"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
6 changes: 2 additions & 4 deletions src/shuffled/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ def __len__(self) -> int:
return self._size

@overload
def __getitem__(self, index: int) -> int:
...
def __getitem__(self, index: int) -> int: ...

@overload
def __getitem__(self, index: slice) -> Sequence[int]:
...
def __getitem__(self, index: slice) -> Sequence[int]: ...

def __getitem__(self, index: Union[int, slice]) -> Union[int, Sequence[int]]:
if isinstance(index, slice):
Expand Down
6 changes: 2 additions & 4 deletions src/shuffled/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@

class Randomizer(ABC):
@abstractproperty
def domain_size(self) -> int:
...
def domain_size(self) -> int: ...

@abstractmethod
def randomize(self, integer: int) -> int:
...
def randomize(self, integer: int) -> int: ...


class AesRandomizer(Randomizer):
Expand Down
1 change: 1 addition & 0 deletions tests/test_crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from shuffled import crypto

KEYS = (
Expand Down
1 change: 1 addition & 0 deletions tests/test_shuffled.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from shuffled import Shuffled


Expand Down