8000 Merge pull request #1341 from stonebig/master · winpython/winpython@479d30a · GitHub
[go: up one dir, main page]

Skip to content

Commit 479d30a

Browse files
authored
Merge pull request #1341 from stonebig/master
remove python version control (pre-pip aera)
2 parents 6e5d676 + b5383f5 commit 479d30a

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

winpython/wppm.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,15 @@ def __init__(self, fname):
6161
self.fname = fname
6262
self.name = None
6363
self.version = None
64-
self.pyversion = None
6564
self.description = None
6665
self.url = None
6766

6867
def __str__(self):
6968
text = f"{self.name} {self.version}"
70-
pytext = ""
71-
if self.pyversion is not None:
72-
pytext = f" for Python {self.pyversion}"
73-
if not pytext:
74-
pytext = " for Python"
69+
pytext = " for Python"
7570
text += f"{pytext}\n{self.description}\nWebsite: {self.url}\n[{Path(self.fname).name}]"
7671
return text
7772

78-
def is_compatible_with(self, distribution):
79-
"""Return True if package is compatible with distribution in terms of
80-
Python version (if applyable)"""
81-
iscomp = True
82-
if self.pyversion is not None:
83-
# Non-pure Python package
84-
iscomp = iscomp and self.pyversion == distribution.version
85-
return iscomp
86-
8773
def extract_optional_infos(self, update=False, suggested_summary=None):
8874
"""Extract package optional infos (description, url)
8975
from the package database"""
@@ -113,7 +99,6 @@ def extract_infos(self):
11399
self.name = bname2[0]
114100
self.version = "-".join(list(bname2[1:-3]))
115101
self.pywheel, abi, arch = bname2[-3:]
116-
self.pyversion = None # Let's ignore this self.pywheel
117102
# wheel arch is 'win32' or 'win_amd64'
118103
return
119104
elif bname.endswith((".zip", ".tar.gz", ".whl")):
@@ -276,8 +261,6 @@ def patch_all_shebang(
276261

277262
def install(self, package, install_options=None):
278263
"""Install package in distribution"""
279-
assert package.is_compatible_with(self)
280-
281264
# wheel addition
282265
if package.fname.endswith((".whl", ".tar.gz", ".zip")):
283266
self.install_bdist_direct(package, install_options=install_options)
@@ -778,13 +761,8 @@ def main(test=False):
778761
dist.uninstall(package)
779762
else:
780763
package = Package(args.fname)
781-
if args.install and package.is_compatible_with(dist):
764+
if args.install:
782765
dist.install(package)
783-
else:
784-
raise RuntimeError(
785-
"Package is not compatible with Python "
786-
f"{dist.version} {dist.architecture}bit"
787-
)
788766
except NotImplementedError:
789767
raise RuntimeError("Package is not (yet) supported by WPPM")
790768
else:

0 commit comments

Comments
 (0)
0