chore: build with hatchling only and move MCP deps to an extra - #45
Open
SkyeAv wants to merge 1 commit into
Open
chore: build with hatchling only and move MCP deps to an extra#45SkyeAv wants to merge 1 commit into
SkyeAv wants to merge 1 commit into
Conversation
Drop the legacy setuptools build (setup.py) and the stale root
requirements.txt; pyproject.toml (hatchling) is now the single build
source of truth.
Move the MCP server dependencies (fastmcp, click) out of the required
dependency list into an optional 'mcp' extra, so a base install of TCT
no longer pulls in the MCP stack. The core package never imported the
server at import time, so this is a clean split.
- pyproject.toml: add [project.optional-dependencies] mcp; remove
fastmcp/click from required deps.
- Makefile: install now runs 'uv sync --all-extras --dev' (matches CI).
- tests/test_server.py: pytest.importorskip("fastmcp") so the suite
skips cleanly when the extra is absent.
- uv.lock: regenerated (also bumps the locked version 0.1.6 -> 0.2.0).
Member
Author
|
Should I rerun tests if they're failing because node norm and such seem to be down? |
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.
Consolidates the project on a single hatchling build via
pyproject.tomland moves the MCP server dependencies into an optionalmcpextra, so a base install ofTCTno longer pulls in the MCP stack.Build system
setup.py(setuptools) and the stale rootrequirements.txt;pyproject.toml(hatchling) is now the only build source of truth.setup.pyhad drifted to0.1.6and even listed the stdlibcopymodule as a dependency.[tool.hatch.build.targets.wheel] packages = ["TCT"]; the wheel still ships exactly theTCT/modules.MCP extra
[project.optional-dependencies] mcp = ["fastmcp>=2.12.2", "click>=8.2.1"]and removes both from the requireddependencies.TCT/server.pyimportsfastmcp/mcp, andTCT/__init__.pynever imports the server, so the core package imports fine without the extra.clickincluded: it was only present to satisfyfastmcpand isn't imported anywhere inTCT/, so it moves into the extra too.Dev/CI ergonomics
Makefile:installnow runsuv sync --all-extras --dev, matching.github/workflows/main.yml, so local dev installs themcpextra andtests/test_server.pyruns.tests/test_server.pynow starts withpytest.importorskip("fastmcp"), so a no-extras install skips the module instead of erroring at collection.uv.lockregenerated; this also corrected the locked project version from the stale0.1.6to0.2.0.Design
fastmcp/mcpand their transitive deps.tct-server = "main:main"console script points at rootmain.py, which the hatchling wheel (packages = ["TCT"]) does not ship — so the installed script won't resolve. Left out of scope; worth a follow-up to move the entrypoint toTCT.server:main.TCT/.ipynb_checkpoints/is git-tracked (Jupyter autosave) and was not touched here.Testing
uv build→Successfully built dist/tct-0.2.0.tar.gzanddist/tct-0.2.0-py3-none-any.whl.unzip -p dist/tct-*.whl tct-0.2.0.dist-info/METADATA→Provides-Extra: mcp,Requires-Dist: fastmcp>=2.12.2; extra == 'mcp',Requires-Dist: click>=8.2.1; extra == 'mcp'.import TCTOK;fastmcp installed? False.wheel[mcp]→import TCT.serverOK;fastmcp/clickpresent;mcp.name == "translator-toolkit".uv sync --all-extras --dev && uv run pytest tests/test_server.py -v --no-cov→3 passed.pytest tests/test_server.py→1 skipped(could not import 'fastmcp').uv run ruff check tests/test_server.py→All checks passed!(the 19 repo-wide ruff errors are pre-existing inTCT/sources, untouched here; CI runs ruff withcontinue-on-error).Questions for the reviewer
tct-serverscript. Fix the broken console script (move the entrypoint toTCT.server:main) in a follow-up, or fold it into this PR?