Underappreciated Challenges with Python Packaging

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • flit

    Simplified packaging of Python modules

    If it's pure Python, the only packaging file you need is `pyproject.toml`. You can fill that file with packaging metadata per PEP 518 and PEP 621, including using modern build tooling like flit[1] for the build backend and build[2] for the frontend.

    With that, you entire package build (for all distribution types) should be reducible to `python -m build`. Here's an example of a full project doing everything with just `pyproject.toml`[3] (FD: my project).

    [1]: https://github.com/pypa/flit

    [2]: https://github.com/pypa/build

    [3]: https://github.com/pypa/pip-audit

  • build

    A simple, correct Python build frontend (by pypa)

    If it's pure Python, the only packaging file you need is `pyproject.toml`. You can fill that file with packaging metadata per PEP 518 and PEP 621, including using modern build tooling like flit[1] for the build backend and build[2] for the frontend.

    With that, you entire package build (for all distribution types) should be reducible to `python -m build`. Here's an example of a full project doing everything with just `pyproject.toml`[3] (FD: my project).

    [1]: https://github.com/pypa/flit

    [2]: https://github.com/pypa/build

    [3]: https://github.com/pypa/pip-audit

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • pip-audit

    Audits Python environments, requirements files and dependency trees for known security vulnerabilities, and can automatically fix them

    If it's pure Python, the only packaging file you need is `pyproject.toml`. You can fill that file with packaging metadata per PEP 518 and PEP 621, including using modern build tooling like flit[1] for the build backend and build[2] for the frontend.

    With that, you entire package build (for all distribution types) should be reducible to `python -m build`. Here's an example of a full project doing everything with just `pyproject.toml`[3] (FD: my project).

    [1]: https://github.com/pypa/flit

    [2]: https://github.com/pypa/build

    [3]: https://github.com/pypa/pip-audit

  • Nuitka

    Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.

  • mkdocs-material

    Documentation that simply works

    This is an incredible example of organizing information well and making a case to a wide audience. It's difficult enough to shave all the yaks necessary to get a high-level view of all issues related to a problem, and to express all those problems in good writing is an additional tough challenge. These folks have done an amazing job at both.

    Shoutout to Material for MkDocs enabling the swanky theme and Markdown extensions. https://squidfunk.github.io/mkdocs-material/

  • Poetry

    Python packaging and dependency management made easy

  • pipx

    Install and Run Python Applications in Isolated Environments

    As detailed in the other answers, there are two parts to this: 1) Creating a python package from your project (and possibly share this on pypi), and 2) Making this package available as an end-user application.

    For step 2 you can use nuitka or similar, but if your audience is somewhat developer-oriented, you can also propose for them to use pipx: https://github.com/pypa/pipx.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • self-contained-runnable-python-package-template

    This is a template for creating self-contained, runnable python projects in the form of a tidy, structured, runnable python package

    The approach I prefer is to not mess with setuptools etc at all in the first place, and simply make a nice executable package.

    e.g. https://github.com/tpapastylianou/self-contained-runnable-py...

  • The approach I prefer is to not mess with setuptools etc at all in the first place, and simply make a nice executable package.

    e.g. https://github.com/tpapastylianou/self-contained-runnable-py...

  • psycopg2

    PostgreSQL database adapter for the Python programming language

    Back when I used Psycopg2, there was no -binary package, so you'd get libpq set up similarly to pg-native. Docs say:

    > The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.

    Relevant GitHub discussion: https://github.com/psycopg/psycopg2/issues/674

    I dunno, this seems worse to me.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts