# cv
[![PyPI](https://img.shields.io/pypi/v/cv)][pypi]
[![Downloads](https://img.shields.io/pypi/dm/cv)][pypi]
[![Build Status](https://img.shields.io/azure-devops/build/misha-drachuk/cv/9)](https://dev.azure.com/misha-drachuk/cv/_build/latest?definitionId=9&branchName=master)
[![Test Coverage](https://img.shields.io/coveralls/github/mdrachuk/cv/master)](https://coveralls.io/github/mdrachuk/cv)
[![Supported Python](https://img.shields.io/pypi/pyversions/cv)][pypi]
Check version of a Python module.
Raises an error if the `<module>.__version__`:
- already present on PyPI or custom warehouse deployment;
- does not match [PEP 440](https://www.python.org/dev/peps/pep-0440);
- or does not match specified type: alpha/beta/rc/dev/release.
All of this comes in handy during CI.
And one more thing: No runtime dependencies!
## Installation
Available from [PyPI][pypi]:
```shell
pip install cv
```
## Module Example
With a \<module\> present on PyPI and `<module>.py` in current directory:
```python
__version__ = '7.7.7'
...
```
Simply run:
```shell
cv <module>
```
If `7.7.7` version of \<module\> is on PyPI already you’ll get a `VersionExists` error:
```plain
__main__.VersionExists: Package "<module>" with version "7.7.7" already exists on PyPI.
Change the "<module>.__version__" to fix this error.
```
## Package Example
Packages work in the same way as modules except `__version__` is defined in `<module>/__init__.py`
## Help
```plain
$ cv --help
usage: cv [-h] [-w WAREHOUSE] [--alpha] [--beta] [--rc] [--dev] [--release]
[--dry]
module
Check version of a Python package or module.
positional arguments:
module the package/module with "__version__" defined
optional arguments:
-h, --help show this help message and exit
-w WAREHOUSE, --warehouse WAREHOUSE
package index to use, default is
"https://pypi.org/pypi"
--alpha check that version is an alpha, e.g. 1.0.0a1
--beta check that version is a beta, e.g. 1.0.0b2
--rc check that version is a release candidate, e.g.
1.0.0rc
--dev check that version is in development, e.g. 1.0.0.dev3
--release check that version is a release without modifiers,
e.g. 1.0.0
--dry make no request to PyPI
```
[pypi]: https://pypi.org/project/cv/
Raw data
{
"_id": null,
"home_page": "https://github.com/mdrachuk/cv",
"name": "cv",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "python packaging version pypi ci",
"author": "mdrachuk",
"author_email": "misha@drach.uk",
"download_url": "https://files.pythonhosted.org/packages/68/0e/439bf70a0d11b426223a408ee2e5abd8706d9deec32850645c4154ff7de3/cv-1.0.0.tar.gz",
"platform": "",
"description": "# cv\n[![PyPI](https://img.shields.io/pypi/v/cv)][pypi]\n[![Downloads](https://img.shields.io/pypi/dm/cv)][pypi]\n[![Build Status](https://img.shields.io/azure-devops/build/misha-drachuk/cv/9)](https://dev.azure.com/misha-drachuk/cv/_build/latest?definitionId=9&branchName=master)\n[![Test Coverage](https://img.shields.io/coveralls/github/mdrachuk/cv/master)](https://coveralls.io/github/mdrachuk/cv)\n[![Supported Python](https://img.shields.io/pypi/pyversions/cv)][pypi]\n\nCheck version of a Python module.\n\nRaises an error if the `<module>.__version__`:\n- already present on PyPI or custom warehouse deployment; \n- does not match [PEP 440](https://www.python.org/dev/peps/pep-0440);\n- or does not match specified type: alpha/beta/rc/dev/release.\n\nAll of this comes in handy during CI.\n\nAnd one more thing: No runtime dependencies!\n\n## Installation\nAvailable from [PyPI][pypi]:\n```shell\npip install cv\n```\n\n## Module Example\nWith a \\<module\\> present on PyPI and `<module>.py` in current directory:\n```python\n__version__ = '7.7.7'\n\n...\n```\n\nSimply run:\n```shell\ncv <module>\n```\n\nIf `7.7.7` version of \\<module\\> is on PyPI already you\u2019ll get a `VersionExists` error:\n```plain\n__main__.VersionExists: Package \"<module>\" with version \"7.7.7\" already exists on PyPI.\nChange the \"<module>.__version__\" to fix this error.\n```\n\n## Package Example\nPackages work in the same way as modules except `__version__` is defined in `<module>/__init__.py`\n\n\n## Help\n```plain\n$ cv --help\nusage: cv [-h] [-w WAREHOUSE] [--alpha] [--beta] [--rc] [--dev] [--release]\n [--dry]\n module\n\nCheck version of a Python package or module.\n\npositional arguments:\n module the package/module with \"__version__\" defined\n\noptional arguments:\n -h, --help show this help message and exit\n -w WAREHOUSE, --warehouse WAREHOUSE\n package index to use, default is\n \"https://pypi.org/pypi\"\n --alpha check that version is an alpha, e.g. 1.0.0a1\n --beta check that version is a beta, e.g. 1.0.0b2\n --rc check that version is a release candidate, e.g.\n 1.0.0rc\n --dev check that version is in development, e.g. 1.0.0.dev3\n --release check that version is a release without modifiers,\n e.g. 1.0.0\n --dry make no request to PyPI\n```\n\n[pypi]: https://pypi.org/project/cv/\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Check version of a Python module",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/mdrachuk/cv",
"Issues": "https://github.com/mdrachuk/cv/issues",
"Pipelines": "https://dev.azure.com/misha-drachuk/cv",
"Source": "https://github.com/mdrachuk/cv/"
},
"split_keywords": [
"python",
"packaging",
"version",
"pypi",
"ci"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9796a62c28bdfd73c6d2e3833c6cabc04a6a2f17e5a10c586ca7aa1cb9be2a93",
"md5": "e0d6c45d3c83c1d310aa8d2cd540926e",
"sha256": "27595b9f136040a745f4626c40075dadf332c0e99a6e9728f9a237be26b8c30b"
},
"downloads": -1,
"filename": "cv-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e0d6c45d3c83c1d310aa8d2cd540926e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7309,
"upload_time": "2019-09-19T16:32:26",
"upload_time_iso_8601": "2019-09-19T16:32:26.886780Z",
"url": "https://files.pythonhosted.org/packages/97/96/a62c28bdfd73c6d2e3833c6cabc04a6a2f17e5a10c586ca7aa1cb9be2a93/cv-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "680e439bf70a0d11b426223a408ee2e5abd8706d9deec32850645c4154ff7de3",
"md5": "79be1fee1ddd5eea3823b0bdbdde2dcb",
"sha256": "71a358ea3ce4cd84bc3286354bd7e88040fb9e0fdfef1aee848523660f0f79bf"
},
"downloads": -1,
"filename": "cv-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "79be1fee1ddd5eea3823b0bdbdde2dcb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4404,
"upload_time": "2019-09-19T16:32:28",
"upload_time_iso_8601": "2019-09-19T16:32:28.390005Z",
"url": "https://files.pythonhosted.org/packages/68/0e/439bf70a0d11b426223a408ee2e5abd8706d9deec32850645c4154ff7de3/cv-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-09-19 16:32:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mdrachuk",
"github_project": "cv",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "coveralls",
"specs": [
[
"==",
"1.8.2"
]
]
},
{
"name": "mypy",
"specs": [
[
"==",
"0.720"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"4.4.1"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"2.6.1"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"1.13.0"
]
]
},
{
"name": "wheel",
"specs": [
[
"==",
"0.33.6"
]
]
}
],
"lcname": "cv"
}