Skip to content

Commit d0189d5

Browse files
committed
Provide setup.cfg with python-tag to Python Wheels. For python-tag
"cp27" means CPython 2.7. CEFPython uses Cython module, so it would not be compatible other Python implementations like PyPI.
1 parent 43fa67e commit d0189d5

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

cefpython/cef3/linux/installer/make-setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
README_TEMPLATE = os.getcwd()+r"/README.txt.template"
2626
INIT_TEMPLATE = os.getcwd()+r"/__init__.py.template"
2727
SETUP_TEMPLATE = os.getcwd()+r"/setup.py.template"
28+
SETUP_CFG_TEMPLATE = os.getcwd()+r"/setup.cfg.template"
2829

2930
def main():
3031
parser = argparse.ArgumentParser(usage="%(prog)s [options]")
@@ -37,6 +38,8 @@ def main():
3738
vars = {}
3839
vars["APP_VERSION"] = args.version
3940
vars["PLATFORM"] = sysconfig.get_platform()
41+
vars["PY_VERSION_DIGITS_ONLY"] = (str(sys.version_info.major) + ""
42+
+ str(sys.version_info.minor)) # "27" or "34"
4043

4144
print("Reading template: %s" % README_TEMPLATE)
4245
f = open(README_TEMPLATE)
@@ -53,6 +56,11 @@ def main():
5356
SETUP_CONTENT = f.read() % vars
5457
f.close()
5558

59+
print("Reading template: %s" % SETUP_CFG_TEMPLATE)
60+
f = open(SETUP_CFG_TEMPLATE)
61+
SETUP_CFG_CONTENT = f.read() % vars
62+
f.close()
63+
5664
installer_dir = os.path.dirname(os.path.abspath(__file__))
5765

5866
setup_dir = installer_dir+"/"+PACKAGE_NAME+"-"+vars["APP_VERSION"]+"-"+LINUX_BITS+"-setup"
@@ -71,6 +79,10 @@ def main():
7179
with open(setup_dir+"/setup.py", "w") as f:
7280
f.write(SETUP_CONTENT)
7381

82+
print("Creating setup.cfg from template")
83+
with open(setup_dir+"/setup.cfg", "w") as f:
84+
f.write(SETUP_CFG_CONTENT)
85+
7486
binaries_dir = os.path.abspath(installer_dir+"/../binaries_"+BITS+"/")
7587
print("Copying binaries to package dir")
7688
ret = os.system("cp -rf "+binaries_dir+"/* "+package_dir)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
python-tag=cp%(PY_VERSION_DIGITS_ONLY)

cefpython/cef3/windows/installer/make-setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
README_TEMPLATE = os.getcwd()+r"/README.txt.template"
2424
INIT_TEMPLATE = os.getcwd()+r"/__init__.py.template"
2525
SETUP_TEMPLATE = os.getcwd()+r"/setup.py.template"
26+
SETUP_CFG_TEMPLATE = os.getcwd()+r"/setup.cfg.template"
2627

2728
def glob_remove(pathname):
2829
filelist = glob.glob(pathname)
@@ -57,6 +58,8 @@ def main():
5758
vars = {}
5859
vars["APP_VERSION"] = args.version
5960
vars["PLATFORM"] = sysconfig.get_platform()
61+
vars["PY_VERSION_DIGITS_ONLY"] = (str(sys.version_info.major) + ""
62+
+ str(sys.version_info.minor)) # "27" or "34"
6063

6164
print("Reading template: %s" % README_TEMPLATE)
6265
f = open(README_TEMPLATE)
@@ -73,6 +76,11 @@ def main():
7376
SETUP_CONTENT = f.read() % vars
7477
f.close()
7578

79+
print("Reading template: %s" % SETUP_CFG_TEMPLATE)
80+
f = open(SETUP_CFG_TEMPLATE)
81+
SETUP_CFG_CONTENT = f.read() % vars
82+
f.close()
83+
7684
installer_dir = os.path.dirname(os.path.abspath(__file__))
7785

7886
pyVersion = str(sys.version_info.major) +"."+ str(sys.version_info.minor)
@@ -93,6 +101,10 @@ def main():
93101
with open(setup_dir+"/setup.py", "w") as f:
94102
f.write(SETUP_CONTENT)
95103

104+
print("Creating setup.cfg from template")
105+
with open(setup_dir+"/setup.cfg", "w") as f:
106+
f.write(SETUP_CFG_CONTENT)
107+
96108
if BITS == "32bit":
97109
binaries_dir = os.path.abspath(installer_dir+"/../binaries/")
98110
else:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
python-tag=cp%(PY_VERSION_DIGITS_ONLY)

0 commit comments

Comments
 (0)