{"repo":"patrick-kidger/action_update_python_project","free":true,"listed":false,"github":"https://github.com/patrick-kidger/action_update_python_project","clone":"git clone https://github.com/patrick-kidger/action_update_python_project.git","description":"Github Action to: Check version / Test / git tag / GitHub Release / Deploy to PyPI","language":null,"stars":21,"topics":["action","actions","github-actions","python","pypi"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"Update Python project: Check version / Test / git tag / GitHub Release / Deploy to PyPI This is a GitHub Action to automate deployment of a new version of a Python project. This action will: - Check out your code; - Check the version of your code against the latest version available on PyPI; - If your code has a newer version: - It will build both an sdist and a wheel; - It will run tests against both; - If both pass: - An annotated git tag is added; - A GitHub Release is made - The sdist and wheel are both uploaded to PyPI. Usage Requires a Linux runner. Assumes that your project uses a pyproject.toml file; the project.name and project.version fields will be accessed. In particular the latter must not be dynamic. (You should put version = importlib.metadata.version(your package name) in your top-level init .py file to get the version at runtime.) You should go to Settings Actions General Workflow permissions and enable Read and write permissions so that releases can be made to GitHub. Example This will run every time the main branch is updated. If the version has updated, then it will trigger things as described above. Options The following are mandatory arguments (for passing to with ) that must be specified: - python-version : What Python version to run everything with. Must be at least 3.11. Set to false to skip this (and use whatever Python you already have on the system). - test-script : What test script to run. Will execute in a precreated uv venv, e.g. commands often ","default_branch":null,"files":null,"tree":[],"storefront":"/r/patrick-kidger","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/patrick-kidger/action_update_python_project/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}