psdi-data-conversion 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,9 @@ from psdi_data_conversion.database import get_format_info
30
30
  from psdi_data_conversion.file_io import split_archive_ext
31
31
  from psdi_data_conversion.main import print_wrap
32
32
 
33
- # Env var for the SHA of the latest commit
33
+ # Env var for the tag and SHA of the latest commit
34
+ TAG_EV = "TAG"
35
+ TAG_SHA_EV = "TAG_SHA"
34
36
  SHA_EV = "SHA"
35
37
 
36
38
  # Env var for whether this is a production release or development
@@ -134,6 +136,10 @@ def get_tag_and_sha() -> str:
134
136
  """Get the SHA of the last commit
135
137
  """
136
138
 
139
+ # Get the tag of the latest commit
140
+ ev_tag = os.environ.get(TAG_EV)
141
+ if ev_tag:
142
+ tag = ev_tag
137
143
  try:
138
144
  # This bash command calls `git tag` to get a sorted list of tags, with the most recent at the top, then uses
139
145
  # `head` to trim it to one line
@@ -142,16 +148,24 @@ def get_tag_and_sha() -> str:
142
148
  out_bytes = run(cmd, shell=True, capture_output=True).stdout
143
149
  tag = str(out_bytes.decode()).strip()
144
150
 
145
- # Get the SHA associated with this tag
151
+ except Exception:
152
+ print("ERROR: Could not determine most recent tag. Error was:\n" + format_exc(),
153
+ file=sys.stderr)
154
+ tag = ""
155
+
156
+ # Get the SHA associated with this tag
157
+ ev_tag_sha = os.environ.get(TAG_SHA_EV)
158
+ if ev_tag_sha:
159
+ tag: str | None = ev_tag_sha
160
+ try:
146
161
  cmd = f"git show {tag}" + " | head -n 1 | gawk '{print($2)}'"
147
162
 
148
163
  out_bytes = run(cmd, shell=True, capture_output=True).stdout
149
164
  tag_sha = str(out_bytes.decode()).strip()
150
165
 
151
166
  except Exception:
152
- print("ERROR: Could not determine most recent tag. Error was:\n" + format_exc(),
167
+ print("ERROR: Could not determine SHA for most recent tag. Error was:\n" + format_exc(),
153
168
  file=sys.stderr)
154
- tag = ""
155
169
  tag_sha = None
156
170
 
157
171
  # First check if the SHA is provided through an environmental variable
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: psdi_data_conversion
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Chemistry file format conversion service, provided by PSDI
5
5
  Project-URL: Homepage, https://data-conversion.psdi.ac.uk/
6
6
  Project-URL: Documentation, https://psdi-uk.github.io/psdi-data-conversion/
@@ -1,5 +1,5 @@
1
1
  psdi_data_conversion/__init__.py,sha256=urMsTqsTHTch1q4rMT9dgGnrvdPFMP9B8r-6Kr8H5sE,404
2
- psdi_data_conversion/app.py,sha256=jU0cK3yduKQkDECf1UGJCPpBF57bUitM_YHH0vsoS4A,16745
2
+ psdi_data_conversion/app.py,sha256=s2Np_RcDGlouGNUq6qJI4R3MUV5ksBtl11DdqnxsOwY,17158
3
3
  psdi_data_conversion/constants.py,sha256=Hq2OVbcSkcv6T87-YJlo1PVlr9ILlB4H3E9JYjzvCF4,7423
4
4
  psdi_data_conversion/converter.py,sha256=Y77mqH2OKxf2YelphWDl82AKoRa-APle-l3e8wG_WZA,27315
5
5
  psdi_data_conversion/database.py,sha256=XzKvtT-cFmKLWLo5OBB5CV_rGHuqEEuENNyZnbS39qE,56419
@@ -81,8 +81,8 @@ psdi_data_conversion/testing/conversion_callbacks.py,sha256=ATR-_BsYCUN8KyOyUjfd
81
81
  psdi_data_conversion/testing/conversion_test_specs.py,sha256=8W97tI6dVbHE9BEW76dsKDlfsm5oTlrlntG--b0h8HU,26106
82
82
  psdi_data_conversion/testing/gui.py,sha256=ul7ixYANIzmOG2ZNOZmQO6wsHmGHdiBGAlw-KuoN0j8,19085
83
83
  psdi_data_conversion/testing/utils.py,sha256=YrFxjyiIx1seph0j7jCUgAVm6HvXY9QJjx0MvNJRbfw,26134
84
- psdi_data_conversion-0.1.1.dist-info/METADATA,sha256=M5iHWEennMs8JSqTVqyAKco-9a0a5jRWh6u5W192Ag0,48108
85
- psdi_data_conversion-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
- psdi_data_conversion-0.1.1.dist-info/entry_points.txt,sha256=xL7XTzaPRr2E67WhOD1M1Q-76hB8ausQlnNiHzuZQPA,123
87
- psdi_data_conversion-0.1.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
88
- psdi_data_conversion-0.1.1.dist-info/RECORD,,
84
+ psdi_data_conversion-0.1.2.dist-info/METADATA,sha256=rLiPpwWntHL1AfH8NrRqIKMkGsX6Lls7NdtKXQhrPhk,48108
85
+ psdi_data_conversion-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
+ psdi_data_conversion-0.1.2.dist-info/entry_points.txt,sha256=xL7XTzaPRr2E67WhOD1M1Q-76hB8ausQlnNiHzuZQPA,123
87
+ psdi_data_conversion-0.1.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
88
+ psdi_data_conversion-0.1.2.dist-info/RECORD,,