skillfed

hatch-requirements-txt

Hatchling plugin to read project dependencies from requirements.txt

hatch-requirements-txt v0.4.1 3.5M downloads/30d#2,593 on PyPI41
Permissive license Copyright (c) 2022 Dominic Davis-Foster Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) Active released

What it is and what it does

hatch-requirements-txt is a Hatchling plugin that bridges the gap between traditional requirements.txt dependency files and modern pyproject.toml-based project configuration. It allows you to keep your dependencies specified in requirements.txt while using Hatchling as your build backend, automatically parsing those files and exposing them as project dependencies during the build process.

The plugin supports PEP 508 requirement specifiers, comments, and command-line options (which it ignores), but explicitly does not support editable installs, file references, URLs, or constraints files. It's designed for straightforward dependency declaration and works with optional dependency groups by reading multiple requirements files into separate feature sets. The package is actively maintained, supports Python 3.6 through 3.12, and has no known security vulnerabilities.

Use it for:

  • Migrating a legacy project from setuptools to Hatchling while keeping existing requirements.txt files intact.
  • Managing separate dependency groups (e.g., dev, test, docs) by mapping each to a requirements file and declaring them as optional dependencies.
  • Maintaining a single source of truth for dependencies in requirements.txt while using modern pyproject.toml-based build configuration.
  • Automating dependency pinning in CI/CD by reading from generated requirements.txt files during the build process.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Hatchling plugin that reads project dependencies from requirements.txt files and makes them available to the build system via pyproject.toml configuration.

Yes. If you use Hatchling and want to keep dependencies in requirements.txt files, this plugin eliminates the need to duplicate them in pyproject.toml. It's lightweight, actively maintained, permissively licensed, and has no security vulnerabilities. Install it if you're already committed to Hatchling; skip it if you use another build system or prefer managing dependencies directly in pyproject.toml.

Install

hatch-requirements-txt on PyPI

pip

pip install hatch-requirements-txt

uv

uv add hatch-requirements-txt

poetry

poetry add hatch-requirements-txt

Installing hatch-requirements-txt

Before you install

Low friction installation with only two runtime dependencies (hatchling and packaging). The package is actively maintained with a recent commit history and has been stable since its initial release in 2022.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects.

Quickstart

# In pyproject.toml:
[build-system]
requires = ["hatchling", "hatch-requirements-txt"]
build-backend = "hatchling.build"

[project]
name = "my-project"
version = "1.0.0"
dynamic = ["dependencies"]

[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]

Requires hatchling as the build backend; does not work with other build systems like setuptools or poetry.

Verify before relying

  • Whether the plugin handles complex version specifiers or environment markers beyond basic PEP 508 compliance.
  • Performance characteristics when processing large or numerous requirements.txt files.
  • Compatibility with Hatchling versions beyond those tested in the CI matrix.

Package facts

License Copyright (c) 2022 Dominic Davis-Foster Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.6.1)
Install friction low — pure-Python wheel
Runtime dependencies 2 — hatchling, packaging
Maintenance actively maintained — 933 days since the last release
Last repo commit
First released
Downloads 3,522,910/month — #2,593 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: hatch_requirements_txt-0.4.1-py3-none-any.whl

Keywords: dependencies, hatch, requirements

Development Status :: 4 - BetaFramework :: HatchIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Archiving :: PackagingTyping :: Typed

Tags

hatchling requirements.txt pluginread dependencies from requirements.txthatch build requirements integrationconvert requirements.txt to pyproject.tomlhatch metadata hooksrequirements.txt dependency managementhatchling dependency resolution
hatchling-pluginbuild-configurationdependency-management

More Python Modules packages

idna

Converts domain names between Unicode and…

permissive · top 100 on PyPI

setuptools

Setuptools is a Python build backend and…

permissive · top 100 on PyPI

PyYAML

PyYAML parses and emits YAML 1.1 data format,…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

annotated-types

Provides reusable metadata objects for use with…

permissive · top 100 on PyPI

typing-inspection

Provides runtime tools to inspect and…

permissive · top 100 on PyPI

hatch-fancy-pypi-readme

A Hatch plugin that generates dynamic PyPI…

permissive · top 5,000 on PyPI

hatchling

Hatchling is a standards-compliant Python build…

permissive · top 100 on PyPI

hatchling-autoextras-hook

A Hatchling metadata hook that automatically…

permissive · top 5,000 on PyPI

pylibyear

Measures how outdated your project's…

permissive · top 15,000 on PyPI

hatch-nodejs-version

Provides Hatch plugins to read and write Python…

permissive · top 15,000 on PyPI

hatch_build_scripts

A Hatch build plugin that runs arbitrary shell…

permissive · top 15,000 on PyPI

requirements-detector

Scans a Python project to detect and list its…

permissive · top 15,000 on PyPI

hatch-polylith-bricks

A Hatch build hook that integrates Polylith…

permissive · top 15,000 on PyPI

requirements-parser

Parses pip requirement files into structured…

permissive · top 5,000 on PyPI

hatch-regex-commit

A Hatch plugin that automatically creates Git…

permissive · top 15,000 on PyPI