diff options
| author | Yuri Victorovich <yuri@FreeBSD.org> | 2026-04-07 04:24:17 +0000 |
|---|---|---|
| committer | Yuri Victorovich <yuri@FreeBSD.org> | 2026-04-07 09:58:08 +0000 |
| commit | 85fbf348e3ef734661a3b37f2e298dd120ab9911 (patch) | |
| tree | 328a22cf92abedd370934c1b4b46b8f8c60f1a33 | |
| parent | 7ce0b2427487e2b22c11638153e2ab8d4a0f7abc (diff) | |
devel/py-depyf: New port: Decompile and understand Python bytecode from PyTorch
| -rw-r--r-- | devel/Makefile | 1 | ||||
| -rw-r--r-- | devel/py-depyf/Makefile | 30 | ||||
| -rw-r--r-- | devel/py-depyf/distinfo | 3 | ||||
| -rw-r--r-- | devel/py-depyf/files/patch-setup.py | 11 | ||||
| -rw-r--r-- | devel/py-depyf/pkg-descr | 3 |
5 files changed, 48 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index 82e8c23bab20..f75c2116cb44 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4849,6 +4849,7 @@ SUBDIR += py-deprecated SUBDIR += py-deprecation SUBDIR += py-deptry + SUBDIR += py-depyf SUBDIR += py-devtools SUBDIR += py-dexml2 SUBDIR += py-diagnostic diff --git a/devel/py-depyf/Makefile b/devel/py-depyf/Makefile new file mode 100644 index 000000000000..a18bf2eba140 --- /dev/null +++ b/devel/py-depyf/Makefile @@ -0,0 +1,30 @@ +PORTNAME= depyf +DISTVERSION= 0.20.0 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Decompile and understand Python bytecode from PyTorch +WWW= https://github.com/thuml/depyf + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}astor>0:devel/py-astor@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}dill>0:devel/py-dill@${PY_FLAVOR} + +USES= python +USE_PYTHON= pep517 autoplist pytest + +NO_ARCH= yes + +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} \ + PYTHONBREAKPOINT=0 +TEST_WRKSRC= ${WRKSRC}/tests + +# tests as of 0.20.0: 1 passed, 21 warnings in 5.66s + +.include <bsd.port.mk> diff --git a/devel/py-depyf/distinfo b/devel/py-depyf/distinfo new file mode 100644 index 000000000000..428500173330 --- /dev/null +++ b/devel/py-depyf/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1775500352 +SHA256 (depyf-0.20.0.tar.gz) = fb7683bd72c44f67b56029df2c47721e9a02ffa4d7b19095f1c54c4ebf797a98 +SIZE (depyf-0.20.0.tar.gz) = 6168761 diff --git a/devel/py-depyf/files/patch-setup.py b/devel/py-depyf/files/patch-setup.py new file mode 100644 index 000000000000..204e76a40f2f --- /dev/null +++ b/devel/py-depyf/files/patch-setup.py @@ -0,0 +1,11 @@ +--- setup.py.orig 2026-04-06 19:13:32 UTC ++++ setup.py +@@ -11,7 +11,7 @@ def get_git_commit_id(n_digits=8) -> Optional[str]: + # Decode bytes to string (Python 3.x) + commit_id = commit_id.decode('utf-8') + return commit_id[:n_digits] +- except subprocess.CalledProcessError as e: ++ except (subprocess.CalledProcessError, FileNotFoundError, OSError) as e: + print("Failed to get Git commit ID:", e) + return None + diff --git a/devel/py-depyf/pkg-descr b/devel/py-depyf/pkg-descr new file mode 100644 index 000000000000..399903617e26 --- /dev/null +++ b/devel/py-depyf/pkg-descr @@ -0,0 +1,3 @@ +depyf is a Python package for decompiling and understanding Python bytecode. +It helps developers analyze and debug compiled Python code by providing +human-readable representations of bytecode. |
