Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/qutip/qutip-qip into circ…
Browse files Browse the repository at this point in the history
…uit_measurement
  • Loading branch information
BoxiLi committed Dec 9, 2022
2 parents f153ec6 + da5290d commit f574c0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def _determine_version(options):
with open(version_filename, "r") as version_file:
version_string = version_file.read().strip()
version = packaging.version.parse(version_string)
if isinstance(version, packaging.version.LegacyVersion):
# LegacyVersion was removed in packaging 22, but is still returned by
# packing <= 21
LegacyVersion = getattr(packaging.version, "LegacyVersion", type(None))
if isinstance(version, LegacyVersion):
raise ValueError("invalid version: " + version_string)
options['short_version'] = str(version.public)
options['release'] = not version.is_devrelease
Expand Down

0 comments on commit f574c0a

Please sign in to comment.