From nobody Mon Oct 6 08:29:47 2025 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cgCB36Knfz6B2hX; Mon, 06 Oct 2025 08:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cgCB33MzJz3ZVx; Mon, 06 Oct 2025 08:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759739387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0HmpqxOH9EWP8StpeJeEtbYhpPRzeHT+I3brCj0lY7M=; b=TD0upVHaTul7KLAvNCkqjLmtKQdzaJzX+SxMMmNytXAaEMhx4abpHVHmwuFL4HLUJ6F4/b HYN0uQkuaHVNbxRDEL0edj0Zi34u7TBVYPLUAKhi7NHE48hBtJTozJyvLAxJ3m5+nGyiMB kSyhjsyFUqovC6qgcpL97jQTe+jrsCt9AJOgGTezcpKfTO1zUXm5mHXVO2Ko4BiDD/xGLp YJiH7SMlboa+DT0wAwesV7VWddlcqf4vqdO9Vdel2xcnNoKISdhD/GcWI6d3q1HoMdURBh i8nGGlbYeUk5o5eOavq8NSMddp/bCFOBDRSbIZXpokcR6jJJ9h0DV/W4f70g6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759739387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0HmpqxOH9EWP8StpeJeEtbYhpPRzeHT+I3brCj0lY7M=; b=VRgVZUnabmkaALaTmlB9UOlc0T/kvHD2U/U8Hm9fqmchyt21djTShEUGBqTt5vOFjq6g/A rhKN9f/cmLukDYqgPyXxqVjKKj/bDdH81UDwo+JtX+Ioq+9wuczGI33/g51G+8+79WsbRL eye9uiXBTfXtqdV1T/gkZgQjNzld3STSEY1+/fd5rra6XoyyXOSPHtwclGDtnTYEIF1Xep RLvdWOBQzsnF1feN7HTpzrM/+o9zNZ10mBbC7msEJvDlTnWxInv3+15cafwHhyWzGV+s+V TeiG9X/5kBU36qoPpVJaGwT78h4w5cA4YaVR6ZmDU6+ZavRG3Wh++LvKMmFOWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759739387; a=rsa-sha256; cv=none; b=sI7I5JqCfOEApb5BY/8Ijqm5C4BIUFEs5NTg1XLyHsW7RU/FBE2YWorPqeXVEq+VppcZBy oFimOZ8HwAYo7uEbDJSWRizkEQOKMhF/nHWEQhPQlHSAlTwZoPW0U92VzggAJvTD9jBiD1 chTG/eZsSEaPtcbHUYq07XcS6/dLkk3Azte6QCWSZDoUQeo1v1dIlImmNJfpV+ZOukSGTM KHTcWdJ+jfuFTNG6YVYffq7vBwGBiDWJGAV7X49Ld0gstloyYj39iSPO/sOLSXF7MZsg8H JcOPWDu1a5898If0rgl33KDmODPRSf3VfB2kr5bvYzgtdJcJFcU6YlopF54SDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cgCB32zgkzrWr; Mon, 06 Oct 2025 08:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5968TlbL042875; Mon, 6 Oct 2025 08:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5968TlYh042872; Mon, 6 Oct 2025 08:29:47 GMT (envelope-from git) Date: Mon, 6 Oct 2025 08:29:47 GMT Message-Id: <202510060829.5968TlYh042872@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 6490f841f011 - main - devel/py-memory-graph: New port: Teaching tool for debugging references and mutable data types List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6490f841f011c06929001e5e6a8e08a0a99aa180 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=6490f841f011c06929001e5e6a8e08a0a99aa180 commit 6490f841f011c06929001e5e6a8e08a0a99aa180 Author: Yuri Victorovich AuthorDate: 2025-10-06 07:54:33 +0000 Commit: Yuri Victorovich CommitDate: 2025-10-06 08:29:16 +0000 devel/py-memory-graph: New port: Teaching tool for debugging references and mutable data types --- devel/Makefile | 1 + devel/py-memory-graph/Makefile | 25 ++++++++++++++ devel/py-memory-graph/distinfo | 3 ++ .../files/patch-memory__graph____init__.py | 23 +++++++++++++ .../files/patch-memory__graph__test__sequence.py | 40 ++++++++++++++++++++++ devel/py-memory-graph/files/patch-pyproject.toml | 24 +++++++++++++ devel/py-memory-graph/pkg-descr | 14 ++++++++ 7 files changed, 130 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index b6258ca6c61e..f753525b102c 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5266,6 +5266,7 @@ SUBDIR += py-mediapy SUBDIR += py-medikit SUBDIR += py-memory-allocator + SUBDIR += py-memory-graph SUBDIR += py-memory-profiler SUBDIR += py-mergedeep SUBDIR += py-merossiot diff --git a/devel/py-memory-graph/Makefile b/devel/py-memory-graph/Makefile new file mode 100644 index 000000000000..d221e71ec857 --- /dev/null +++ b/devel/py-memory-graph/Makefile @@ -0,0 +1,25 @@ +PORTNAME= memory-graph +DISTVERSION= 0.3.58 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= memory_graph-${DISTVERSION} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Teaching tool for debugging references and mutable data types +WWW= https://github.com/bterwijn/memory_graph + +LICENSE= BSD2CLAUSE + +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}graphviz>0:graphics/py-graphviz@${PY_FLAVOR} + +USES= python +USE_PYTHON= pep517 autoplist pytest + +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + +# tests as of 0.3.58: 6 passed in ~2.47s + +.include diff --git a/devel/py-memory-graph/distinfo b/devel/py-memory-graph/distinfo new file mode 100644 index 000000000000..40a653f988d2 --- /dev/null +++ b/devel/py-memory-graph/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1759603621 +SHA256 (memory_graph-0.3.58.tar.gz) = 48c5acdba4be8a59c5e3bdcc5919214e22fca5de4e706f977c80e0daebf4988f +SIZE (memory_graph-0.3.58.tar.gz) = 16828462 diff --git a/devel/py-memory-graph/files/patch-memory__graph____init__.py b/devel/py-memory-graph/files/patch-memory__graph____init__.py new file mode 100644 index 000000000000..0f263030a9db --- /dev/null +++ b/devel/py-memory-graph/files/patch-memory__graph____init__.py @@ -0,0 +1,23 @@ +# Fix graphviz Python library API compatibility +# +# The memory-graph library uses outdated graphviz API from older versions. +# FreeBSD ports install py-graphviz 0.10.1 which changed the render() method: +# +# Old API (< 0.8): graph.render(outfile=..., quiet=..., quiet_view=...) +# New API (>= 0.8): graph.render(filename=...) +# +# The 'quiet' and 'quiet_view' parameters were deprecated and removed. +# This patch updates the API call to work with modern py-graphviz versions +# while maintaining all core functionality. +# +--- memory_graph/__init__.py.orig 2025-10-04 12:21:39.453707000 -0700 ++++ memory_graph/__init__.py 2025-10-04 12:21:44.778850000 -0700 +@@ -86,7 +86,7 @@ + if outfile.endswith('.gv') or outfile.endswith('.dot'): + graph.save(filename=outfile) + else: +- graph.render(outfile=outfile, view=view, cleanup=False, quiet=False, quiet_view=False) ++ graph.render(filename=outfile, view=view, cleanup=False) + + + def show(data, outfile=None, view=False, numbered = False): diff --git a/devel/py-memory-graph/files/patch-memory__graph__test__sequence.py b/devel/py-memory-graph/files/patch-memory__graph__test__sequence.py new file mode 100644 index 000000000000..5f044f19144d --- /dev/null +++ b/devel/py-memory-graph/files/patch-memory__graph__test__sequence.py @@ -0,0 +1,40 @@ +# Fix pytest test collection conflict with helper function +# +# The function 'test_slicing(sequence, slicer)' starts with 'test_' so pytest +# automatically collects it as a test function. However, it's actually a helper +# function that takes parameters, which pytest interprets as fixtures. +# Since these fixtures don't exist, pytest fails with "fixture not found". +# +# This helper function is meant to be called from test_sequence() with specific +# arguments, not discovered and run independently by pytest. +# +# Solution: Rename to '_test_slicing()' (underscore prefix) so pytest ignores it +# during auto-discovery, then update all calls to use the new name. +# +--- memory_graph/test_sequence.py.orig 2025-10-04 13:43:50.616552000 -0700 ++++ memory_graph/test_sequence.py 2025-10-04 13:44:02.505010000 -0700 +@@ -10,7 +10,7 @@ + return index[0] + return index + +-def test_slicing(sequence, slicer): ++def _test_slicing(sequence, slicer): + print(sequence) + print(slicer) + for i in sequence.indices_all(): +@@ -25,13 +25,13 @@ + def test_sequence(): + sequence = Sequence1D([i for i in range(8)]) + slicer = Slicer(2,3) +- test_slicing(sequence, slicer) ++ _test_slicing(sequence, slicer) + + width = 5 + height = 6 + sequence = Sequence2D([[x+y*width for x in range(width)] for y in range(height)]) + slicer = (Slicer(1,2), Slicer(2,1)) +- test_slicing(sequence, slicer) ++ _test_slicing(sequence, slicer) + + if __name__ == '__main__': + test_sequence() diff --git a/devel/py-memory-graph/files/patch-pyproject.toml b/devel/py-memory-graph/files/patch-pyproject.toml new file mode 100644 index 000000000000..4cfcc6656821 --- /dev/null +++ b/devel/py-memory-graph/files/patch-pyproject.toml @@ -0,0 +1,24 @@ +# Fix pyproject.toml license field format for PEP 621 compliance +# +# The original pyproject.toml uses deprecated license field format: +# license = "BSD-2-Clause" +# license-files = ["LICENSE.txt"] +# +# Modern setuptools (used in pep517 builds) requires PEP 621 compliant format: +# license = {text = "BSD-2-Clause"} +# +# This change enables successful pep517 builds by using the standard license +# object format and removing the conflicting license-files field. +# +--- pyproject.toml.orig 2025-10-04 11:48:10.241408000 -0700 ++++ pyproject.toml 2025-10-04 11:48:10.243444000 -0700 +@@ -9,8 +9,7 @@ + authors = [ + {name = "Bas Terwijn", email = "bterwijn@gmail.com"} + ] +-license = "BSD-2-Clause" +-license-files = ["LICENSE.txt"] ++license = {text = "BSD-2-Clause"} + readme = "README.md" + requires-python = ">=3.7" + classifiers = [ diff --git a/devel/py-memory-graph/pkg-descr b/devel/py-memory-graph/pkg-descr new file mode 100644 index 000000000000..f2cfbd99ef31 --- /dev/null +++ b/devel/py-memory-graph/pkg-descr @@ -0,0 +1,14 @@ +memory-graph is a Python library that creates visual memory graphs for teaching +and debugging purposes. It helps visualize object references, mutable data +types, and the differences between shallow and deep copying in Python. + +Key features: +* Generate visual representations of Python object references +* Illustrate memory layouts and object relationships +* Educational tool for understanding Python memory model +* Debugging aid for complex data structures +* Support for various data types including lists, dictionaries, and custom + objects + +The library uses Graphviz to create clear, graphical representations that make +it easier to understand how Python manages memory and references.