Skip to content

Commit

Permalink
chore: prevent normalization of semver versioning (#22)
Browse files Browse the repository at this point in the history
* chore: prevent normalization of semver versioning

* chore: update workaround to make sic work
  • Loading branch information
dandhlee authored Apr 16, 2021
1 parent 2a46f7a commit f9ffcd0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/google-cloud-binary-authorization/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@

import setuptools # type: ignore

# Disable version normalization performed by setuptools.setup()
try:
# Try the approach of using sic(), added in setuptools 46.1.0
from setuptools import sic
except ImportError:
# Try the approach of replacing packaging.version.Version
sic = lambda v: v
try:
# setuptools >=39.0.0 uses packaging from setuptools.extern
from setuptools.extern import packaging
except ImportError:
# setuptools <39.0.0 uses packaging from pkg_resources.extern
from pkg_resources.extern import packaging
packaging.version.Version = packaging.version.LegacyVersion

version = "0.1.1"

package_root = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -31,7 +46,7 @@

setuptools.setup(
name="google-cloud-binary-authorization",
version=version,
version=sic(version),
long_description=readme,
author="Google LLC",
author_email="googleapis-packages@google.com",
Expand Down

0 comments on commit f9ffcd0

Please sign in to comment.