Skip to content

Commit

Permalink
chore: prevent normalization of semver versioning (#17)
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 80bb9df commit f08387e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/google-cloud-audit-log/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@
import os

import setuptools
from setuptools import setup, find_packages

# 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

name = "google-cloud-audit-log"
description = "Google Cloud Audit Protos"
Expand All @@ -33,7 +47,7 @@

setuptools.setup(
name=name,
version=version,
version=sic(version),
author="Google LLC",
author_email="googleapis-packages@google.com",
classifiers=[
Expand All @@ -53,7 +67,7 @@
long_description_content_type="text/markdown",
install_requires=dependencies,
license="Apache-2.0",
packages=find_packages(),
packages=setuptools.find_packages(),
package_data={"": ["*.proto"]},
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
namespace_packages=["google", "google.cloud"],
Expand Down

0 comments on commit f08387e

Please sign in to comment.