[Git][reproducible-builds/reprotest][master] 5 commits: Fix few deprecation warnings

Mattia Rizzolo gitlab at salsa.debian.org
Tue Jan 19 18:50:46 UTC 2021



Mattia Rizzolo pushed to branch master at Reproducible Builds / reprotest


Commits:
1a29a1b1 by Frédéric Pierret (fepitre) at 2021-01-19T18:32:33+01:00
Fix few deprecation warnings

- - - - -
f0dda951 by Frédéric Pierret (fepitre) at 2021-01-19T18:32:33+01:00
tox.ini: passenv TERM

Prevent having such issues locally:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/diffoscope/main.py", line 758, in main
    log_handler = ProgressManager().setup(parsed_args)
  File "/usr/lib/python3/dist-packages/diffoscope/progress.py", line 83, in setup
    bar = ProgressBar()
  File "/usr/lib/python3/dist-packages/diffoscope/progress.py", line 251, in __init__
    self.bar = OurProgressBar(
  File "/usr/lib/python3/dist-packages/diffoscope/progress.py", line 233, in __init__
    self.erase_to_eol = line_eraser(self.fd)
  File "/usr/lib/python3/dist-packages/diffoscope/logging.py", line 30, in line_eraser
    curses.setupterm(fd=fd.fileno())
_curses.error: setupterm: could not find terminfo database

- - - - -
7632e274 by Frédéric Pierret (fepitre) at 2021-01-19T18:32:33+01:00
test_reprotest.py: add note on expected error for -d

- - - - -
cfcd5d6e by Marek Marczykowski-Górecki at 2021-01-19T18:34:19+01:00
ci: don't run reprotest nested in reprotest

Reprotest can't apply variations when running inside reprotest already.
The tests are runnin in "build" stage already, so they aren't skipped
entirely.

- - - - -
adeeda58 by Mattia Rizzolo at 2021-01-19T19:50:20+01:00
Merge branch 'fix-tests' of salsa.debian.org:fepitre/reprotest

MR: https://salsa.debian.org/reproducible-builds/reprotest/-/merge_requests/12
Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


5 changed files:

- .gitlab-ci.yml
- reprotest/build.py
- reprotest/lib/adt_testbed.py
- tests/test_reprotest.py
- tox.ini


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -4,3 +4,9 @@ include:
 
 variables:
   SALSA_CI_DISABLE_APTLY: 0
+
+reprotest:
+  extends: .test-reprotest
+  variables:
+    # disable tests, because reprotest doesn't work nested in reprotest
+    DEB_BUILD_OPTIONS: "nocheck"


=====================================
reprotest/build.py
=====================================
@@ -230,8 +230,8 @@ def domain_host(ctx, build, vary):
         # wrap our build command
         _ = _.prepend_to_build_command(*SUDO, '-E', *(nsenter[len(SUDO):]), *make_sudo_command(*current_user_group()))
     else:
-        logger.warn("Not using sudo for domain_host; your build may fail. See man page for other options.")
-        logger.warn("Be sure to `echo 1 > /proc/sys/kernel/unprivileged_userns_clone` if on a Debian system.")
+        logger.warning("Not using sudo for domain_host; your build may fail. See man page for other options.")
+        logger.warning("Be sure to `echo 1 > /proc/sys/kernel/unprivileged_userns_clone` if on a Debian system.")
         if "user_group" in ctx.spec and ctx.spec.user_group.available:
             logger.error("Incompatible variations: domain_host.use_sudo False, user_group.available non-empty.")
             raise ValueError("Incompatible variations; check the log for details.")
@@ -425,7 +425,7 @@ def user_group(ctx, build, vary):
         return build
 
     if not ctx.spec.user_group.available:
-        logger.warn("IGNORING user_group variation; supply more usergroups "
+        logger.warning("IGNORING user_group variation; supply more usergroups "
         "with --variations=user_group.available+=USER1:GROUP1;USER2:GROUP2 or "
         "alternatively, suppress this warning with --variations=-user_group")
         return build
@@ -579,8 +579,8 @@ class Variations(collections.namedtuple('_Variations', 'spec verbosity min_cpus
 
 
 def print_sudoers(spec):
-    logger.warn("This feature is EXPERIMENTAL, use at your own risk.")
-    logger.warn("The output may be out-of-date, please file bugs if it doesn't work...")
+    logger.warning("This feature is EXPERIMENTAL, use at your own risk.")
+    logger.warning("The output may be out-of-date, please file bugs if it doesn't work...")
 
     user, group = current_user_group()
     a = "[a-zA-Z0-9]"


=====================================
reprotest/lib/adt_testbed.py
=====================================
@@ -211,10 +211,10 @@ class Testbed:
             cpu_info = self.check_exec(['sh', '-c', 'nproc; cat /proc/cpuinfo 2>/dev/null || true'],
                                        stdout=True).strip()
             self.nproc = cpu_info.split('\n', 1)[0]
-            m = re.search('^(model.*name|cpu)\s*:\s*(.*)$', cpu_info, re.MULTILINE | re.IGNORECASE)
+            m = re.search(r'^(model.*name|cpu)\s*:\s*(.*)$', cpu_info, re.MULTILINE | re.IGNORECASE)
             if m:
                 self.cpu_model = m.group(2)
-            m = re.search('^(flags|features)\s*:\s*(.*)$', cpu_info, re.MULTILINE | re.IGNORECASE)
+            m = re.search(r'^(flags|features)\s*:\s*(.*)$', cpu_info, re.MULTILINE | re.IGNORECASE)
             if m:
                 self.cpu_flags = m.group(2)
 


=====================================
tests/test_reprotest.py
=====================================
@@ -105,6 +105,8 @@ def test_command_lines():
     assert test_args.artifact_pattern is not None
     check_command_line("--dry-run . --verbosity 2 -- null -d".split(), 0)
     assert test_args.artifact_pattern is not None
+    # expected output throwing errors like:
+    #    reprotest: error: unrecognized arguments: -d
     check_command_line(". null -d".split(), 2)
     check_command_line(". --verbosity 2 null -d".split(), 2)
     check_command_line("--dry-run . --verbosity 2 null -d".split(), 2)


=====================================
tox.ini
=====================================
@@ -15,7 +15,7 @@ commands =
   {envpython} -m coverage html
 
 [testenv]
-passenv = REPROTEST_TEST_* VIRTUALENV_DOWNLOAD *_proxy
+passenv = REPROTEST_TEST_* VIRTUALENV_DOWNLOAD *_proxy TERM
 # usedevelop = True
 deps =
   coverage



View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/compare/0aa3ae62748bcac3c8d810c2978a9f05a5ec6b37...adeeda587a39171a9581ee0d1703bf434a895ea4

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/compare/0aa3ae62748bcac3c8d810c2978a9f05a5ec6b37...adeeda587a39171a9581ee0d1703bf434a895ea4
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/20210119/2fda1aee/attachment.htm>


More information about the rb-commits mailing list