From 39f16caea1a92c9fb3e7d9c55cdcc20a058174ee Mon Sep 17 00:00:00 2001 From: natsuoto <279971144+natsuoto@users.noreply.github.com> Date: Fri, 26 Jun 2026 19:23:09 +0530 Subject: chore!: package reorg, toolchain migration to uv+ruff+pytest+hatchling, Python 3.11 floor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drops the `src/` layout. The package lives at `edify/` at repo root, split into single-purpose subpackages: `builder/` (mixins composing RegexBuilder), `elements/` (sealed dataclass AST), `compile/` (per-family render functions plus dispatch), `validate/`, `errors/` (typed exception hierarchy), and `library/` (per-validator files in family folders). Pattern, serialize, and result subpackages ship as skeletons. Replaces tox / virtualenv / flake8+isort+black / setup.py+setup.cfg / pytest.ini / .coveragerc / .bumpversion.cfg / MANIFEST.in / ci/ / tests.local.sh with a unified uv + ruff + pytest + hatchling + hatch-vcs stack driven entirely from pyproject.toml. CI workflow rewritten to `uv sync --frozen` + `uv run pytest` per matrix entry; required-status- check names preserved for `check`, `docs`, `py3X (ubuntu)`, and `pypy311 (ubuntu)`. `py39` / `py310` / `pypy310` dropped (3.11 floor). Pre-commit replaced with ruff hooks (lint + format), all hook repos SHA-pinned to commit SHAs. Tests reorganised under `tests/builder/` and `tests/library//` with the `*.test.py` naming shape. 173 tests pass, 100% line coverage. Behaviour changes versus 0.3 (each will get a documented upgrade-guide entry once #80 lands): - `to_regex_string()` returns the bare pattern (no `/.../` wrap) - `to_regex()` on `named_back_reference` compiles successfully via `(?P=name)` instead of raising - builder errors raise typed `EdifyError` subclasses instead of bare `Exception` (catch via `except EdifyError`) - internal helpers (`apply_quantifier`, `frame_creating_element`, `evaluate`, `state`, etc.) removed outright per the 0.3 → 1.0 stub-free policy Closes #68 Closes #69 Closes #253 Co-Authored-By: Claude Opus 4.7 --- tests/library/date/basic.test.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/library/date/basic.test.py (limited to 'tests/library/date/basic.test.py') diff --git a/tests/library/date/basic.test.py b/tests/library/date/basic.test.py new file mode 100644 index 0000000..9b3f45a --- /dev/null +++ b/tests/library/date/basic.test.py @@ -0,0 +1,29 @@ +from edify.library import date + +_TEST_CASES = { + "1/1/2020": True, + "01/01/2020": True, + "1/01/2020": True, + "01/1/2020": True, + "1/1/20": False, + "01/01/20": False, + "1/1/202": False, + "01/01/202": False, + "12/12/2022": True, + "12/12/2": False, + "2021-11-04T22:32:47.142354-10:00": False, + "2021-11-04T22:32:47.142354Z": False, + "2021-11-04T22:32:47.142354": False, + "2021-11-04T22:32:47": False, + "2021-11-04T22:32": False, + "2021-11-04T22": False, + "2021-11-04": False, + "2021-11": False, + "2021": False, + "1-1-2020": False, +} + + +def test_date(): + for candidate, expectation in _TEST_CASES.items(): + assert date(candidate) is expectation -- cgit v1.2.3