docs(examples): migrate to uv and PEP 723 inline script metadata - #705
Open
hasansezertasan wants to merge 15 commits into
Open
docs(examples): migrate to uv and PEP 723 inline script metadata#705hasansezertasan wants to merge 15 commits into
hasansezertasan wants to merge 15 commits into
Conversation
- Changed base image to use UV with Python 3.11. - Updated working directory and file copying to align with UV requirements. - Removed requirements.txt and replaced it with uv.lock and pyproject.toml for dependency management. - Modified README to reflect new build and run commands. - Set default command to run the application using UV.
… ESC/POS integration - Added a new Flask application example in the `flask-example` directory. - Implemented a simple printing functionality using `CupsPrinter`. - Created a Dockerfile for building and running the application. - Included `pyproject.toml` and `uv.lock` for dependency management. - Updated README with build and run instructions.
belono
reviewed
Sep 9, 2025
belono
reviewed
Sep 9, 2025
belono
reviewed
Sep 9, 2025
belono
reviewed
Sep 9, 2025
belono
reviewed
Sep 9, 2025
belono
reviewed
Sep 9, 2025
Co-authored-by: Benito López <belono@users.noreply.github.com>
Co-authored-by: Benito López <belono@users.noreply.github.com>
Co-authored-by: Benito López <belono@users.noreply.github.com>
Co-authored-by: Benito López <belono@users.noreply.github.com>
Co-authored-by: Benito López <belono@users.noreply.github.com>
Co-authored-by: Benito López <belono@users.noreply.github.com>
Resolve modify/delete conflicts in examples/docker-flask/ by keeping the deletion: the example was migrated to examples/flask-example/ using uv and a pyproject.toml/uv.lock, superseding the old Dockerfile and requirements.txt.
Bump Flask 2.3.2->3.1.3, Pillow 10.3.0->12.3.0, python-barcode 0.14.0->0.16.1, qrcode 7.4.2->8.2.0, Werkzeug 3.0.6->3.1.6 to match master. Flask 3.1.3 pulls in blinker>=1.9.0 and itsdangerous>=2.2.0, and Pillow 12.3.0 requires Python >=3.10, so requires-python is raised accordingly. Regenerate uv.lock.
Adding type annotations made mypy check the function bodies, surfacing latent str-to-_raw calls (_raw requires bytes, and Dummy.output joins with b"", so str would fail at runtime). Encode the string arguments to bytes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #705 +/- ##
=======================================
Coverage 79.07% 79.07%
=======================================
Files 21 21
Lines 1754 1754
Branches 243 243
=======================================
Hits 1387 1387
Misses 286 286
Partials 81 81
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Related to #704
What
Migrate the runnable examples in
examples/to uv with PEP 723 inline script metadata, so each example can be run directly withuv run <example>.pywithout a manual virtualenv or dependency install.Changes
# /// scriptmetadata blocks to the standalone examples (barcodes.py,codepage_tables.py,qr_code.py,software_barcode.py,software_columns.py,weather.py), declaringrequires-python, dependencies, and a local editablepython-escpossource.main()entry point, minor cleanups) to fit the single-file script model.examples/docker-flask/example withexamples/flask-example/, now managed by uv viapyproject.tomlanduv.lock, with a uv-basedDockerfile.Notes
examples/.