1# Overview 2 3This folder contains scripts to build binary and source wheels of the Tink 4Python package. 5 6## Building the release 7 8In order to generate a release run `./tools/distribution/create_release.sh` from 9the `python/` folder. Note that this requires [Docker](https://www.docker.com) 10to be installed, as it makes use of the 11[pypa images](https://github.com/pypa/manylinux) to build 12[PEP 599](https://www.python.org/dev/peps/pep-0599/) conformant wheels. 13 14This will carry out the following three steps: 15 16* Create binary wheels in a Docker container for Linux. 17* Create a source distribution of the Python package. 18* Run automatic tests against the packages created. 19 20The resulting packages of this process will be stored in `python/release` and 21can be distributed. The binary wheels can be installed on Linux without 22Bazel/protoc being available. Currently this supports building binary wheels 23for: 24 25* manylinux2014_x86_64: Python 3.7, 3.8, 3.9, 3.10 26 27The binary wheels are tested inside a Docker container with the corresponding 28Python versions. 29 30The source distribution still needs to compile the C++ bindings, which requires 31Bazel, protoc and the Tink repository to be available. The path to the Tink 32repository can be set with `TINK_PYTHON_SETUPTOOLS_OVERRIDE_BASE_PATH`. The 33source distribution is tested on the machine where the script is run. 34 35## Publishing the release 36 37The output generated in the previous step can directly be used for upload to 38PyPI. It is recommended to first upload it to the 39[test repository](https://test.pypi.org): 40 41``` 42python3 -m twine upload --repository testpypi release/* 43``` 44 45The package can then be installed using 46 47``` 48pip3 install -i https://test.pypi.org/simple/ tink 49``` 50 51In order to upload it to the PyPI repository run 52 53``` 54python3 -m twine upload release/* 55``` 56 57