[Git][reproducible-builds/reprotest][master] 4 commits: tests: use a non-constant-address object to test address capture

Vagrant Cascadian (@vagrant) gitlab at salsa.debian.org
Sun Dec 22 18:43:13 UTC 2024



Vagrant Cascadian pushed to branch master at Reproducible Builds / reprotest


Commits:
690daaf5 by Rebecca N. Palmer at 2024-12-19T07:44:50+00:00
tests: use a non-constant-address object to test address capture

Closes: #1082289

- - - - -
ef549aaf by Rebecca N. Palmer at 2024-12-19T21:02:23+00:00
Stop using pkg_resources. (Closes: #1083743)

- - - - -
8e3b98a2 by Rebecca N. Palmer at 2024-12-21T08:45:14+00:00
as_file is not a method

- - - - -
02200073 by Vagrant Cascadian at 2024-12-22T18:43:09+00:00
Merge branch 'fix1082289' into 'master'

tests: use a non-constant-address object to test address capture

See merge request reproducible-builds/reprotest!27
- - - - -


3 changed files:

- debian/control
- reprotest/__init__.py
- tests/mock_build.py


Changes:

=====================================
debian/control
=====================================
@@ -41,7 +41,6 @@ Depends:
  procps,
  python3-debian,
  python3-distro,
- python3-pkg-resources,
  python3-rstr,
  ${misc:Depends},
  ${python3:Depends},


=====================================
reprotest/__init__.py
=====================================
@@ -17,7 +17,7 @@ import tempfile
 import traceback
 import types
 
-import pkg_resources
+import importlib.resources
 
 from reprotest.lib import adtlog
 from reprotest.lib import adt_testbed
@@ -29,8 +29,8 @@ logger = logging.getLogger(__name__)
 VIRT_PREFIX = "autopkgtest-virt-"
 
 def get_server_path(server_name):
-    return pkg_resources.resource_filename(
-        __name__, os.path.join("virt", (VIRT_PREFIX + server_name) if server_name else ""))
+    with importlib.resources.as_file(importlib.resources.files()) as this_directory:
+        return os.path.join(str(this_directory), "virt", (VIRT_PREFIX + server_name) if server_name else "")
 
 def is_executable(parent, fn):
     path = os.path.join(parent, fn)


=====================================
tests/mock_build.py
=====================================
@@ -30,7 +30,7 @@ if __name__ == '__main__':
     # producing the same file order, but this is unlikely, if not
     # as unlikely as in the above test.
     if 'aslr' in captures:
-        output.append(id(__name__))
+        output.append(id("teststring123"))
     if 'environment' in captures:
         output.extend("%s=%s" % pair for pair in os.environ.items())
     if 'build_path' in captures:



View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/compare/a7fb572f0854cbbedecb1a3c9373d33673b584c6...022000733683038fac46bd1168006de09b3e148e

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/compare/a7fb572f0854cbbedecb1a3c9373d33673b584c6...022000733683038fac46bd1168006de09b3e148e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20241222/13bd1b23/attachment.htm>


More information about the rb-commits mailing list