Skip to content
Draft
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
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
"macos-latest", # ARM
]
python-version: [
"3.7",
"3.8",
"3.14",
]

Expand All @@ -55,6 +55,7 @@ jobs:

- name: Set up Python
uses: actions/setup-python@v6
id: python
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -73,6 +74,8 @@ jobs:
pip install --prefer-binary --editable=.[develop,test]

- name: Run linters and software tests
env:
VIRTUAL_ENV: ${{ env.pythonLocation }}
run: |
poe check

Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog for pytest-cratedb

Unreleased
==========
- Maintenance: Switched type checker from ``mypy`` to ``ty``
- Maintenance: Added ``py.typed`` marker file, signalling typing support

2026/01/05 v0.4.1
=================
Expand Down
20 changes: 3 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ authors = [
{ name = "Christian Haudum", email = "[email protected]" },
{ name = "Andreas Motl", email = "[email protected]" },
]
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Plugins",
Expand Down Expand Up @@ -77,10 +77,10 @@ dependencies = [
"pytest<10",
]
optional-dependencies.develop = [
"mypy<1.20",
"poethepoet<1",
"pyproject-fmt<3",
"ruff<0.15",
"ty",
"validate-pyproject<1",
]
optional-dependencies.release = [
Expand Down Expand Up @@ -177,20 +177,6 @@ show_missing = true
exclude_lines = [
]

[tool.mypy]
packages = [
"pytest_cratedb",
]
exclude = [
]
check_untyped_defs = true
explicit_package_bases = true
ignore_missing_imports = true
implicit_optional = true
install_types = true
namespace_packages = true
non_interactive = true

[tool.versioningit.vcs]
method = "git"
default-tag = "0.0.0"
Expand Down Expand Up @@ -218,7 +204,7 @@ lint = [
{ cmd = "ruff format --check ." },
{ cmd = "ruff check ." },
{ cmd = "validate-pyproject pyproject.toml" },
{ cmd = "mypy" },
{ cmd = "ty check" },
]

release = [
Expand Down
14 changes: 7 additions & 7 deletions pytest_cratedb/plugin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import datetime as dt
import logging
import random
import shutil
import string
import tempfile
from datetime import datetime
from typing import Callable, Generator, Optional
from typing import Callable, Dict, Generator, Optional

import pytest
from cr8.run_crate import CrateNode, get_crate
Expand All @@ -29,11 +29,11 @@ def __init__(self, name: str, version: str, **settings) -> None:
def __repr__(self) -> str:
return f"<CrateDB {self.name}>"

def __enter__(self):
def __enter__(self) -> "CrateLayer":
self._start()
return self

def __exit__(self, exception_type, exception_value, traceback):
def __exit__(self, exception_type, exception_value, traceback) -> None:
self._stop()

def _start(self) -> None:
Expand Down Expand Up @@ -62,7 +62,7 @@ def dsn(self) -> Optional[str]:
return self.node.http_url

@property
def addresses(self):
def addresses(self) -> Dict[str, str]:
return self.node.addresses


Expand All @@ -78,7 +78,7 @@ class CratePlugin:

# noinspection SpellCheckingInspection
@staticmethod
def pytest_addoption(parser):
def pytest_addoption(parser) -> None:
"""
Adds custom options to the ``pytest`` command.
https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_addoption
Expand Down Expand Up @@ -106,7 +106,7 @@ def layer_factory(name: str, version: str, **settings):
@pytest.fixture(scope="session")
def crate(self, crate_layer, crate_version) -> CrateLayerGenerator:
ident = "".join(random.sample(string.ascii_letters, 8))
date = datetime.utcnow().strftime("%Y%m%d%H%M")
date = dt.datetime.now(dt.timezone.utc).strftime("%Y%m%d%H%M")
yield from crate_layer(f"pytest-cratedb-{date}-{ident}", crate_version)

@pytest.fixture
Expand Down
Empty file added pytest_cratedb/py.typed
Empty file.
Loading