Skip to content

Commit

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

* chore: update setup.py for style

* chore: update workaround to make sic work
  • Loading branch information
dandhlee committed Apr 16, 2021
1 parent 9179193 commit 4d169b9
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions setup.py
Expand Up @@ -19,7 +19,22 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import io
from setuptools import 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

# Package metadata.

Expand All @@ -39,9 +54,9 @@ def readme():
return f.read()


setup(
setuptools.setup(
name=name,
version=version,
version=sic(version),
description=description,
long_description=readme(),
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit 4d169b9

Please sign in to comment.