# dependence
[![test](https://github.com/enorganic/dependence/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/enorganic/dependence/actions/workflows/test.yml)
[![distribute](https://github.com/enorganic/dependence/actions/workflows/distribute.yml/badge.svg?branch=main)](https://github.com/enorganic/dependence/actions/workflows/distribute.yml)
This project provides a Command Line Interface and library for inspecting
and updating python project dependency versions in setup.cfg, pyproject.toml,
and requirements.txt files.
## Installation
You can install `dependence` with pip:
```shell
pip3 install dependence
```
## Usage
### Command Line Interface
```console
$ dependence -h
Usage:
dependence <command> [options]
Commands:
update Update requirement versions in the specified
files to align with currently installed versions
of each distribution
freeze Print dependencies inferred from an installed
distribution or project, in a similar format
to the output of `pip freeze`.
```
#### dependence update
This command will update version specifiers for
all package requirements in your setup.cfg, pyproject.toml, tox.ini,
or requirements.txt files to match currently installed versions of each
distribution (matching the existing granularity, and only for *inclusive*
specifiers—so where the comparator is "~=", "==", ">=", or "<=", but not where
the comparator is ">", "<", or "!=").
```console
$ dependence update -h
usage: dependence update [-h] [-i IGNORE] [-aen ALL_EXTRA_NAME]
path [path ...]
Update requirement versions in the specified files to align with currently
installed versions of each distribution.
positional arguments:
path One or more local paths to a setup.cfg,
setup.cfg, and/or requirements.txt file
optional arguments:
-h, --help show this help message and exit
-i IGNORE, --ignore IGNORE
A comma-separated list of distributions to ignore
(leave any requirements pertaining to the package
as-is)
-aen ALL_EXTRA_NAME, --all-extra-name ALL_EXTRA_NAME
If provided, an extra which consolidates the
requirements for all other extras will be
added/updated to setup.cfg or setup.cfg
(this argument is ignored for requirements.txt
files)
```
Example:
```shell script
dependence update -aen all setup.cfg pyproject.toml tox.ini
```
#### dependence freeze
```console
$ dependence freeze -h
usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE]
[-nv NO_VERSION] [-do] [--reverse]
requirement [requirement ...]
This command prints dependencies inferred from an installed
distribution or project, in a similar format to the output of `pip
freeze`, except that all generated requirements are specified in the
format "distribution-name==0.0.0" (including for editable
installations). Using this command instead of `pip freeze` to generate
requirement files ensures that you don't bloat your requirements files
with superfluous distributions. The default sorting starts with
directly specified requirements, followed by recursively discovered
requirements, in the order of discovery.
positional arguments:
requirement One or more requirement specifiers (for
example: "requirement-name", "requirement-
name[extra-a,extra-b]", ".[extra-a, extra-b]"
or "../other-editable-package-
directory[extra-a, extra-b]) and/or paths to a
setup.py, setup.cfg, pyproject.toml, tox.ini or
requirements.txt file
optional arguments:
-h, --help show this help message and exit
-e EXCLUDE, --exclude EXCLUDE
A distribution (or comma-separated list of
distributions) to exclude from the output
-er EXCLUDE_RECURSIVE, --exclude-recursive EXCLUDE_RECURSIVE
A distribution (or comma-separated list of
distributions) to exclude from the output.
Unlike -e / --exclude, this argument also
precludes recursive requirement discovery for
the specified packages, thereby excluding all
of the excluded package's requirements which
are not required by another (non-excluded)
distribution.
-nv NO_VERSION, --no-version NO_VERSION
Don't include versions (only output
distribution names) for packages matching
this/these glob pattern(s) (note: the value
must be single-quoted if it contains wildcards)
-do, --dependency-order
Sort requirements so that dependents precede
dependencies
--reverse Print requirements in reverse order
```
Raw data
{
"_id": null,
"home_page": "https://github.com/enorganic/dependence",
"name": "dependence",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": "requirements, dependencies",
"author": null,
"author_email": "david@belais.me",
"download_url": "https://files.pythonhosted.org/packages/f6/22/3d4b56f07bb082bdba02196acc028bb45b65e64fd8fbe830876aeba935c5/dependence-0.1.0.tar.gz",
"platform": null,
"description": "# dependence\n\n[![test](https://github.com/enorganic/dependence/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/enorganic/dependence/actions/workflows/test.yml)\n[![distribute](https://github.com/enorganic/dependence/actions/workflows/distribute.yml/badge.svg?branch=main)](https://github.com/enorganic/dependence/actions/workflows/distribute.yml)\n\nThis project provides a Command Line Interface and library for inspecting\nand updating python project dependency versions in setup.cfg, pyproject.toml,\nand requirements.txt files.\n\n## Installation\n\nYou can install `dependence` with pip:\n\n```shell\npip3 install dependence\n```\n\n## Usage\n\n### Command Line Interface\n\n```console\n$ dependence -h\nUsage:\n dependence <command> [options]\n\nCommands:\n update Update requirement versions in the specified\n files to align with currently installed versions\n of each distribution\n freeze Print dependencies inferred from an installed\n distribution or project, in a similar format\n to the output of `pip freeze`.\n```\n\n#### dependence update\n\nThis command will update version specifiers for\nall package requirements in your setup.cfg, pyproject.toml, tox.ini,\nor requirements.txt files to match currently installed versions of each\ndistribution (matching the existing granularity, and only for *inclusive*\nspecifiers\u2014so where the comparator is \"~=\", \"==\", \">=\", or \"<=\", but not where\nthe comparator is \">\", \"<\", or \"!=\").\n\n```console\n$ dependence update -h\nusage: dependence update [-h] [-i IGNORE] [-aen ALL_EXTRA_NAME]\n path [path ...]\n\nUpdate requirement versions in the specified files to align with currently\ninstalled versions of each distribution.\n\npositional arguments:\n path One or more local paths to a setup.cfg,\n setup.cfg, and/or requirements.txt file\n\noptional arguments:\n -h, --help show this help message and exit\n -i IGNORE, --ignore IGNORE\n A comma-separated list of distributions to ignore\n (leave any requirements pertaining to the package\n as-is)\n -aen ALL_EXTRA_NAME, --all-extra-name ALL_EXTRA_NAME\n If provided, an extra which consolidates the\n requirements for all other extras will be\n added/updated to setup.cfg or setup.cfg\n (this argument is ignored for requirements.txt\n files)\n```\n\nExample:\n\n```shell script\ndependence update -aen all setup.cfg pyproject.toml tox.ini\n```\n\n#### dependence freeze\n\n```console\n$ dependence freeze -h\nusage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE]\n [-nv NO_VERSION] [-do] [--reverse]\n requirement [requirement ...]\n\nThis command prints dependencies inferred from an installed\ndistribution or project, in a similar format to the output of `pip\nfreeze`, except that all generated requirements are specified in the\nformat \"distribution-name==0.0.0\" (including for editable\ninstallations). Using this command instead of `pip freeze` to generate\nrequirement files ensures that you don't bloat your requirements files\nwith superfluous distributions. The default sorting starts with\ndirectly specified requirements, followed by recursively discovered\nrequirements, in the order of discovery.\n\npositional arguments:\n requirement One or more requirement specifiers (for\n example: \"requirement-name\", \"requirement-\n name[extra-a,extra-b]\", \".[extra-a, extra-b]\"\n or \"../other-editable-package-\n directory[extra-a, extra-b]) and/or paths to a\n setup.py, setup.cfg, pyproject.toml, tox.ini or\n requirements.txt file\n\noptional arguments:\n -h, --help show this help message and exit\n -e EXCLUDE, --exclude EXCLUDE\n A distribution (or comma-separated list of\n distributions) to exclude from the output\n -er EXCLUDE_RECURSIVE, --exclude-recursive EXCLUDE_RECURSIVE\n A distribution (or comma-separated list of\n distributions) to exclude from the output.\n Unlike -e / --exclude, this argument also\n precludes recursive requirement discovery for\n the specified packages, thereby excluding all\n of the excluded package's requirements which\n are not required by another (non-excluded)\n distribution.\n -nv NO_VERSION, --no-version NO_VERSION\n Don't include versions (only output\n distribution names) for packages matching\n this/these glob pattern(s) (note: the value\n must be single-quoted if it contains wildcards)\n -do, --dependency-order\n Sort requirements so that dependents precede\n dependencies\n --reverse Print requirements in reverse order\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Requirement (dependency) management for python projects",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/enorganic/dependence"
},
"split_keywords": [
"requirements",
" dependencies"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f8845ca733db77032e8db9036decd3c73d9ff24f40dea7c37589be104d6ec53d",
"md5": "6890f43b487ad6a1f4829230e062433f",
"sha256": "fb90f94640b23ecf47dc03fb11e481cc057e7834a85680669d3bf0aad86c0576"
},
"downloads": -1,
"filename": "dependence-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6890f43b487ad6a1f4829230e062433f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 18992,
"upload_time": "2024-04-17T20:34:52",
"upload_time_iso_8601": "2024-04-17T20:34:52.819663Z",
"url": "https://files.pythonhosted.org/packages/f8/84/5ca733db77032e8db9036decd3c73d9ff24f40dea7c37589be104d6ec53d/dependence-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f6223d4b56f07bb082bdba02196acc028bb45b65e64fd8fbe830876aeba935c5",
"md5": "58dcfbdc5351f452b2a72fad5992bace",
"sha256": "91f15bd5c26d1e5bc091e9c3ce0a231f802ab21019ea0caf93e59e193f69526f"
},
"downloads": -1,
"filename": "dependence-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "58dcfbdc5351f452b2a72fad5992bace",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 19561,
"upload_time": "2024-04-17T20:34:53",
"upload_time_iso_8601": "2024-04-17T20:34:53.866874Z",
"url": "https://files.pythonhosted.org/packages/f6/22/3d4b56f07bb082bdba02196acc028bb45b65e64fd8fbe830876aeba935c5/dependence-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-17 20:34:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "enorganic",
"github_project": "dependence",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "dependence"
}