Skip to content

Commit 7b989b2

Browse files
committed
Updated setup.py installers. Use setuptools instead of distutils,
so that Python eggs can be created using "python setup.py bdist_egg". Embed platform information so that egg contains that info. Required for the "pip" package manager to find the right egg on PyPI.
1 parent be22609 commit 7b989b2

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import platform
1313
import shutil
1414
import glob
15+
import sysconfig
1516

1617
BITS = platform.architecture()[0]
1718
assert (BITS == "32bit" or BITS == "64bit")
@@ -35,6 +36,7 @@ def main():
3536

3637
vars = {}
3738
vars["APP_VERSION"] = args.version
39+
vars["PLATFORM"] = sysconfig.get_platform()
3840

3941
print("Reading template: %s" % README_TEMPLATE)
4042
f = open(README_TEMPLATE)

cefpython/cef3/linux/installer/setup.py.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
from distutils.core import setup
2-
from distutils.command.install import install as _install
1+
from setuptools import setup
2+
from setuptools.command.install import install as _install
33
import sys
44
import os
55
import subprocess
66

77
def my_post_install():
88
""" Chmod +x the subprocess and cefclient executables. """
99

10+
print("my_post_install()")
11+
1012
# Do not import from the local "cefpython3" directory.
1113
# Import the cefpython3 module from dist-packages/ directory.
1214
del sys.path[0]
@@ -49,6 +51,7 @@ setup(
4951
author='Czarek Tomczak',
5052
author_email='czarek.tomczak@gmail.com',
5153
url='http://code.google.com/p/cefpython/',
54+
platforms=['%(PLATFORM)'],
5255
packages=['cefpython3', 'cefpython3.wx'],
5356
package_data={'cefpython3': [
5457
'examples/*.py',

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import shutil
1414
import glob
1515
import shutil
16+
import sysconfig
1617

1718
BITS = platform.architecture()[0]
1819
assert (BITS == "32bit" or BITS == "64bit")
@@ -55,6 +56,7 @@ def main():
5556

5657
vars = {}
5758
vars["APP_VERSION"] = args.version
59+
vars["PLATFORM"] = sysconfig.get_platform()
5860

5961
print("Reading template: %s" % README_TEMPLATE)
6062
f = open(README_TEMPLATE)

cefpython/cef3/windows/installer/setup.py.template

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from distutils.core import setup
2-
from distutils.command.install import install as _install
1+
from setuptools import setup
2+
from setuptools.command.install import install as _install
33
import sys
44
import os
55
import subprocess
66

77
def my_post_install():
8-
pass
8+
print("my_post_install(): nothing to do")
99

1010
class install(_install):
1111
def run(self):
@@ -21,6 +21,7 @@ setup(
2121
author='Czarek Tomczak',
2222
author_email='czarek.tomczak@gmail.com',
2323
url='http://code.google.com/p/cefpython/',
24+
platforms=['%(PLATFORM)'],
2425
packages=['cefpython3', 'cefpython3.wx'],
2526
package_data={'cefpython3': [
2627
'examples/*.py',

0 commit comments

Comments
 (0)