hatch-requirements-txt
Hatchling plugin to read project dependencies from requirements.txt
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-txtuv
uv add hatch-requirements-txtpoetry
poetry add hatch-requirements-txtInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
hatch-fancy-pypi-readmeA Hatch plugin that generates dynamic PyPI…
permissive · top 5,000 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
hatchling-autoextras-hookA Hatchling metadata hook that automatically…
permissive · top 5,000 on PyPI
pylibyearMeasures how outdated your project's…
permissive · top 15,000 on PyPI
hatch-nodejs-versionProvides Hatch plugins to read and write Python…
permissive · top 15,000 on PyPI
hatch_build_scriptsA Hatch build plugin that runs arbitrary shell…
permissive · top 15,000 on PyPI
requirements-detectorScans a Python project to detect and list its…
permissive · top 15,000 on PyPI
hatch-polylith-bricksA Hatch build hook that integrates Polylith…
permissive · top 15,000 on PyPI
requirements-parserParses pip requirement files into structured…
permissive · top 5,000 on PyPI
hatch-regex-commitA Hatch plugin that automatically creates Git…
permissive · top 15,000 on PyPI