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
45 changes: 8 additions & 37 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,22 @@ concurrency:
cancel-in-progress: true

jobs:
flake8:
name: flake8
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install flake8
- name: flake8
uses: liskin/gh-problem-matcher-wrap@e7b7beaaafa52524748b31a381160759d68d61fb
with:
linters: flake8
run: flake8

isort:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: python -m pip install "isort<6"
- name: isort
# Pinned to v3.0.0.
uses: liskin/gh-problem-matcher-wrap@e7b7beaaafa52524748b31a381160759d68d61fb
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
linters: isort
run: isort --check --diff src tests
black:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: black
uses: psf/black@stable
version: "latest"
- name: Ruff lint
run: uv run --group lint -- ruff check

tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-22.04
needs: ["flake8", "isort", "black"]
runs-on: ubuntu-latest
needs: ["lint"]
strategy:
matrix:
python-version:
Expand Down
17 changes: 13 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,23 @@ Releases = "https://github.com/thegrymek/python-disk-collections/releases"

[dependency-groups]
dev = [
"black>=23.3.0",
"flake8>=5.0.4",
"isort>=5.11.5",
"pytest>=7.4.4",
"pytest-cov>=4.1.0",
"tox>=3.28.0",
"tox-uv>=1.13.1",
{ include-group = "lint" }
]
lint = [
"ruff>=0.11.2",
]

[tool.black]
[tool.ruff]
target-version = "py313"
line-length = 79
fix = true

[tool.ruff.format]
preview = true

[tool.coverage.report]
skip_empty = true
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

51 changes: 0 additions & 51 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion src/diskcollections/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class ISerializer:

@staticmethod
def dumps(obj):
"""Converts object to serialized format.
Expand Down
2 changes: 0 additions & 2 deletions src/diskcollections/iterables/iterables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class List(collections.abc.MutableSequence):

def __init__(
self, iterable=None, client_class=None, serializer_class=None
):
Expand Down Expand Up @@ -70,7 +69,6 @@ def insert(self, index, value):


class Deque(collections.abc.MutableSequence):

def __init__(
self,
iterable=(),
Expand Down
2 changes: 0 additions & 2 deletions src/diskcollections/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class PickleSerializer(ISerializer):


class PickleZLibSerializer(ISerializer):

@staticmethod
def dumps(
obj, protocol=pickle.HIGHEST_PROTOCOL, level=zlib.Z_DEFAULT_COMPRESSION
Expand All @@ -33,7 +32,6 @@ class JsonSerializer(ISerializer):


class JsonZLibSerializer(ISerializer):

@staticmethod
def dumps(obj, level=zlib.Z_DEFAULT_COMPRESSION):
jsoned = json.dumps(obj).encode()
Expand Down
2 changes: 0 additions & 2 deletions tests/sequences/test_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class TestTemporaryDirectoryClient:

def create_client(self, mode="w+"):
return clients.TemporaryDirectoryClient(mode=mode)

Expand All @@ -26,7 +25,6 @@ def test_slice(self):


class TestPersistentDirectoryClient:

def create_client(self):
return clients.PersistentDirectoryClient("persistent_dir")

Expand Down
2 changes: 0 additions & 2 deletions tests/sequences/test_iterables.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestFileList:

def test_init(self):
l1 = FileList([1, "a", [5, "b"]])
assert len(l1) == 3
Expand Down Expand Up @@ -130,7 +129,6 @@ def test_overlaps_insert(self):


class TestFileDeque:

def test_init(self):
d1 = FileDeque([1, "a", [5, "b"]])
assert len(d1) == 3
Expand Down
22 changes: 2 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ commands = pytest -v \

[testenv:lint]
runner = uv-venv-lock-runner
dependency_groups = dev
dependency_groups = lint
commands =
black src tests
isort src tests
flake8 src tests


[flake8]
select = E,F,W
exclude =
.tox,
.git,
__pycache__,
build,
dist,
*.pyc,
*.egg-info,
.cache,
.eggs,
venv
max-complexity = 2
ruff format
Loading