Just a demo of the uv package manager for Python.
Project description
uv-demo
PyPI package
A demo and template for a modern Python package managed by uv
. Very useless as a package.
Use this as a template for new projects, or as a reference for how to set up a Python project with the following:
-
uv
as the Python package manager. -
tox
for testing the three latest Python versions. -
pre-commit
hooks for code formatting and linting. - GitHub Actions for testing and publishing.
-
gh-act
for running GitHub Actions locally. - Makefile with common targets.
System Dependencies
uv
curl -LsSf https://astral.sh/uv/install.sh | sh
make
sudo apt install make
sudo pacman -S make
- For running GitHub Actions locally
Quick start
This will install all dependencies (uv sync
) and run the entrypoint script:
uv run uv-demo
Make targets
make
# equivalent to make install test
make install
# runs uv sync
make test
# runs tests for supported python versions
make serve-coverage
# serves coverage report on localhost:8000
make gact
# runs GitHub Actions locally with gh-act
#
# >>> WARNING: if the secrets file has a valid API key,
# this target will actually publish the package to PyPI.
#
# Install with: gh extension install nektos/gh-act
# or see https://github.com/nektos/act
make clean
# removes all venv, tox, cache, and generated files
make update
# updates uv and pre-commit hooks
make publish
# publishes the package to PyPI
Integration with GitHub Actions
See the Upload Python Package workflow file for this package.
Running actions locally
You can use act
to run GitHub Actions locally. Use cases:
- While writing a workflow, to test the workflow locally before pushing to the repository.
- Run the publishing workflow without setting secrets on GitHub.
- Before opening a pull request, to check the workflow will pass.
Copy the example secrets file and edit it with the required secrets:
cp config/secrets.env.example config/secrets.env
Then run make gact
to run the GitHub Actions workflow locally.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uv_demo-0.2.4.tar.gz
.
File metadata
- Download URL: uv_demo-0.2.4.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.27
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63f190df0036f80e08d586697600afb14a8797c348a0d61a28e635726d224b1 |
|
MD5 | de3594f83bd8ee6540b61e213780ace3 |
|
BLAKE2b-256 | 1ec4396ef07d01b97270c303d6b8e7128c3c2b2739705d490d535266a5de2388 |
File details
Details for the file uv_demo-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: uv_demo-0.2.4-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.27
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73734f77f5f83b00ee248fbe6660a4c0c232c583a13bdcf043a3c33e9f31695d |
|
MD5 | 4e7c4e9122fc26b45125ab28c16de57c |
|
BLAKE2b-256 | 19a8034fe60577bc659ca17670cd8cab96a59436eec0610fb2ee2dd6a54c2de5 |