DEPRECATED -- Rewritten and moved to 🌊 Shore is a distribution and release management tool for pure Python packages.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

1.7 KiB

Publishing with Shore

By default, every Shore package has the setuptools and pypi plugins. (This is defined in shore.models.Package.get_plugins()). The setuptools plugin is responsible for building source distributions. The pypi plugin consumes these distributions and publishes them on a package index using Twine (PyPI and by default).

To publish packages, use the shore publish pypi command. Optionally add the --test option which will publish to the test PyPI instance instead.

$ shore publish pypi --test
$ shore publish pypi

When adding the pypi plugin manually, the defaults do not apply unless you specify defaults: true. If the package is marked as private, the default pypi plugin configuration will not be added to the package.

Automate publishing in CI checls

You can specify the username and password in the config as environment variables. Most CI systems allow you to securely store a secret as an environment variable.

name: my-package
# ...
- type: pypi
  defaults: true
  username: __token__
  password: '$PYPI_TOKEN'
  test_username: __token__
  test_password: '$PYPI_TEST_TOKEN'

When you're ready to publish from the CI checks, make it run the following commands:

- pip install nr.shore
- shore --version
- shore verify -et "$CI_TAG"
- shore publish pypi

It is also recommended that you add a trial-publish step. Note that we do not pass -e to shore verify as most commits during development won't be tagged (so we do not expect a tag to be present).

- pip install nr.shore
- shore --version
- shore verify -t "$CI_TAG"
- shore bump --snapshot
- shore publish pypi --test