Skip to content

Packaging pymeos

Víctor Diví edited this page Aug 26, 2022 · 2 revisions

This page lists all the things that must be done to publish a new version of the pymeos package.
Note that, unlike pymeos_cffi, it is not necessary to update the pymeos package after every single change of the MEOS library.
Since pymeos_cffi is a dependency, updating the pymeos_cffi will be enough to get any changes in MEOS as long as they don't affect the part of the API that pymeos uses.
Also unlike pymeos_cffi, the process of building pymeos is simple and straightforward, since the resulting pre-built distribution should be compatible with any system and architecture (being a pure python package).

1. Update version number

In the pyproject.toml file, update the version number in version=X.Y.Z so it won't conflict with the existing ones. You won't be able to publish a package with the same version number as an existing one.

2. Build package

To build the package, run the build python package:

python3 -m build

If everything goes smoothly, two files will have been generated:

  • pymeos-X.Y.Z.tar.gz for source distributions
  • pymeos-X.Y.Z-py3-none-any.whl for wheel (pre-built) distributions

To only generate one of the files, you can pass the flags --sdist to generate only the tar.gz file, or --wheel to generate only the .whl file.

3. Upload

To upload the build package into PyPi, you can run twine:

python3 -m twine upload <path-to-file-to-upload>

If you want to upload everything in the dist/ folder, run:

python3 -m twine upload dist/*

It will ask for the credentials before uploading the distributions to PyPi.

4. Congratulate yourself 🥳

🎉🎉🎉 You have uploaded a new version of pymeos 🎉🎉🎉

Clone this wiki locally