Skip to content

Commit b4ce14c

Browse files
committed
Add setup file just to check Python used to install.
1 parent 64e0148 commit b4ce14c

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ dependencies = [
1616
]
1717
readme = "README.rst"
1818

19-
# 3.8 lingo
20-
license = {text = "GPL"}
21-
2219
# Newer lingo
23-
# license = "GPL-3.0-or-later"
20+
license = "GPL-3.0-or-later"
2421

2522
keywords = ["Python bytecode", "bytecode", "disassembler"]
2623
classifiers = [

setup.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Check that the Python version running this is compatible with this installation medium.
3+
Note: that we use 2.x compatible Python code here.
4+
"""
5+
import sys
6+
from setuptools import setup
7+
8+
major = sys.version_info[0]
9+
minor = sys.version_info[1]
10+
11+
if major != 3 or not minor >= 11:
12+
sys.stderr.write("This installation medium is only for Python 3.11 and later. You are running Python %s.%s.\n" % (major, minor))
13+
14+
if major == 3 and 6 <= minor <= 10:
15+
sys.stderr.write("Please install using uncompyle6_36-x.y.z.tar.gz from https://github.com/rocky/python-uncompyle6/releases\n")
16+
sys.exit(1)
17+
elif major == 3 and 3 <= minor <= 5:
18+
sys.stderr.write("Please install using uncompyle6_33-x.y.z.tar.gz from https://github.com/rocky/python-uncompyle6/releases\n")
19+
sys.exit(1)
20+
if major == 3 and 0 <= minor <= 2:
21+
sys.stderr.write("Please install using uncompyle6_30-x.y.z.tar.gz from https://github.com/rocky/python-uncompyle6/releases\n")
22+
sys.exit(1)
23+
elif major == 2:
24+
sys.stderr.write("Please install using uncompyle6_24-x.y.z.tar.gz from https://github.com/rocky/python-uncompyle6/releases\n")
25+
sys.exit(1)
26+
27+
28+
setup()

0 commit comments

Comments
 (0)