git: 881aa4620e8e - main - devel/py-hatch-vcs: Add py-hatch-vcs 0.2.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Wed, 31 Aug 2022 11:42:23 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=881aa4620e8eb05d89d57841d8fb633ec5738af7

commit 881aa4620e8eb05d89d57841d8fb633ec5738af7
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-08-31 11:21:10 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-08-31 11:40:48 +0000

    devel/py-hatch-vcs: Add py-hatch-vcs 0.2.0
    
    hatch-vcs provides a plugin for Hatch that uses your preferred version control
    system (like Git) to determine project versions.
    
    WWW: https://github.com/ofek/hatch-vcs
---
 devel/Makefile                    |  1 +
 devel/py-hatch-vcs/Makefile       | 26 ++++++++++++++++++++++++++
 devel/py-hatch-vcs/distinfo       |  3 +++
 devel/py-hatch-vcs/files/setup.py | 34 ++++++++++++++++++++++++++++++++++
 devel/py-hatch-vcs/pkg-descr      |  4 ++++
 5 files changed, 68 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 6520f15b0288..4eaca442b651 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4598,6 +4598,7 @@
     SUBDIR += py-gyp
     SUBDIR += py-hash_ring
     SUBDIR += py-hatch
+    SUBDIR += py-hatch-vcs
     SUBDIR += py-hatchling
     SUBDIR += py-heapdict
     SUBDIR += py-helpdev
diff --git a/devel/py-hatch-vcs/Makefile b/devel/py-hatch-vcs/Makefile
new file mode 100644
index 000000000000..555a5ceb0658
--- /dev/null
+++ b/devel/py-hatch-vcs/Makefile
@@ -0,0 +1,26 @@
+PORTNAME=	hatch-vcs
+PORTVERSION=	0.2.0
+CATEGORIES=	devel python
+MASTER_SITES=	CHEESESHOP
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	hatch_vcs-${PORTVERSION}
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Hatch plugin for versioning with your preferred VCS
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hatchling>=0.21.0:devel/py-hatchling@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools_scm>=6.4.0:devel/py-setuptools_scm@${PY_FLAVOR}
+
+USES=		python:3.7+
+USE_PYTHON=	autoplist concurrent distutils
+
+NO_ARCH=	yes
+
+post-patch:
+	@${RM} ${WRKSRC}/pyproject.toml
+	@${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
+
+.include <bsd.port.mk>
diff --git a/devel/py-hatch-vcs/distinfo b/devel/py-hatch-vcs/distinfo
new file mode 100644
index 000000000000..32ecd222273f
--- /dev/null
+++ b/devel/py-hatch-vcs/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1661599113
+SHA256 (hatch_vcs-0.2.0.tar.gz) = 9913d733b34eec9bb0345d0626ca32165a4ad2de15d1ce643c36d09ca908abff
+SIZE (hatch_vcs-0.2.0.tar.gz) = 9321
diff --git a/devel/py-hatch-vcs/files/setup.py b/devel/py-hatch-vcs/files/setup.py
new file mode 100644
index 000000000000..65c2ddb0e1d3
--- /dev/null
+++ b/devel/py-hatch-vcs/files/setup.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+from setuptools import setup
+
+setup(
+    name='hatch-vcs',
+    version='%%PORTVERSION%%',
+    description='Hatch plugin for versioning with your preferred VCS',
+    long_description='# hatch-vcs\n\n| | |\n| --- | --- |\n| CI/CD | [![CI - Test](https://github.com/ofek/hatch-vcs/actions/workflows/test.yml/badge.svg)](https://github.com/ofek/hatch-vcs/actions/workflows/test.yml) [![CD - Build](https://github.com/ofek/hatch-vcs/actions/workflows/build.yml/badge.svg)](https://github.com/ofek/hatch-vcs/actions/workflows/build.yml) |\n| Package | [![PyPI - Version](https://img.shields.io/pypi/v/hatch-vcs.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/hatch-vcs/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch-vcs.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/hatch-vcs/) |\n| Meta | [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![types - Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](https://github.com/ambv/black) [![imports - isort](https://img.shields.io/badge/imports-isort-ef8336.svg)](https://github.
 com/pycqa/isort) [![License - MIT](https://img.shields.io/badge/license-MIT-9400d3.svg)](https://spdx.org/licenses/) [![GitHub Sponsors](https://img.shields.io/github/sponsors/ofek?logo=GitHub%20Sponsors&style=social)](https://github.com/sponsors/ofek) |\n\n-----\n\nThis provides a plugin for [Hatch](https://github.com/ofek/hatch) that uses your preferred version control system (like Git) to determine project versions.\n\n**Table of Contents**\n\n- [Global dependency](#global-dependency)\n- [Version source](#version-source)\n  - [Version source options](#version-source-options)\n- [Build hook](#build-hook)\n  - [Build hook options](#build-hook-options)\n- [License](#license)\n\n## Global dependency\n\nEnsure `hatch-vcs` is defined within the `build-system.requires` field in your `pyproject.toml` file.\n\n```toml\n[build-system]\nrequires = ["hatchling", "hatch-vcs"]\nbuild-backend = "hatchling.build"\n```\n\n## Version source\n\nThe [version source plugin](https://ofek.dev/hatch/lat
 est/plugins/version-source/) name is `vcs`.\!
 n\n- ***pyproject.toml***\n\n    ```toml\n    [tool.hatch.version]\n    source = "vcs"\n    ```\n\n- ***hatch.toml***\n\n    ```toml\n    [version]\n    source = "vcs"\n    ```\n\n### Version source options\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `tag-pattern` | `str` | see [code](https://github.com/pypa/setuptools_scm/blob/v6.4.0/src/setuptools_scm/config.py#L13) | A regular expression used to extract the version part from VCS tags. The pattern needs to contain either a single match group, or a group named `version`, that captures the actual version information. |\n| `fallback-version` | `str` | | The version that will be used if no other method for detecting the version is successful. If not specified, unsuccessful version detection will raise an error. |\n| `raw-options` | `dict` | | A table of [`setuptools-scm` parameters](https://github.com/pypa/setuptools_scm#configuration-parameters) that will override any of the options listed above. The `w
 rite_to` and `write_to_template` parameters are ignored. |\n\n## Build hook\n\nThe [build hook plugin](https://ofek.dev/hatch/latest/plugins/build-hook/) name is `vcs`.\n\n- ***pyproject.toml***\n\n    ```toml\n    [tool.hatch.build.hooks.vcs]\n    ```\n\n- ***hatch.toml***\n\n    ```toml\n    [build.hooks.vcs]\n    ```\n\n### Build hook options\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `version-file` | `str` | ***REQUIRED*** | The relative path to the file that gets updated with the current version. |\n| `template` | `str` | | The template used to overwrite the `version-file`. See the [code](https://github.com/pypa/setuptools_scm/blob/v6.4.0/src/setuptools_scm/__init__.py#L30-L39) for the default template for each file extension. |\n\n## License\n\n`hatch-vcs` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n',
+    author_email='Ofek Lev <oss@ofek.dev>',
+    classifiers=[
+        'Development Status :: 4 - Beta',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3.7',
+        'Programming Language :: Python :: 3.8',
+        'Programming Language :: Python :: 3.9',
+        'Programming Language :: Python :: 3.10',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Programming Language :: Python :: Implementation :: PyPy',
+    ],
+    install_requires=[
+        'hatchling>=0.21.0',
+        'setuptools-scm<6; python_version < "3"',
+        'setuptools-scm>=6.4.0; python_version > "3"',
+    ],
+    entry_points={
+        'hatch': [
+            'vcs = hatch_vcs.hooks',
+        ],
+    },
+    packages=[
+        'hatch_vcs',
+    ],
+)
diff --git a/devel/py-hatch-vcs/pkg-descr b/devel/py-hatch-vcs/pkg-descr
new file mode 100644
index 000000000000..d10b5b1565b2
--- /dev/null
+++ b/devel/py-hatch-vcs/pkg-descr
@@ -0,0 +1,4 @@
+hatch-vcs provides a plugin for Hatch that uses your preferred version control
+system (like Git) to determine project versions.
+
+WWW: https://github.com/ofek/hatch-vcs