This repository includes a template policy package that is ready to be customised and used.
- Create a new repository using this template
- Rename the folder within
src/to the name of your policy package - Update
pyproject.tomlwith your information - Adapt the permission, schema and algorithms to your needs
This template provides a GitHub Action workflow for building and publishing a policy package to PyPI; you can trigger this action by publishing a new release on GitHub.
The GitHub Action uses the Trusted Publishers workflow, recommended by PyPI.
If you wish to release to PyPI:
- If your policy package already exists as a PyPI project, follow these instructions to add a new Trusted Publisher to your project.
- If your your policy package does not yet exist as a PyPI project, follow these instructions to create a new PyPI project with a Trusted Publisher.
Once released, you can specify your policy package as a requirement by either pointing to its published distribution on PyPI or by pointing to its GitHub release.
The standard way is to point to the package published on PyPI in the same way as any other Python dependency:
package-name==version
For example, a policy package atlas-rucio-policy-package could be listed like this:
atlas-rucio-policy-package==0.5.0
You can also point directly to the GitHub release, by specifying:
package-name @ git+https://github.com/[username]/package-name@tag
This way, you can also avoid publishing to PyPI, and you can remove the PyPI publishing step from the GitHub Action.
For example, a belleii-rucio-policy-package could be listed like this:
belleii-rucio-policy-package @ git+https://github.com/rucio/[email protected]
Rucio supports default algorithms for policy packages, to simplify the configuration process.
In this template, the lfn2pfn algorithm is defined as a default algorithm.
invalid-publisher: valid token, but no corresponding publisher (Publisher with matching claims was not found)
During the publishing stage, this error likely indicates that PyPI was not correctly configured to accept this repository's workflow as a Trusted Publisher. Make sure to follow the instructions in the PyPI requirements section before running the publish workflow.