DEPRECATED -- Rewritten and moved to https://github.com/NiklasRosenstein/shut/. 🌊 Shore is a distribution and release management tool for pure Python packages.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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 test.pypi.org 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
# ...
use:
- 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