Skip to content

Commit 1ef4c78

Browse files
committed
Add support for wheel creation
1 parent e9ef958 commit 1ef4c78

File tree

2 files changed

+9
-30
lines changed

2 files changed

+9
-30
lines changed

setup.py

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,23 @@
11
#!/usr/bin/env python
2+
from __future__ import absolute_import
23

34
from gnatpython import __version__
45
from setup_helpers import (
56
build_scripts_gnatpython, build_ext_gnatpython, get_extension_list)
67

7-
from distutils.core import setup
8+
from setuptools import setup, find_packages
89
import distutils.file_util
910

1011
import glob
1112
import os
1213

13-
old_copy_file = distutils.file_util.copy_file
14-
15-
16-
def my_copy_file(src, dst, preserve_mode=1,
17-
preserve_times=1, update=0, link=None,
18-
verbose=0, dry_run=0):
19-
old_copy_file(src, dst, 1, preserve_times,
20-
update, link, verbose, dry_run)
21-
22-
distutils.file_util.copy_file = my_copy_file
23-
24-
# Compute the list of data files
25-
data_file_list = []
26-
for root, _, _ in os.walk('gnatpython/internal/data'):
27-
data_file_list.append(
28-
os.path.relpath(os.path.join(root, '*'), 'gnatpython/internal'))
29-
3014
setup(name='gnatpython',
3115
version=__version__,
3216
author="AdaCore",
3317
author_email="report@adacore.com",
34-
packages=['gnatpython',
35-
'gnatpython.binarydata',
36-
'gnatpython.testsuite'],
37-
package_data={'gnatpython.internal': data_file_list},
38-
cmdclass={'build_scripts': build_scripts_gnatpython(),
39-
'build_ext': build_ext_gnatpython()},
18+
packages=find_packages(),
4019
ext_modules=get_extension_list(),
41-
scripts=[f for f in glob.glob('scripts/*') +
42-
glob.glob('scripts/internal/*')
43-
if os.path.isfile(f)],
44-
requires=['requests', 'pep8', 'pyflakes'])
20+
cmdclass={'build_ext': build_ext_gnatpython(),
21+
'build_scripts': build_scripts_gnatpython()},
22+
install_requires = ['colorama', 'pyyaml', 'python-dateutil'],
23+
scripts=[f for f in glob.glob('scripts/*') if os.path.isfile(f)])

setup_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
from distutils.command.build_ext import build_ext
2+
from setuptools.command.build_ext import build_ext
33
from distutils.command.build_scripts import build_scripts
4-
from distutils.extension import Extension
4+
from setuptools import Extension
55
from distutils.sysconfig import get_python_inc, get_python_lib
66

77
import glob

0 commit comments

Comments
 (0)