From be38cee24b678bce9f7681e905cb74883a7105bb Mon Sep 17 00:00:00 2001 From: jlstevens Date: Mon, 10 May 2021 12:19:04 +0200 Subject: [PATCH 1/3] Ports over fix from autover/pull/67 to param --- param/version.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/param/version.py b/param/version.py index f81f49177..a61c745d8 100644 --- a/param/version.py +++ b/param/version.py @@ -26,6 +26,9 @@ def run_cmd(args, cwd=None): cwd=cwd) output, error = (str(s.decode()).strip() for s in proc.communicate()) + # Detects errors as _either_ a non-zero return code _or_ messages + # printed to stderr, because the return code is erroneously fixed at + # zero in some cases (see https://github.com/holoviz/param/pull/389). if proc.returncode != 0 or len(error) > 0: raise Exception(proc.returncode, error) return output @@ -174,19 +177,22 @@ def git_fetch(self, cmd='git', as_string=False): # Verify this is the correct repository (since fpath could # be an unrelated git repository, and autover could just have # been copied/installed into it). - output = run_cmd([cmd, 'remote', '-v'], - cwd=os.path.dirname(self.fpath)) - repo_matches = ['', # No remote set - '/' + self.reponame + '.git' , + remotes = run_cmd([cmd, 'remote', '-v'], + cwd=os.path.dirname(self.fpath)) + repo_matches = ['/' + self.reponame + '.git' , # A remote 'server:reponame.git' can also be referred # to (i.e. cloned) as `server:reponame`. '/' + self.reponame + ' '] - if not any(m in output for m in repo_matches): - return self - - output = run_cmd([cmd, 'describe', '--long', '--match', - "v[0-9]*.[0-9]*.[0-9]*", '--dirty'], - cwd=os.path.dirname(self.fpath)) + if not any(m in remotes for m in repo_matches): + try: + output = self._output_from_file() + if output is not None: + self._update_from_vcs(output) + except: pass + if output is None: + output = run_cmd([cmd, 'describe', '--long', '--match', + "v[0-9]*.[0-9]*.[0-9]*", '--dirty'], + cwd=os.path.dirname(self.fpath)) if as_string: return output except Exception as e1: try: From 4c3502eaa5f431ab102e8984e6cb8c3575b7144d Mon Sep 17 00:00:00 2001 From: jlstevens Date: Mon, 10 May 2021 12:28:16 +0200 Subject: [PATCH 2/3] Fixed trailing whitespace --- param/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/param/version.py b/param/version.py index a61c745d8..32590ccc8 100644 --- a/param/version.py +++ b/param/version.py @@ -27,7 +27,7 @@ def run_cmd(args, cwd=None): output, error = (str(s.decode()).strip() for s in proc.communicate()) # Detects errors as _either_ a non-zero return code _or_ messages - # printed to stderr, because the return code is erroneously fixed at + # printed to stderr, because the return code is erroneously fixed at # zero in some cases (see https://github.com/holoviz/param/pull/389). if proc.returncode != 0 or len(error) > 0: raise Exception(proc.returncode, error) From a98cd0fa3b965a15972357f65d33b1c5692d32e4 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 13 May 2021 15:13:10 +0200 Subject: [PATCH 3/3] Drop pypy2 tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ec6c2464..4b8348a5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'windows-latest'] - python-version: [2.7, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3] + python-version: [2.7, 3.6, 3.7, 3.8, 3.9, pypy3] timeout-minutes: 30 defaults: run: