Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Apr 2024 00:01:17 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 006a0833a75c - main - devel/py-ufmt: Add py-ufmt 2.5.1
Message-ID:  <202404060001.43601H7i072399@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=006a0833a75cdd489bc8c37208ecf046079b620c

commit 006a0833a75cdd489bc8c37208ecf046079b620c
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-04-05 23:56:50 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-04-05 23:56:50 +0000

    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.
---
 devel/Makefile          |  1 +
 devel/py-ufmt/Makefile  | 30 ++++++++++++++++++++++++++++++
 devel/py-ufmt/distinfo  |  3 +++
 devel/py-ufmt/pkg-descr | 11 +++++++++++
 4 files changed, 45 insertions(+)

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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404060001.43601H7i072399>