Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit dc0f3ab

Browse filesBrowse files
authored
chore: prevent normalization of semver versioning (#64)
* chore: prevent normalization of semver versioning * chore: update workaround to make sic work
1 parent a1e63c5 commit dc0f3ab
Copy full SHA for dc0f3ab

File tree

Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@
1919
import os
2020
import setuptools # type: ignore
2121

22+
# Disable version normalization performed by setuptools.setup()
23+
try:
24+
# Try the approach of using sic(), added in setuptools 46.1.0
25+
from setuptools import sic
26+
except ImportError:
27+
# Try the approach of replacing packaging.version.Version
28+
sic = lambda v: v
29+
try:
30+
# setuptools >=39.0.0 uses packaging from setuptools.extern
31+
from setuptools.extern import packaging
32+
except ImportError:
33+
# setuptools <39.0.0 uses packaging from pkg_resources.extern
34+
from pkg_resources.extern import packaging
35+
packaging.version.Version = packaging.version.LegacyVersion
36+
2237
version = "0.5.0"
2338

2439
package_root = os.path.abspath(os.path.dirname(__file__))
@@ -30,7 +45,7 @@
3045

3146
setuptools.setup(
3247
name="google-analytics-data",
33-
version=version,
48+
version=sic(version),
3449
long_description=readme,
3550
author="Google LLC",
3651
author_email="googleapis-packages@google.com",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.