pre-commit VS Poetry

Compare pre-commit vs Poetry and see what are their differences.

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks. (by pre-commit)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
pre-commit Poetry
192 377
11,963 29,316
2.0% 2.0%
8.1 9.6
6 days ago 7 days ago
Python Python
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

pre-commit

Posts with mentions or reviews of pre-commit. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-29.
  • How to setup Black and pre-commit in python for auto text-formatting on commit
    3 projects | dev.to | 29 Mar 2024
    Today we are going to look at how to setup Black (a python code formatter) and pre-commit (a package for handling git hooks in python) to automatically format you code on commit.
  • Implementing Quality Checks In Your Git Workflow With Hooks and pre-commit
    6 projects | dev.to | 13 Dec 2023
    # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-toml - id: check-added-large-files - repo: local hooks: - id: tox lint name: tox-validation entry: pdm run tox -e test,lint language: system files: ^src\/.+py$|pyproject.toml|^tests\/.+py$ types_or: [python, toml] pass_filenames: false - id: tox docs name: tox-docs language: system entry: pdm run tox -e docs types_or: [python, rst, toml] files: ^src\/.+py$|pyproject.toml|^docs\/ pass_filenames: false - repo: https://github.com/pdm-project/pdm rev: 2.10.4 # a PDM release exposing the hook hooks: - id: pdm-lock-check - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 3.0.0 hooks: - id: markdownlint
  • Embracing Modern Python for Web Development
    12 projects | dev.to | 8 Dec 2023
    Pre-commit hooks act as the first line of defense in maintaining code quality, seamlessly integrating with linters and code formatters. They automatically execute these tools each time a developer tries to commit code to the repository, ensuring the code adheres to the project's standards. If the hooks detect issues, the commit is paused until the issues are resolved, guaranteeing that only code meeting quality standards makes it into the repository.
  • EmacsConf Live Now
    4 projects | news.ycombinator.com | 2 Dec 2023
  • A Tale of Two Kitchens - Hypermodernizing Your Python Code Base
    31 projects | dev.to | 12 Nov 2023
    Pre-commit Hooks: Pre-commit is a tool that can be set up to enforce coding rules and standards before you commit your changes to your code repository. This ensures that you can't even check in (commit) code that doesn't meet your standards. This allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks.
  • Things I just don't like about Git
    6 projects | news.ycombinator.com | 8 Oct 2023
    Ah, fair enough!

    On my team we use pre-commit[0] a lot. I guess I would define the history to be something like "has this commit ever been run through our pre-commit hooks?". If you rewrite history, you'll (usually) produce commits that have not been through pre-commit (and they've therefore dodged a lot of static checks that might catch code that wasn't working, at that point in time). That gives some manner of objectivity to the "history", although it does depend on each user having their pre-commit hooks activated in their local workspace.

    [0]: https://pre-commit.com/

  • Django Code Formatting and Linting Made Easy: A Step-by-Step Pre-commit Hook Tutorial
    7 projects | dev.to | 4 Oct 2023
    Pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. It supports hooks for various programming languages. Using this framework, you only have to specify a list of hooks you want to run before every commit, and pre-commit handles the installation and execution of those hooks despite your project’s primary language.
  • Git: fu** the history!
    2 projects | dev.to | 14 Sep 2023
    You can learn more here: pre-commit.com
  • [Tool Anouncement] github-distributed-owners - A tool for managing GitHub CODEOWNERS using OWNERS files distributed throughout your code base. Especially helpful for monorepos / multi-team repos
    2 projects | /r/github | 13 Sep 2023
    Note this includes support for pre-commit.
  • Packaging Python projects in 2023 from scratch
    2 projects | /r/Python | 6 Sep 2023
    As a nice next step, you could also add mypy to check your type hints are consistent, and automate running all this via pre-commit hooks set up with… pre-commit.

Poetry

Posts with mentions or reviews of Poetry. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-14.
  • Understanding Dependencies in Programming
    4 projects | dev.to | 14 Apr 2024
    You can manage dependencies in Python with the package manager pip, which comes pre-installed with Python. Pip allows you to install and uninstall Python packages, and it uses a requirements.txt file to keep track of which packages your project depends on. However, pip does not have robust dependency resolution features or isolate dependencies for different projects; this is where tools like pipenv and poetry come in. These tools create a virtual environment for each project, separating the project's dependencies from the system-wide Python environment and other projects.
  • Implementing semantic image search with Amazon Titan and Supabase Vector
    4 projects | dev.to | 5 Apr 2024
    Poetry provides packaging and dependency management for Python. If you haven't already, install poetry via pip:
  • How to Enhance Content with Semantify
    4 projects | dev.to | 2 Mar 2024
    The Semantify repository provides an example Astro.js project. Ensure you have poetry installed, then build the project from the root of the repository:
  • Uv: Python Packaging in Rust
    9 projects | news.ycombinator.com | 15 Feb 2024
    Has anyone else been paying attention to how hilariously hard it is to package PyTorch in poetry?

    https://github.com/python-poetry/poetry/issues/6409

  • Boring Python: dependency management (2022)
    3 projects | news.ycombinator.com | 4 Feb 2024
    Based on this comment 5 days ago[0], it's working? I'm not sure didn't dig in too far but based on that comment it seems fair to say that it's not fully Poetry's fault because torch removed hashes (which poetry needs to be effective) for a while only recently adding it back in.

    Not sure where I would stand if I fully investigated it tho.

    [0] https://github.com/python-poetry/poetry/issues/6409#issuecom...

  • Fun with Avatars: Crafting the core engine | Part. 1
    4 projects | dev.to | 20 Jan 2024
    We will be running this project in Python 3.10 on Mac/Linux, and we will use Poetry to manage our dependencies. Later, we will bundle our app into a container using docker for deployment.
  • Python Packaging, One Year Later: A Look Back at 2023 in Python Packaging
    2 projects | news.ycombinator.com | 16 Jan 2024
    Here are the two main packaging issues I run into, specifically when using Poetry:

    1) Lack of support for building extension modules (as mentioned by the article). There is a workaround using an undocumented feature [0], which I've tried, but ultimately decided it was not the right approach. I still use Poetry, but build the extension as a separate step in CI, rather than kludging it into Poetry.

    2) Lack of support for offline installs [1], e.g. being able to download the dependencies, copy them to another machine, and perform the install from the downloaded dependencies (similar to using "pip --no-index --find-links=."). Again, you can work around this (by using "poetry export --with-credentials" and "pip download" for fetching the dependencies, then firing up pypiserver [2] to run a local PyPI server on the offline machine), but ideally this would all be a first class feature of Poetry, similar to how it is in pip.

    I don't have the capacity to create Pull Requests for addressing these issues with Poetry, and I'm very grateful for the maintainers and those who do contribute. Instead, on the linked issues I share my notes on the matter, in the hope that it may at least help others and potentially get us closer to a solution.

    Regardless, I'm sticking with Poetry for now. Though to be fair, the only other Python packaging tools I've used extensively are Pipenv and pip/setuptools. It's time consuming to thoroughly try out these other packaging tools, and is generally lower priority than developing features/fixing bugs, so it's helpful to read about the author's experience with these other tools, such as PDM and Hatch.

    [0] https://github.com/python-poetry/poetry/issues/2740

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

    [2] https://pypi.org/project/pypiserver/

  • Introducing Flama for Robust Machine Learning APIs
    11 projects | dev.to | 18 Dec 2023
    We believe that poetry is currently the best tool for this purpose, besides of being the most popular one at the moment. This is why we will use poetry to manage the dependencies of our project throughout this series of posts. Poetry allows you to declare the libraries your project depends on, and it will manage (install/update) them for you. Poetry also allows you to package your project into a distributable format and publish it to a repository, such as PyPI. We strongly recommend you to learn more about this tool by reading the official documentation.
  • Poetry VS instld - a user suggested alternative
    2 projects | 9 Dec 2023
  • Navigating the Release Journey of txtToWeb
    2 projects | dev.to | 27 Nov 2023
    For the release of txtToWeb, I opted for Poetry as my release tool and TestPyPI as the package registry. Poetry's simplicity and TestPyPI's environment for testing releases were crucial factors in my decision.

What are some alternatives?

When comparing pre-commit and Poetry you can also consider the following projects:

Pipenv - Python Development Workflow for Humans.

PDM - A modern Python package and dependency manager supporting the latest PEP standards

hatch - Modern, extensible Python project management

pyenv - Simple Python version management

pip-tools - A set of tools to keep your pinned Python dependencies fresh.

virtualenv - Virtual Python Environment builder

conda - A system-level, binary package and environment manager running on all major operating systems and platforms.

pipx - Install and Run Python Applications in Isolated Environments

flit - Simplified packaging of Python modules

PyInstaller - Freeze (package) Python programs into stand-alone executables

pip - The Python package installer

rez - An integrated package configuration, build and deployment system for software