The test job installs from the source tree, where diagrams/cli.py and
resources/ are always present, so two broken releases went out green:
- 0.24.1-0.24.4 declared a `diagrams = diagrams.cli:main` console script
while diagrams/cli.py did not exist, so `pipx install diagrams` installed
an executable that could only raise ModuleNotFoundError (#1149).
- 0.25.0 moved to a PEP 621 [project] table with no [build-system] table,
so pip built with setuptools and shipped a wheel with zero icons. It does
not raise: the CLI exits 0 and renders an 8 KB image of empty boxes.
Separately, the v0.24.4 tag was placed one commit before the version bump,
so the tag said 0.24.4 while pyproject.toml said 0.24.3 (#1183). Nothing
compared the two.
Add tests/test_packaging.py, which asserts against installed metadata and
on-disk files rather than the checkout: every declared console-script entry
point imports, every Node subclass's icon resolves through the production
Node._load_icon path, and diagrams.__version__ matches the distribution
metadata. A setUpModule guard skips the module, with an instruction, when
`import diagrams` does not resolve to the installed distribution, so an
unpacked sdist or a shadowed checkout cannot pass it vacuously.
Add .github/workflows/package.yml to build both artifacts, inspect the
sdist listing, install the wheel into a clean venv and run those invariants
against the install, plus the console script end to end.
Add scripts/check_release_version.py and a tag-version job that fails a
release whose tag does not name the version in pyproject.toml. The version
stays a single literal in pyproject.toml; diagrams.__version__ now reads it
back via importlib.metadata, reporting 0.0.0.dev0 when the imported package
is not the installed copy rather than echoing the wrong release number.
Split [tool.hatch.build] into per-target tables so the sdist also carries
tests/ and scripts/check_release_version.py, letting packagers verify a
build from the tarball without cloning.
Turn diagrams/gis/cplusplus.py into a deprecation shim aliasing
diagrams.gis.cli.Mapnik. The new icon test caught it: resources/gis/cplusplus
was never committed alongside the generated module in #847, so
gis.cplusplus.Mapnik has always rendered a blank node. docs/nodes/gis.md,
generated by the same autogen.sh run, already omits the module and documents
Mapnik at diagrams.gis.cli.Mapnik, which has a real icon.
The diagram image doesn't show correctly.
There is a typo in the image URI.
Instead of `/img/advanced_web_service_with_on-premise_colored.png` should be
`/img/advanced_web_service_with_on-premises_colored.png`
* Initial plan
* Initial plan for removing pre-commit from main dependencies
Co-authored-by: mingrammer <6178510+mingrammer@users.noreply.github.com>
* Remove pre-commit from main dependencies and clean up test artifacts
Co-authored-by: mingrammer <6178510+mingrammer@users.noreply.github.com>
* Move pre-commit to dev dependencies and revert .gitignore changes
Co-authored-by: mingrammer <6178510+mingrammer@users.noreply.github.com>
* Update poetry.lock to reflect dependency changes
Co-authored-by: mingrammer <6178510+mingrammer@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mingrammer <6178510+mingrammer@users.noreply.github.com>
- Add Azure_Icons to v18
- Update Contributing.md file to include Azure specific instructions
- Add DevContainer.json file to make further development easier
- Thanks @rfernandezdo for the initial v12 commit and approach
* feat(scripts): provide `diagrams` CLI
This change addresses https://github.com/mingrammer/diagrams/issues/369
while providing a simple CLI entry point which can be used outside the
virtual environment of the installed package.
This works well with for example with [pipx](https://pipxproject.github.io/pipx/)
or [uv](https://docs.astral.sh/uv/).
* feat(scripts): add docstring and tests
* feat(scripts): Fix pre-commit error
* feat(scripts): Fix pre-commit error 2nd try
---------
Co-authored-by: tessier <tessier@luxeys.com>