hatch-dependency-coversion


Namehatch-dependency-coversion JSON
Version 0.0.0.dev0 PyPI version JSON
download
home_page
SummaryRequire that specific dependencies of your package are exactly coversioned.
upload_time2024-02-26 22:48:01
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords coversioning hatch monorepo version
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # hatch-dependency-coversion

[![PyPI - Version](https://img.shields.io/pypi/v/hatch-dependency-coversion.svg)](https://pypi.org/project/hatch-dependency-coversion)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch-dependency-coversion.svg)](https://pypi.org/project/hatch-dependency-coversion)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

-----

This is a plugin for [Hatch](https://github.com/pypa/hatch) that allows you to rewrite the versions in selected dependency specifiers to be exactly the same as the current version of the project configured in `pyproject.toml`'s `[project]` table, requiring exact coversioning of those dependencies with the project.

This is useful for projects that are developed in lockstep but distributed as independent python packages rather than as subcomponents of the same namespace package. It is the equivalent of the following `setup.py`:

``` python
VERSION = '1.0.0'
setup(name='my-project', version=VERSION, install_requires=[f'my-dependency=={VERSION}'])
```

Minimal configuration is done in your `pyproject.toml` like this:

``` toml
[build-system]
# Since this is a plugin for hatchling, you must be using hatchling as your build backend
requires = ["hatchling", "hatch-dependency-coversion"]
build-backend = "hatchling.build"

[project]
name = "my-project"
version = "0.1.0"
dependencies = [
    # 0.0.0 is chosen at random and will be overwritten
    "my-dependency==0.0.0"
]
[tool.hatch.metadata.hooks.dependency-coversion]
# this list contains the names of dependencies to override
override-versions-of = ["my-dependency"]
```

**Table of Contents**

- [Operation](#operation)
- [Use as a plugin](#plugin)
- [Configuration](#configuration)
- [License](#license)

## Operation

`hatch-dependency-coversion` is a metadata hook for `hatch`, or more specifically for `hatchling`, the PEP-508 build backend written by the `hatch` team. Whenever a package that uses `hatch-dependency-coversion` is built, `hatch-dependency-coversion` gets the chance to alter the list of dependencies the package will specify as required, and that `pip` and other installers or environment creators use to determine what dependencies to install.

Only those dependencies identified by name in the `tool.hatch.metadata.hooks.dependency-coversion.override-versions-of` list will have their versions overridden; nothing else will be touched.

Any PEP-440 version specifiers other than the version are left untouched; you can use `hatch-dependency-coversion` on dependencies that are optionally installed with markers (i.e. with `os_name == 'Windows'` or similar) and the markers will be preserved.


## Plugin

Ensure `hatch-dependency-coversion` is listed in the `build-system.requires` field in your `pyproject.toml`:

``` toml
[build-system]
requires = ["hatchling", "hatch-dependency-coversion"]
build-backend = "hatchling.build"
```

## Configuration

`hatch-dependency-coversion` is configured through `pyproject.toml` as a metadata hook in a similar way to other hatch plugins. Its plugin name is `dependency-coversion`:

``` toml
[tool.hatch.metadata.hooks.dependency-coversion]
override-versions-of = ["dependency1", "dependency2"]
```

The `override-versions-of` key is the only configuration that `hatch-dependency-coversion` takes. It is a list of strings, each of which should be the package name (the same thing you'd pass to `pip` or list in a dependency specifier) of one of the dependencies. Anything in here that is not in the top level `project.dependencies` key is ignored.

## License

`hatch-dependency-coversion` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hatch-dependency-coversion",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "coversioning,hatch,monorepo,version",
    "author": "",
    "author_email": "Opentrons Engineering <engineering@opentrons.com>",
    "download_url": "https://files.pythonhosted.org/packages/62/e3/853c5c07bac86736ae58bf24570cbe6877a7cdf6070b4b28120097dc5dca/hatch_dependency_coversion-0.0.0.dev0.tar.gz",
    "platform": null,
    "description": "# hatch-dependency-coversion\n\n[![PyPI - Version](https://img.shields.io/pypi/v/hatch-dependency-coversion.svg)](https://pypi.org/project/hatch-dependency-coversion)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch-dependency-coversion.svg)](https://pypi.org/project/hatch-dependency-coversion)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n\n-----\n\nThis is a plugin for [Hatch](https://github.com/pypa/hatch) that allows you to rewrite the versions in selected dependency specifiers to be exactly the same as the current version of the project configured in `pyproject.toml`'s `[project]` table, requiring exact coversioning of those dependencies with the project.\n\nThis is useful for projects that are developed in lockstep but distributed as independent python packages rather than as subcomponents of the same namespace package. It is the equivalent of the following `setup.py`:\n\n``` python\nVERSION = '1.0.0'\nsetup(name='my-project', version=VERSION, install_requires=[f'my-dependency=={VERSION}'])\n```\n\nMinimal configuration is done in your `pyproject.toml` like this:\n\n``` toml\n[build-system]\n# Since this is a plugin for hatchling, you must be using hatchling as your build backend\nrequires = [\"hatchling\", \"hatch-dependency-coversion\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"my-project\"\nversion = \"0.1.0\"\ndependencies = [\n    # 0.0.0 is chosen at random and will be overwritten\n    \"my-dependency==0.0.0\"\n]\n[tool.hatch.metadata.hooks.dependency-coversion]\n# this list contains the names of dependencies to override\noverride-versions-of = [\"my-dependency\"]\n```\n\n**Table of Contents**\n\n- [Operation](#operation)\n- [Use as a plugin](#plugin)\n- [Configuration](#configuration)\n- [License](#license)\n\n## Operation\n\n`hatch-dependency-coversion` is a metadata hook for `hatch`, or more specifically for `hatchling`, the PEP-508 build backend written by the `hatch` team. Whenever a package that uses `hatch-dependency-coversion` is built, `hatch-dependency-coversion` gets the chance to alter the list of dependencies the package will specify as required, and that `pip` and other installers or environment creators use to determine what dependencies to install.\n\nOnly those dependencies identified by name in the `tool.hatch.metadata.hooks.dependency-coversion.override-versions-of` list will have their versions overridden; nothing else will be touched.\n\nAny PEP-440 version specifiers other than the version are left untouched; you can use `hatch-dependency-coversion` on dependencies that are optionally installed with markers (i.e. with `os_name == 'Windows'` or similar) and the markers will be preserved.\n\n\n## Plugin\n\nEnsure `hatch-dependency-coversion` is listed in the `build-system.requires` field in your `pyproject.toml`:\n\n``` toml\n[build-system]\nrequires = [\"hatchling\", \"hatch-dependency-coversion\"]\nbuild-backend = \"hatchling.build\"\n```\n\n## Configuration\n\n`hatch-dependency-coversion` is configured through `pyproject.toml` as a metadata hook in a similar way to other hatch plugins. Its plugin name is `dependency-coversion`:\n\n``` toml\n[tool.hatch.metadata.hooks.dependency-coversion]\noverride-versions-of = [\"dependency1\", \"dependency2\"]\n```\n\nThe `override-versions-of` key is the only configuration that `hatch-dependency-coversion` takes. It is a list of strings, each of which should be the package name (the same thing you'd pass to `pip` or list in a dependency specifier) of one of the dependencies. Anything in here that is not in the top level `project.dependencies` key is ignored.\n\n## License\n\n`hatch-dependency-coversion` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Require that specific dependencies of your package are exactly coversioned.",
    "version": "0.0.0.dev0",
    "project_urls": {
        "Changelog": "https://github.com/Opentrons/hatch-plugins/tree/main/hatch-dependency-coversion/CHANGES.md",
        "Documentation": "https://github.com/Opentrons/hatch-plugins/tree/main/hatch-dependency-coversion#readme",
        "Issues": "https://github.com/Opentrons/hatch-plugins/issues",
        "Source": "https://github.com/Opentrons/hatch-plugins"
    },
    "split_keywords": [
        "coversioning",
        "hatch",
        "monorepo",
        "version"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c3fe2eb3efbb569732c84afc626fceccd025d673c5875f7995a1e8cc72c17bd6",
                "md5": "5e011f9ab0c5f37052101609d016feb5",
                "sha256": "1a47a2b243baf5e732d81e48112539f41102d20fc6e4725944741bc21f015360"
            },
            "downloads": -1,
            "filename": "hatch_dependency_coversion-0.0.0.dev0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e011f9ab0c5f37052101609d016feb5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9841,
            "upload_time": "2024-02-26T22:47:59",
            "upload_time_iso_8601": "2024-02-26T22:47:59.723846Z",
            "url": "https://files.pythonhosted.org/packages/c3/fe/2eb3efbb569732c84afc626fceccd025d673c5875f7995a1e8cc72c17bd6/hatch_dependency_coversion-0.0.0.dev0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "62e3853c5c07bac86736ae58bf24570cbe6877a7cdf6070b4b28120097dc5dca",
                "md5": "8ea38dff3f70d154c9b635a44b09806b",
                "sha256": "4ae75d9523f0449f0eea077766c878287e8f9442cde00f2bd4b05a254ae1103c"
            },
            "downloads": -1,
            "filename": "hatch_dependency_coversion-0.0.0.dev0.tar.gz",
            "has_sig": false,
            "md5_digest": "8ea38dff3f70d154c9b635a44b09806b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9518,
            "upload_time": "2024-02-26T22:48:01",
            "upload_time_iso_8601": "2024-02-26T22:48:01.418662Z",
            "url": "https://files.pythonhosted.org/packages/62/e3/853c5c07bac86736ae58bf24570cbe6877a7cdf6070b4b28120097dc5dca/hatch_dependency_coversion-0.0.0.dev0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-26 22:48:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Opentrons",
    "github_project": "hatch-plugins",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hatch-dependency-coversion"
}
        
Elapsed time: 0.18345s