Modernize packaging + add CI, and fix two bugs it surfaced - #4
Merged
Conversation
This repo had a pyproject.toml but no CI at all — nothing tested or published it. Bring it onto the ecosystem standard. CI - Add .github/workflows/ci.yml as the 5-line wads stub calling the reusable workflow i2mint/wads/.github/workflows/uv-ci.yml@master, with the secrets pass-through rendered from [tool.wads.ci.env] (PYPI_PASSWORD only — this package needs no test-time secrets). - [tool.wads.ci] project_name set explicitly (was relying on the fallback); [tool.wads.ci.install] extras = "dev" so CI installs .[dev]; [tool.wads.ci.testing] python_versions = 3.10 / 3.12, coverage on. - [tool.wads.ci.publish] enabled = false. enlace_connector has never been published to PyPI under this name; first publication should be a deliberate decision, not a side effect of merging this PR. Same pattern already used by other unpublished packages in the ecosystem. testpaths - Was ["tests"]. wads CI runs `pytest --doctest-modules` with no path argument, so collection is driven entirely by testpaths — the package's own doctests would have run nowhere while CI still reported green. Now ["enlace_connector", "tests"]. Verified locally: package collection is clean (no hangs, no failures) and the suite is 19 passed. - doctest_optionflags now mirrors what wads' run-tests-uv forces in CI (ELLIPSIS, IGNORE_EXCEPTION_DETAIL) so local and CI agree. Packaging metadata - license: replaced the deprecated [project.license] table with the SPDX string form. Built wheel now carries License-Expression: Apache-2.0. - Added the matching Apache-2.0 LICENSE file (there was none), classifiers, and Repository / Documentation urls. Lint - [tool.ruff] gains the ecosystem-standard exclude list, google pydocstyle convention, per-file-ignores and ignore list. E501 moves to ignore (line length is the formatter's job, and CI runs an unpinned `uvx ruff`, so this is the main source of unrelated CI reds). The stricter select the repo already had (E, F, W, I, D100) is kept as-is. Dependencies were cross-checked with wads-deps and are correct as declared: py2mcp is a real (lazily imported) runtime dep, and uvicorn belongs in the `serve` extra because it is what the generated systemd unit / app.toml command invokes in the deployed connector's own venv. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
`render_server_py` rebuilt the ConnectorSpec in the generated module from only name/tools/auth/title/route. `make_connector_app` also reads `spec.stateless_http` and passes it to py2mcp's `mk_http_app`, so a spec declared with `stateless_http=False` silently produced a *stateless* connector once deployed — the generated SPEC fell back to the field default. Nothing surfaced the discrepancy: the scaffold tests only checked that the module compiled and mentioned the tools. Emit the field, and document in the docstring which spec fields are serve-time (must round-trip through server.py) versus deploy-time (consumed by the provisioning bundle instead). Added a regression test covering both the non-default and the default value. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
The new CI's Windows job surfaced this: `test_generate_deploy_bundle_ writes_all_artifacts` asserted `st_mode & 0o111` on the generated provision script, which can never hold on Windows — NTFS has no POSIX execute bit and `Path.chmod` there only toggles the read-only flag. The repo had no CI before, so nothing had ever run the suite on Windows. The production code is right as it stands: the provision script is a bash script that runs as root on the Linux server, and `chmod(0o755)` is the correct thing to do wherever the filesystem can express it. It is the *assertion* that is not portable, so it moves into its own test guarded by `skipif(os.name == "nt")` with the reason spelled out. While there, the bundle test now also checks that the returned path map matches the files actually written, instead of leaving `out` unused. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
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.
Rollout pass over this repo.
[project]metadata (SPDX license, classifiers, urls, testpaths), add the Apache-2.0LICENSEthe metadata was already claiming, and the standard.editorconfig.stateless_httpwas accepted by the scaffolder but never carried into the generatedserver.py, so the generated server silently ignored it.https://claude.ai/code/session_01Uz2YYxAfa1DX8UcCDmeKC5