From 152559128fc1d1db6cc2f55de44ddae942f69cec Mon Sep 17 00:00:00 2001 From: Mitch Garnaat Date: Mon, 5 Aug 2019 06:12:58 -0700 Subject: [PATCH] Fix the generation of the dependency version strings for the install_requires section of setup.py. Fixes #676. --- packages/jsii-pacmak/lib/targets/python.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index cd0b262943..4f416627f7 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -1115,15 +1115,9 @@ class Package { for (const depName of Object.keys(expectedDeps)) { const depInfo = expectedDeps[depName]; // We need to figure out what our version range is. - // Basically, if it starts with Zero we want to restrict things to - // ~=X.Y.Z. If it does not start with zero, then we want to do ~=X.Y,>=X.Y.Z. + // If the version is X.Y.Z, we want to allow any compatible version X.Y.n const versionParts = depInfo.version.split("."); - let versionSpecifier: string; - if (versionParts[0] === "0") { - versionSpecifier = `~=${versionParts.slice(0, 3).join(".")}`; - } else { - versionSpecifier = `~=${versionParts.slice(0, 2).join(".")},>=${versionParts.slice(0, 3).join(".")}`; - } + const versionSpecifier = `~=${versionParts.slice(0, 3).join(".")}`; dependencies.push(`${depInfo.targets!.python!.distName}${versionSpecifier}`); }