Repository: alanwilter/acpype (language: python)

Issue:
To fix



Discussion / hints:

Fix patch:
diff --git a/acpype_lib/_version.py b/acpype_lib/_version.py
index a7389659..e45f7e9f 100644
--- a/acpype_lib/_version.py
+++ b/acpype_lib/_version.py
@@ -1,10 +1,11 @@
 from subprocess import Popen, STDOUT, PIPE
+from pbr.version import VersionInfo
 
 try:
+    version = VersionInfo("acpype").version_string()
+except Exception:
     version = (
         Popen("git describe --tags --always", shell=True, stderr=STDOUT, stdout=PIPE)
         .communicate()[0][:-1]
         .decode()[0:10]
     )
-except Exception:
-    version = ""
diff --git a/requirements.txt b/requirements.txt
index 529ada31..c95010a2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,3 +2,4 @@
 pytest-cov>=2.10,<2.11
 black==19.10b0
 flake8>=3.8,<3.9
+pbr==5.7.0
diff --git a/setup.py b/setup.py
index 6ab8e9fc..29f33c8d 100644
--- a/setup.py
+++ b/setup.py
@@ -35,6 +35,6 @@
         "Topic :: Scientific/Engineering :: Bio-Informatics",
     ],
     python_requires=">=3.6",
-    install_requires=[],
+    install_requires=["pbr==5.7.0"],
     zip_safe=False,
 )


Test patch:
diff --git a/tests/test_api.py b/tests/test_api.py
index f4b64e4a..e84ce3c0 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -25,15 +25,15 @@
     ("CHARMM_inp", 2262, 2262),
     ("CHARMM_prm", 4180, 4180),
     ("CHARMM_rtf", 9247, 9247),
-    ("CNS_inp", 1431, 1428),
-    ("CNS_par", 5039, 5036),
-    ("CNS_top", 6583, 6580),
-    ("GMX_OPLS_itp", 24582, 24579),
-    ("GMX_OPLS_top", 274, 271),
-    ("GMX_gro", 1599, 1596),
-    ("GMX_itp", 22723, 22720),
-    ("GMX_top", 353, 350),
-    ("NEW_pdb", 2697, 2694),
+    ("CNS_inp", 1431, 1426),
+    ("CNS_par", 5039, 5034),
+    ("CNS_top", 6583, 6578),
+    ("GMX_OPLS_itp", 24582, 24577),
+    ("GMX_OPLS_top", 274, 269),
+    ("GMX_gro", 1599, 1594),
+    ("GMX_itp", 22723, 22718),
+    ("GMX_top", 353, 348),
+    ("NEW_pdb", 2697, 2692),
     ("md_mdp", 216, 216),
 ]