diff options
author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2024-04-05 23:56:50 +0000 |
---|---|---|
committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2024-04-05 23:56:50 +0000 |
commit | 006a0833a75cdd489bc8c37208ecf046079b620c (patch) | |
tree | caf2de421d37a6ec09ba3ac79ece80fd6f2f2dfc | |
parent | 8c6ce7c55e8ee65794994c00d280b1329e2b6848 (diff) | |
download | ports-006a0833a75cdd489bc8c37208ecf046079b620c.tar.gz ports-006a0833a75cdd489bc8c37208ecf046079b620c.zip |
devel/py-ufmt: Add py-ufmt 2.5.1
ufmt is a safe, atomic code formatter for Python built on top of black and
usort:
- Black makes code review faster by producing the smallest diffs possible.
Blackened code looks the same regardless of the project you're reading.
- usort is a safe, minimal import sorter. Its primary goal is to make no
"dangerous" changes to code, and to make no changes on code style.
ufmt formats files in-memory, first with usort and then with black, before
writing any changes back to disk. This enables a combined, atomic step in CI/CD
workflows for checking or formatting files, without any chance of conflict or
intermediate changes between the import sorter and the code formatter.
-rw-r--r-- | devel/Makefile | 1 | ||||
-rw-r--r-- | devel/py-ufmt/Makefile | 30 | ||||
-rw-r--r-- | devel/py-ufmt/distinfo | 3 | ||||
-rw-r--r-- | devel/py-ufmt/pkg-descr | 11 |
4 files changed, 45 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index f6d0eab7026d..5a9c4677c89a 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5825,6 +5825,7 @@ SUBDIR += py-u-msgpack-python SUBDIR += py-ua_parser SUBDIR += py-ubelt + SUBDIR += py-ufmt SUBDIR += py-uhid-freebsd SUBDIR += py-ujson SUBDIR += py-undefined diff --git a/devel/py-ufmt/Makefile b/devel/py-ufmt/Makefile new file mode 100644 index 000000000000..57c28f9e0945 --- /dev/null +++ b/devel/py-ufmt/Makefile @@ -0,0 +1,30 @@ +PORTNAME= ufmt +PORTVERSION= 2.5.1 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Safe, atomic formatting with black and usort +WWW= https://ufmt.omnilib.dev/en/stable/ \ + https://github.com/omnilib/ufmt + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flit-core>=3.8<4:devel/py-flit-core@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}black>=20.8b0:devel/py-black@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}click>=8.0:devel/py-click@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}libcst>=0.4.0:devel/py-libcst@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}moreorless>=0.4.0:devel/py-moreorless@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}tomlkit>=0.7.2:textproc/py-tomlkit@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}trailrunner>=1.2.1:devel/py-trailrunner@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.0:devel/py-typing-extensions@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}usort>=1.0:devel/py-usort@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist concurrent pep517 + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-ufmt/distinfo b/devel/py-ufmt/distinfo new file mode 100644 index 000000000000..9ffdafca832f --- /dev/null +++ b/devel/py-ufmt/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1712330561 +SHA256 (ufmt-2.5.1.tar.gz) = af53400cbc0498d5d57f79bdf8c0e13df67f384ab38ab9881b15e4ceb04c5d64 +SIZE (ufmt-2.5.1.tar.gz) = 75447 diff --git a/devel/py-ufmt/pkg-descr b/devel/py-ufmt/pkg-descr new file mode 100644 index 000000000000..e46e8c99db8d --- /dev/null +++ b/devel/py-ufmt/pkg-descr @@ -0,0 +1,11 @@ +ufmt is a safe, atomic code formatter for Python built on top of black and +usort: +- Black makes code review faster by producing the smallest diffs possible. + Blackened code looks the same regardless of the project you're reading. +- usort is a safe, minimal import sorter. Its primary goal is to make no + "dangerous" changes to code, and to make no changes on code style. + +ufmt formats files in-memory, first with usort and then with black, before +writing any changes back to disk. This enables a combined, atomic step in CI/CD +workflows for checking or formatting files, without any chance of conflict or +intermediate changes between the import sorter and the code formatter. |