Repository navigation
Conversation
The base install now carries only the converter's dependencies: beautifulsoup4, markdown-it-py and python-slugify. typer moves to the cli extra, and typer with fastapi[standard] moves to the server extra. The all extra installs both. When typer is missing, html2blocks prints one line naming the cli extra and exits with status 1. When fastapi or uvicorn is missing, the server command prints the same line for the server extra. The converter modules do not import any of these packages, so the base install still converts and needs no web framework. The Makefile installs all extras, the container image installs the server extra, and the documentation environment installs the all extra. Refs #45
The new tests run the converter and the html2blocks command in child interpreters. pytest-cov exports COV_CORE_* variables, so each child started its own coverage run and wrote a data file that could not be combined with the parent's, which failed make test-coverage in CI. The child environment now drops the COV_CORE_* variables. Refs #45
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.
collective.html2blocksis mostly used as a library:html_to_blocks(),markdown_to_blocks()andvolto_blocks()need onlybeautifulsoup4,markdown-it-pyandpython-slugify. Installing it still pulled intyperandfastapi[standard](withuvicorn,starlette,httpx,jinja2and the FastAPI CLI), which only thehtml2blockscommand and the HTTP service use. Projects that depend on the converter, such as the optionalmarkdownextra in plone-client, got a web framework they never import.This PR moves those dependencies into extras:
collective.html2blocks[cli]installstyperfor thehtml2blockscommand.collective.html2blocks[server]addsfastapi[standard]forhtml2blocks serverand the HTTP service.collective.html2blocks[all]installs both.The base install now carries only the converter's dependencies. When an extra is missing,
html2blocksprints a short message naming the extra to install instead of failing with anImportError. The container image and the documentation installcollective.html2blocks[server].This changes the installation for anyone who uses the command or the service from a plain
pip install collective.html2blocks. They now need the matching extra, and the changelog says so.The
allextra uses a self-reference,collective.html2blocks[cli,server]; uv and the built wheel both accept it. The command module moved tocli_app.py, because a top-leveltyperimport cannot be guarded from inside the module that the console script loads.cli.pynow checks fortyperand loadscli_app, andcli.appstill resolves. Theservercommand importsuvicornwhen it runs, so acliinstall still runsconvertandinfo. The Makefile installs all extras, so the test suite runs unchanged.Closes #45