Skip to content

Publish Package

Test

It is possible to test the publishing of a PyPI package with TestPyPI.

In order to do this register an account if you haven't done so already and run the following:

docker run --rm -v $(pwd):/io konstin2/maturin publish -b cffi --no-sdist -r https://test.pypi.org/legacy/ -u USERNAME -p PASSWORD --manylinux 2014

It's also possible to build a wheel for aarch as follows:

  1. Run docker container with:
docker run --rm -it -v $(pwd):/home/rust/src messense/manylinux_2_24-cross:aarch64
  1. Downloaded Rust tools via Rustup:
curl https://sh.rustup.rs -sSf | bash -s -- -y
  1. Configured shell:
echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
source $HOME/.cargo/env
  1. Added target:
rustup target add aarch64-unknown-linux-gnu
  1. Publish package:
maturin publish -b cffi --no-sdist -r https://test.pypi.org/legacy/ -u USERNAME -p PASSWORD --manylinux 2014

Production

In order to do this manually for a production-ready release, one can do the same, without specifying the https://test.pypi.org/legacy/ URL. That is:

docker run --rm -v $(pwd):/io konstin2/maturin publish -b cffi --no-sdist -u USERNAME -p PASSWORD --manylinux 2014

It's also possible to build a wheel for aarch as follows:

  1. Run docker container with:
docker run --rm -it -v $(pwd):/home/rust/src messense/manylinux_2_24-cross:aarch64
  1. Downloaded Rust tools via Rustup:
curl https://sh.rustup.rs -sSf | bash -s -- -y
  1. Configured shell:
echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
source $HOME/.cargo/env
  1. Added target:
rustup target add aarch64-unknown-linux-gnu
  1. Publish package:
maturin publish -b cffi --no-sdist -u USERNAME -p PASSWORD --manylinux 2014