sanitizers / octomachinery

🤖 Invisible engine driving octobot machines. Simple, yet powerful. [DEMO BOT @ https://github.com/sanitizers/chronographer-github-app] | [tutorial @ https://tutorial.octomachinery.dev] | [docs @ https://docs.octomachinery.dev] | official web-site is at -->
https://octomachinery.dev
GNU General Public License v3.0
57 stars 12 forks source link

[QUESTION] Python 3.7 Distribution -- setup.cfg #37

Closed ShoGinn closed 4 years ago

ShoGinn commented 4 years ago

I found your repository because of your comment on how travis-ci.com doesn't deploy without setup.py

I learn by examples so I've been studying your repo and noticed that you have listed your python requirements:

https://github.com/sanitizers/octomachinery/blob/466eb1f03fd772c69cf6259981cca091f92f24fc/setup.cfg#L75

But your currently generate a universal wheel.

https://github.com/sanitizers/octomachinery/blob/466eb1f03fd772c69cf6259981cca091f92f24fc/setup.cfg#L4-L5

Is there any specific reason?

Sorry for my newb status and thanks for the open source learning opportunity!

Upvote & Fund

Fund with Polar

webknjaz commented 4 years ago

Hi @ShoGinn, the best resource for learning how packaging works is https://packaging.python.org. You should check it out! Also, make sure to participate in discussions @ https://discuss.python.org/.

python_requires is turned into Requires-Python in the built distribution metadata (https://packaging.python.org/specifications/core-metadata/#requires-python / https://packaging.python.org/guides/dropping-older-python-versions/) which is then used by pip to identify dists compatible with the end-user's system.

Universal wheels are most common in Python ecosystem. They contain pure-python code (most of projects are pure-python so they need this). The opposite is OS-specific wheels (manylinux1, manylinux2010, win32, macos) that contain Python C-extensions for specific combinations of OS, interpreter, and bitness. I recommend you checking out this talk to understand this more deeply: https://www.youtube.com/watch?v=02aAZ8u3wEQ.

P.S. This project's dists build/publish flow is the following: 1) I push a Git tag to GitHub. 2) Travis CI gets triggered 3) It runs tox's env called "build-dists": https://github.com/sanitizers/octomachinery/blob/466eb1f03fd772c69cf6259981cca091f92f24fc/tox.ini#L77-L96 4) Which in turn invokes pep517 tool: https://pypi.org/project/pep517/ 5) This tool reads "build-system" @ "pyproject.toml": https://github.com/sanitizers/octomachinery/blob/466eb1f03fd772c69cf6259981cca091f92f24fc/pyproject.toml#L1-L8 6) "build-backend" tells it to invoke "setuptools" 7) setuptools builds sdist and wheel 8) dists are stored under "dist/" 9) Travis CI is configured to also publish those dists to PyPI: https://github.com/sanitizers/octomachinery/blob/466eb1f03fd772c69cf6259981cca091f92f24fc/.travis.yml#L47-L59 (it wipes "setup.py" to have Travis CI do no-op before running "twine upload").

P.P.S. Nowadays it'd quite easy to use GitHub Actions for uploading dists. Here's my guide on how to do this: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/.