Skip to content

Migrate from Poetry to uv for dependency management and updates#23

Merged
johnnymillergh merged 17 commits intomainfrom
release/8.2
Apr 6, 2026
Merged

Migrate from Poetry to uv for dependency management and updates#23
johnnymillergh merged 17 commits intomainfrom
release/8.2

Conversation

@johnnymillergh
Copy link
Copy Markdown
Owner

build: update version to 8.2

Replace Poetry with uv for faster dependency resolution and installation.
This follows the same migration pattern used in python-web-service-boilerplate.

Migration includes:
- Convert pyproject.toml from Poetry format to PEP 621 standard
- Replace poetry.lock with uv.lock
- Update GitHub Actions workflows to use uv
- Update pre-commit hooks to use 'uv run' instead of 'poetry run'
- Modernize Dockerfile to use uv
- Update README.md with uv setup and usage instructions

All tests and linting pass with uv.
…errors

- Change 'import test_python_boilerplate' to fully-qualified module imports
  in test_debounce_throttle.py and test_apscheduler_configuration.py so mypy
  can resolve the attr-defined references for mocker.spy()
- Add PLW0406 to per-file-ignores for tests/ since fully-qualified self-imports
  trigger the module-imports-itself warning
…ame__]

The test modules were importing themselves (e.g., import test_python_boilerplate.common.test_debounce_throttle) solely to pass the module to mocker.spy(). This triggered PLW0406 (module-imports-itself) and PLC0415 (import-not-at-top-level) lint suppressions.

Replace with the idiomatic sys.modules[__name__] pattern and remove the now-unnecessary PLW0406/PLC0415 entries from pyproject.toml per-file-ignores.
pyinstrument 5.1.2 uses a C-level ProfilerState object via sys.setprofile() that is not a callable Python function. pytest-benchmark's PauseInstrumentation saves and restores the profiler via sys.setprofile(), which fails with TypeError on the non-callable ProfilerState.

Skip the auto_profile fixture for tests using the benchmark fixture, since profiling during benchmarks is counterproductive anyway (adds overhead that corrupts measurements).
…deferred side effects

- Adopt PEP 695 type parameter syntax in profiling.py and debounce_throttle.py
- Remove unnecessary `from __future__ import annotations` in asynchronization.py and debounce_throttle.py
- Extract _make_profile_decorator factory to DRY elapsed_time, mem_profile, and cpu_profile
- Defer loguru handler setup into configure() and SMTP login into init_smtp()
- Rename retain_log_files to _retain_log_files (private, called only by configure)
- Fix stale README: consolidate black/isort/flake8 references to Ruff, remove duplicate poetry section, fix Python badge
- Bump actions/checkout v2/v3 to v4, docker-build-with-cache-action v2 to v6
- Add py.typed marker for PEP 561 compliance
@johnnymillergh johnnymillergh merged commit 7fbfd0e into main Apr 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant