Migrate to uv, consolidate packaging in pyproject.toml, add MIT license - #50
Merged
Merged
Conversation
The repository was distributed without a license, leaving consumers without permission to use the SDK.
Consolidate packaging and tool configuration (pytest, isort) into a single PEP 621 manifest. Building goes through PEP 517 instead of invoking setup.py directly. The version stays in src/enapter/__init__.py, read dynamically; metadata is unchanged apart from the now-declared MIT license.
pipenv is slow, in maintenance mode, and CI had to bootstrap it via the deprecated get-pipenv.py script. uv is a single fast tool that now covers everything pipenv and twine did. uv.lock finally pins the dev environment (Pipfile.lock was never committed) and .python-version pins the local interpreter to the oldest supported Python. Coverage is scoped to the enapter package because the environment now lives inside the repo as .venv. The repo-local opencode.json permissions are dropped for now; they will be reintroduced based on observed needs.
Replace the setup-python and pipenv bootstrap steps with astral-sh/setup-uv; the UV_PYTHON matrix variable provisions each interpreter. The publish job needs no interpreter at all since uv builds and uploads the package standalone. The Docker jobs are left untouched; their outdated actions will be bumped separately.
Install dependencies and the SDK in separate layers so source-only changes no longer reinstall every dependency. Dependencies are rendered from the frozen uv.lock and installed into the system interpreter, matching the previous pip install . behavior. bump-version refreshes uv.lock so frozen builds never see a stale manifest.
faker is not referenced anywhere in the repo; likely a leftover from removed tests.
The uv-managed .venv lives inside the repository, so plain "pyflakes ." now walks installed packages. Enumerate the actual targets instead, mirroring how coverage was scoped to enapter.
The fresh lock upgraded black to 26.5.1, which enforces a magic trailing comma in the mqtt client signature.
This entry is why Pipfile.lock was never tracked; the file itself is gone with the pipenv migration.
Keep the token off the process command line; uv reads UV_PUBLISH_TOKEN.
The files are plain local paths; COPY has no archive or URL semantics to invoke.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces pipenv + setup.py + twine with uv and a single
pyproject.toml, adds an MIT license, and rebuilds the Docker image with dependency-layer caching.Commit-by-commit (each independently reviewable):
chore: add MIT licensebuild: replace setup.py with pyproject.tomlbuild: replace pipenv with uvci: run checks with uvbuild: build docker image with layered uv installchore: drop unused faker dev dependencyfix: scope pyflakes to source directoriesstyle: apply black 26 formattingWhy
get-pipenv.pyscript. uv covers pipenv, twine, and the build step with one fast tool.uv.lockis committed (thePipfile.locknever was).Notable details
aiomqtt==2.5.*,dnspython==2.8.*,json-log-formatter==1.1.*,httpx==0.28.*);Requires-Python: >=3.11is newly declared (oldsetup.pynever setpython_requires)..python-versionpins local development to 3.11 (oldest supported); the CI matrix is unchanged and driven byUV_PYTHON.bump-versionnow runsuv lockso frozen Docker builds never see a stale manifest.enapterand pyflakes tosrc tests examples, since the.venvnow lives inside the repo.Verification
make check: black/isort/pyflakes/mypy + 204 unit tests + 5 integration tests (live mosquitto) — all green on Python 3.11.make dist: sdist + wheel inspected;Requires-Distidentical to the previous release,py.typedandLICENSEship correctly.enapter 0.24.0+ all deps), layer-cache behavior proven with a source-file dirtying test.Follow-ups (separate PRs)