hatch-requirements-txt


Namehatch-requirements-txt JSON
Version 0.4.1 PyPI version JSON
download
home_page
SummaryHatchling plugin to read project dependencies from requirements.txt
upload_time2024-01-24 21:47:22
maintainer
docs_urlNone
author
requires_python>=3.6.1
licenseCopyright (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 the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords dependencies hatch requirements
VCS
bugtrack_url
requirements hatchling packaging
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======================
hatch-requirements-txt
=======================

.. start short_desc

**Hatchling plugin to read project dependencies from requirements.txt**

.. end short_desc



.. list-table::
	:stub-columns: 1
	:widths: 10 90

	* - Tests
	  - |actions_linux| |actions_windows| |actions_macos| |coveralls|
	* - PyPI
	  - |pypi-version| |supported-versions| |supported-implementations| |wheel|
	* - Anaconda
	  - |conda-version| |conda-platform|
	* - Activity
	  - |commits-latest| |commits-since| |maintained| |pypi-downloads|
	* - QA
	  - |codefactor| |actions_flake8| |actions_mypy|
	* - Other
	  - |hatch| |license| |language| |requires|

.. |actions_linux| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/Linux/badge.svg
	:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22Linux%22
	:alt: Linux Test Status

.. |actions_windows| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/Windows/badge.svg
	:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22Windows%22
	:alt: Windows Test Status

.. |actions_macos| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/macOS/badge.svg
	:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22macOS%22
	:alt: macOS Test Status

.. |actions_flake8| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/Flake8/badge.svg
	:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22Flake8%22
	:alt: Flake8 Status

.. |actions_mypy| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/mypy/badge.svg
	:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22mypy%22
	:alt: mypy status

.. |requires| image:: https://dependency-dash.repo-helper.uk/github/repo-helper/hatch-requirements-txt/badge.svg
	:target: https://dependency-dash.repo-helper.uk/github/repo-helper/hatch-requirements-txt/
	:alt: Requirements Status

.. |coveralls| image:: https://img.shields.io/coveralls/github/repo-helper/hatch-requirements-txt/master?logo=coveralls
	:target: https://coveralls.io/github/repo-helper/hatch-requirements-txt?branch=master
	:alt: Coverage

.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/repo-helper/hatch-requirements-txt?logo=codefactor
	:target: https://www.codefactor.io/repository/github/repo-helper/hatch-requirements-txt
	:alt: CodeFactor Grade

.. |pypi-version| image:: https://img.shields.io/pypi/v/hatch-requirements-txt
	:target: https://pypi.org/project/hatch-requirements-txt/
	:alt: PyPI - Package Version

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/hatch-requirements-txt?logo=python&logoColor=white
	:target: https://pypi.org/project/hatch-requirements-txt/
	:alt: PyPI - Supported Python Versions

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/hatch-requirements-txt
	:target: https://pypi.org/project/hatch-requirements-txt/
	:alt: PyPI - Supported Implementations

.. |wheel| image:: https://img.shields.io/pypi/wheel/hatch-requirements-txt
	:target: https://pypi.org/project/hatch-requirements-txt/
	:alt: PyPI - Wheel

.. |conda-version| image:: https://img.shields.io/conda/v/conda-forge/hatch-requirements-txt?logo=anaconda
	:target: https://anaconda.org/conda-forge/hatch-requirements-txt
	:alt: Conda - Package Version

.. |conda-platform| image:: https://img.shields.io/conda/pn/conda-forge/hatch-requirements-txt?label=conda%7Cplatform
	:target: https://anaconda.org/conda-forge/hatch-requirements-txt
	:alt: Conda - Platform

.. |hatch| image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
	:target: https://github.com/pypa/hatch
	:alt: Hatch project

.. |license| image:: https://img.shields.io/github/license/repo-helper/hatch-requirements-txt
	:target: https://github.com/repo-helper/hatch-requirements-txt/blob/master/LICENSE
	:alt: License

.. |language| image:: https://img.shields.io/github/languages/top/repo-helper/hatch-requirements-txt
	:alt: GitHub top language

.. |commits-since| image:: https://img.shields.io/github/commits-since/repo-helper/hatch-requirements-txt/v0.4.1
	:target: https://github.com/repo-helper/hatch-requirements-txt/pulse
	:alt: GitHub commits since tagged version

.. |commits-latest| image:: https://img.shields.io/github/last-commit/repo-helper/hatch-requirements-txt
	:target: https://github.com/repo-helper/hatch-requirements-txt/commit/master
	:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2023
	:alt: Maintenance

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/hatch-requirements-txt
	:target: https://pypi.org/project/hatch-requirements-txt/
	:alt: PyPI - Downloads



Usage
========

In your ``pyproject.toml`` make the following changes:

* Append ``hatch-requirements-txt`` to ``build-system.requires``.
* Append ``"dependencies"`` to ``project.dynamic``.
* Add the following table:

.. code-block:: toml

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

The resulting ``pyproject.toml`` should look something like:

.. code-block:: 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"]

You can also define groups of `optional dependencies <https://hatch.pypa.io/latest/config/dependency/#features>`_
(also known as "features") by appending ``optional-dependencies`` to ``project.dynamic`` and adding a table like:

.. code-block:: toml

	[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
	crypto = ["requirements-crypto.txt"]
	fastjson = ["requirements-fastjson.txt"]
	cli = ["requirements-cli.txt"]


Requirements file format
============================

``hatch-requirements-txt`` only supports a subset of the ``requirements.txt`` format_ supported by ``pip``.
The following are supported:

* requirement specifiers, per `PEP 508`_
* Comments, prefixed with a ``#``.
* ``--<option>`` options, both on their own line and after a requirement specifier.
  Note however that the options themselves are ignored.

The following are unsupported within ``requirements.txt`` files:

* Editable install commands with the ``-e`` option,
* References to other requirements or constraints files with the ``-r`` or ``-c`` options.
* References to paths on the local filesystem, or URLs.

**TL;DR**
For best compatibility, ensure all lines in your ``requirements.txt`` files
are valid PEP 508 requirements, or comments starting with a ``#``.

.. _format: https://pip.pypa.io/en/stable/reference/requirements-file-format/
.. _PEP 508: https://peps.python.org/pep-0508/

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hatch-requirements-txt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6.1",
    "maintainer_email": "",
    "keywords": "dependencies,hatch,requirements",
    "author": "",
    "author_email": "Dominic Davis-Foster <dominic@davis-foster.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/7c/04/3703d3caa354fd7148a5453724de70577a6010234d1e1f3ff6b98a4d3242/hatch_requirements_txt-0.4.1.tar.gz",
    "platform": null,
    "description": "=======================\nhatch-requirements-txt\n=======================\n\n.. start short_desc\n\n**Hatchling plugin to read project dependencies from requirements.txt**\n\n.. end short_desc\n\n\n\n.. list-table::\n\t:stub-columns: 1\n\t:widths: 10 90\n\n\t* - Tests\n\t  - |actions_linux| |actions_windows| |actions_macos| |coveralls|\n\t* - PyPI\n\t  - |pypi-version| |supported-versions| |supported-implementations| |wheel|\n\t* - Anaconda\n\t  - |conda-version| |conda-platform|\n\t* - Activity\n\t  - |commits-latest| |commits-since| |maintained| |pypi-downloads|\n\t* - QA\n\t  - |codefactor| |actions_flake8| |actions_mypy|\n\t* - Other\n\t  - |hatch| |license| |language| |requires|\n\n.. |actions_linux| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/Linux/badge.svg\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22Linux%22\n\t:alt: Linux Test Status\n\n.. |actions_windows| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/Windows/badge.svg\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22Windows%22\n\t:alt: Windows Test Status\n\n.. |actions_macos| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/macOS/badge.svg\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22macOS%22\n\t:alt: macOS Test Status\n\n.. |actions_flake8| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/Flake8/badge.svg\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22Flake8%22\n\t:alt: Flake8 Status\n\n.. |actions_mypy| image:: https://github.com/repo-helper/hatch-requirements-txt/workflows/mypy/badge.svg\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/actions?query=workflow%3A%22mypy%22\n\t:alt: mypy status\n\n.. |requires| image:: https://dependency-dash.repo-helper.uk/github/repo-helper/hatch-requirements-txt/badge.svg\n\t:target: https://dependency-dash.repo-helper.uk/github/repo-helper/hatch-requirements-txt/\n\t:alt: Requirements Status\n\n.. |coveralls| image:: https://img.shields.io/coveralls/github/repo-helper/hatch-requirements-txt/master?logo=coveralls\n\t:target: https://coveralls.io/github/repo-helper/hatch-requirements-txt?branch=master\n\t:alt: Coverage\n\n.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/repo-helper/hatch-requirements-txt?logo=codefactor\n\t:target: https://www.codefactor.io/repository/github/repo-helper/hatch-requirements-txt\n\t:alt: CodeFactor Grade\n\n.. |pypi-version| image:: https://img.shields.io/pypi/v/hatch-requirements-txt\n\t:target: https://pypi.org/project/hatch-requirements-txt/\n\t:alt: PyPI - Package Version\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/hatch-requirements-txt?logo=python&logoColor=white\n\t:target: https://pypi.org/project/hatch-requirements-txt/\n\t:alt: PyPI - Supported Python Versions\n\n.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/hatch-requirements-txt\n\t:target: https://pypi.org/project/hatch-requirements-txt/\n\t:alt: PyPI - Supported Implementations\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/hatch-requirements-txt\n\t:target: https://pypi.org/project/hatch-requirements-txt/\n\t:alt: PyPI - Wheel\n\n.. |conda-version| image:: https://img.shields.io/conda/v/conda-forge/hatch-requirements-txt?logo=anaconda\n\t:target: https://anaconda.org/conda-forge/hatch-requirements-txt\n\t:alt: Conda - Package Version\n\n.. |conda-platform| image:: https://img.shields.io/conda/pn/conda-forge/hatch-requirements-txt?label=conda%7Cplatform\n\t:target: https://anaconda.org/conda-forge/hatch-requirements-txt\n\t:alt: Conda - Platform\n\n.. |hatch| image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n\t:target: https://github.com/pypa/hatch\n\t:alt: Hatch project\n\n.. |license| image:: https://img.shields.io/github/license/repo-helper/hatch-requirements-txt\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/blob/master/LICENSE\n\t:alt: License\n\n.. |language| image:: https://img.shields.io/github/languages/top/repo-helper/hatch-requirements-txt\n\t:alt: GitHub top language\n\n.. |commits-since| image:: https://img.shields.io/github/commits-since/repo-helper/hatch-requirements-txt/v0.4.1\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/pulse\n\t:alt: GitHub commits since tagged version\n\n.. |commits-latest| image:: https://img.shields.io/github/last-commit/repo-helper/hatch-requirements-txt\n\t:target: https://github.com/repo-helper/hatch-requirements-txt/commit/master\n\t:alt: GitHub last commit\n\n.. |maintained| image:: https://img.shields.io/maintenance/yes/2023\n\t:alt: Maintenance\n\n.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/hatch-requirements-txt\n\t:target: https://pypi.org/project/hatch-requirements-txt/\n\t:alt: PyPI - Downloads\n\n\n\nUsage\n========\n\nIn your ``pyproject.toml`` make the following changes:\n\n* Append ``hatch-requirements-txt`` to ``build-system.requires``.\n* Append ``\"dependencies\"`` to ``project.dynamic``.\n* Add the following table:\n\n.. code-block:: toml\n\n\t[tool.hatch.metadata.hooks.requirements_txt]\n\tfiles = [\"requirements.txt\"]\n\nThe resulting ``pyproject.toml`` should look something like:\n\n.. code-block:: toml\n\n\t[build-system]\n\trequires = [\"hatchling\", \"hatch-requirements-txt\"]\n\tbuild-backend = \"hatchling.build\"\n\n\t[project]\n\tname = \"my-project\"\n\tversion = \"1.0.0\"\n\tdynamic = [\"dependencies\"]\n\n\t[tool.hatch.metadata.hooks.requirements_txt]\n\tfiles = [\"requirements.txt\"]\n\nYou can also define groups of `optional dependencies <https://hatch.pypa.io/latest/config/dependency/#features>`_\n(also known as \"features\") by appending ``optional-dependencies`` to ``project.dynamic`` and adding a table like:\n\n.. code-block:: toml\n\n\t[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]\n\tcrypto = [\"requirements-crypto.txt\"]\n\tfastjson = [\"requirements-fastjson.txt\"]\n\tcli = [\"requirements-cli.txt\"]\n\n\nRequirements file format\n============================\n\n``hatch-requirements-txt`` only supports a subset of the ``requirements.txt`` format_ supported by ``pip``.\nThe following are supported:\n\n* requirement specifiers, per `PEP 508`_\n* Comments, prefixed with a ``#``.\n* ``--<option>`` options, both on their own line and after a requirement specifier.\n  Note however that the options themselves are ignored.\n\nThe following are unsupported within ``requirements.txt`` files:\n\n* Editable install commands with the ``-e`` option,\n* References to other requirements or constraints files with the ``-r`` or ``-c`` options.\n* References to paths on the local filesystem, or URLs.\n\n**TL;DR**\nFor best compatibility, ensure all lines in your ``requirements.txt`` files\nare valid PEP 508 requirements, or comments starting with a ``#``.\n\n.. _format: https://pip.pypa.io/en/stable/reference/requirements-file-format/\n.. _PEP 508: https://peps.python.org/pep-0508/\n",
    "bugtrack_url": null,
    "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 the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Hatchling plugin to read project dependencies from requirements.txt",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://github.com/repo-helper/hatch-requirements-txt",
        "Issue Tracker": "https://github.com/repo-helper/hatch-requirements-txt/issues",
        "Source Code": "https://github.com/repo-helper/hatch-requirements-txt"
    },
    "split_keywords": [
        "dependencies",
        "hatch",
        "requirements"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98a39a71667d284dff0e5d1c95b99b2383bbfcfc120843209522f8054055c0bb",
                "md5": "60ccd367bf00e9f29c847b8dc9c51732",
                "sha256": "13c6ab7707cbc0aba128b3626dacae4be7065f1dbafc792461c9f547b3c3ffde"
            },
            "downloads": -1,
            "filename": "hatch_requirements_txt-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "60ccd367bf00e9f29c847b8dc9c51732",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6.1",
            "size": 7769,
            "upload_time": "2024-01-24T21:47:19",
            "upload_time_iso_8601": "2024-01-24T21:47:19.246606Z",
            "url": "https://files.pythonhosted.org/packages/98/a3/9a71667d284dff0e5d1c95b99b2383bbfcfc120843209522f8054055c0bb/hatch_requirements_txt-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c043703d3caa354fd7148a5453724de70577a6010234d1e1f3ff6b98a4d3242",
                "md5": "bb741f92af054815f851f0d9333dd51b",
                "sha256": "2c686e5758fd05bb55fa7d0c198fdd481f8d3aaa3c693260f5c0d74ce3547d20"
            },
            "downloads": -1,
            "filename": "hatch_requirements_txt-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bb741f92af054815f851f0d9333dd51b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.1",
            "size": 6454,
            "upload_time": "2024-01-24T21:47:22",
            "upload_time_iso_8601": "2024-01-24T21:47:22.676656Z",
            "url": "https://files.pythonhosted.org/packages/7c/04/3703d3caa354fd7148a5453724de70577a6010234d1e1f3ff6b98a4d3242/hatch_requirements_txt-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-24 21:47:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "repo-helper",
    "github_project": "hatch-requirements-txt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "hatchling",
            "specs": [
                [
                    ">=",
                    "0.21.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    ">=",
                    "21.3"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "hatch-requirements-txt"
}
        
Elapsed time: 1.73170s