How to make a Python package in 2021

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
  • Poetry

    Python packaging and dependency management made easy

  • Future-proof... Poetry 1.1 broke compatibility with 1.0. 1.1 lockfiles would crash Poetry 1.0, and 1.0 lockfiles would be thrown away by Poetry 1.1.

    It does not correctly verify hashes (if at all) [1]. You can't add packages without updating all your dependencies. Monorepos are not supported. PEP-508-compliant Git dependencies cause the tool to crash with TypeError [2].

    I think Poetry is the right solution, I use it for everything, but it's not the silver bullet you're painting it to be (yet). It's definitely not on par with Cargo, or maybe even npm.

    [1]: https://github.com/python-poetry/poetry/issues/3765

  • vscode-python

    Python extension for Visual Studio Code

  • 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.

    InfluxDB logo
  • Pipenv

    Python Development Workflow for Humans.

  • I don't know anything about pipenv drama, so by morbid curiosity I looked for it and this is the first thing I saw:

    https://github.com/pypa/pipenv/issues/2228

    This is one of the most ridiculous issues I've read. If the rest of the "drama" is like that, then eh.

  • flit

    Simplified packaging of Python modules

  • I hadn't heard of flit, it does seem like it's not brand new on the scene, however it is primarily a single contributor:

    https://github.com/takluyver/flit/graphs/contributors

    With a title like this, I'd be expecting to see an article describing the latest tools and recommendations from the PyPA.

  • hyper-inspector

  • +1 for poetry. It also includes deterministic dependency resolution with a lock file.

    I just published a repo today[0] using Poetry and it didn’t take me more than 5 minutes. Poetry build && poetry publish

    [0] https://github.com/santiagobasulto/hyper-inspector

  • laravel-websockets-example

    Quick example of a docker stack for laravel-websockets

  • I rather just write a bash script. It's the lowest common denominator. Make may not be installed by default in many places and it has some weird syntax quirks that make it annoying to use IMO.

    Here's an example of how I like to do my "bash scripts that sorta work like make": https://github.com/francislavoie/laravel-websockets-example/... basically each function is a "command", so I do like "./utils start" or whatever.

  • python-lib

    Opinionated cookiecutter template for creating a new Python library

  • I have a cookiecutter template for this at https://github.com/simonw/python-lib (also click-app and datasette-plugin)

    It sets up GitHub actions for publishing the package to PyPI when you create a release on GitHub - which I find way to be a really productive way of working.

  • 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.

    WorkOS logo
  • pip

    The Python package installer

  • virtualenv

    Virtual Python Environment builder

  • Django

    The Web framework for perfectionists with deadlines.

  • Also automatcially handles the issue of public vs private etc. Note this [1] recommends using zip files for speed, especially for larger repositories:

        pip install https://github.com/django/django/archive/master.zip

  • python-template

    A simple template Python repository which describes a workflow and set of tools, to make group projects more manageable (by alknemeyer)

  • Somewhat related: I have an example repository which I've been using to keep track of the tools I use, aimed at people in a research lab who are relatively new to Python. I made it because the existing example/template repositories I found don't gel nicely with the way I like to set up and think about things. Here it is -- hope you find it useful:

    https://github.com/alknemeyer/python-template/

  • sampleproject

    A sample project that exists for PyPUG's "Tutorial on Packaging and Distributing Projects"

  • myproject

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