From 0afa55f093b2a5b4c360a8cb8f99c0ac5b3a80ec Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Mon, 20 Jul 2020 13:04:07 +0200 Subject: Make the build reproducible --- logilab/common/proc.py | 4 ++-- logilab/common/pytest.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/logilab/common/proc.py b/logilab/common/proc.py index c27356c..16e7b17 100644 --- a/logilab/common/proc.py +++ b/logilab/common/proc.py @@ -164,13 +164,13 @@ class MemorySentinel(Thread): """A class checking a process don't use too much memory in a separated daemonic thread """ - def __init__(self, interval, memory_limit, gpid=os.getpid()): + def __init__(self, interval, memory_limit, gpid=None): Thread.__init__(self, target=self._run, name="Test.Sentinel") self.memory_limit = memory_limit self._stop = Event() self.interval = interval self.setDaemon(True) - self.gpid = gpid + self.gpid = gpid if gpid is not None else os.getpid() def stop(self): """stop ap""" diff --git a/logilab/common/pytest.py b/logilab/common/pytest.py index 5c62816..894de01 100644 --- a/logilab/common/pytest.py +++ b/logilab/common/pytest.py @@ -174,8 +174,10 @@ def load_pytest_conf(path, parser): return namespace.get('CustomPyTester', PyTester) -def project_root(parser, projdir=os.getcwd()): +def project_root(parser, projdir=None): """try to find project's root and add it to sys.path""" + if projdir is None: + projdir = os.getcwd() previousdir = curdir = osp.abspath(projdir) testercls = PyTester conf_file_path = osp.join(curdir, CONF_FILE) -- cgit v1.2.1