Skip to content

Commit

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

* chore: update style for consistency

* chore: update workaround to make sic work
  • Loading branch information
dandhlee committed Apr 16, 2021
1 parent cb4d480 commit 64642c9
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,22 @@
import io
import os

from setuptools import find_packages, setup
import setuptools

# 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 = "1.18.1"

Expand All @@ -24,14 +39,14 @@
with io.open(os.path.join(PACKAGE_ROOT, "README.rst")) as file_obj:
README = file_obj.read()

setup(
setuptools.setup(
name="proto-plus",
version=version,
version=sic(version),
license="Apache 2.0",
author="Google LLC",
author_email="googleapis-packages@google.com",
url="https://github.com/googleapis/proto-plus-python.git",
packages=find_packages(exclude=["docs", "tests"]),
packages=setuptools.find_packages(exclude=["docs", "tests"]),
description="Beautiful, Pythonic protocol buffers.",
long_description=README,
platforms="Posix; MacOS X",
Expand Down

0 comments on commit 64642c9

Please sign in to comment.