Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:tools
python-python-afl
Use-setuptools-and-use-test-command-for-setup.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Use-setuptools-and-use-test-command-for-setup.patch of Package python-python-afl
From 4e34831c88b6034bd4218fa3e9368662072b8aa4 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner <sebix@sebix.at> Date: Fri, 14 Oct 2016 09:54:20 +0200 Subject: [PATCH] Use setuptools and use test command for setup --- setup.py | 69 ++++++++++++-------------------------------------------- 1 file changed, 14 insertions(+), 55 deletions(-) diff --git a/setup.py b/setup.py index 67cb5f8..d43b3d3 100644 --- a/setup.py +++ b/setup.py @@ -32,9 +32,9 @@ import os import sys -import distutils.core -import distutils.version -from distutils.command.sdist import sdist as distutils_sdist +from setuptools import setup, find_packages +from setuptools.extension import Extension +from Cython.Build import cythonize try: from wheel.bdist_wheel import bdist_wheel @@ -67,6 +67,13 @@ def get_version(): Topic :: Software Development :: Testing '''.strip().splitlines() +extensions = [ + Extension( + "afl", + ["afl.pyx"] + ), +] + meta = dict( name='python-afl', version=get_version(), @@ -77,61 +84,13 @@ def get_version(): url='http://jwilk.net/software/python-afl', author='Jakub Wilk', author_email='jwilk@jwilk.net', + install_requires=['Cython>=0.19'], + test_suite = 'nose.collector', + ext_modules = cythonize(extensions), ) -min_cython_version = '0.19' -try: - import Cython -except ImportError: - # This shouldn't happen with pip >= 10, thanks to PEP-518 support. - # For older versions, we use this hack to trick it into installing Cython: - if 'setuptools' in sys.modules and sys.argv[1] == 'egg_info': - distutils.core.setup( - install_requires=['Cython>={v}'.format(v=min_cython_version)], - # Conceptually, “setup_requires” would make more sense than - # “install_requires”, but the former is not supported by pip. - **meta - ) - sys.exit(0) - raise RuntimeError('Cython >= {v} is required'.format(v=min_cython_version)) - -try: - cython_version = Cython.__version__ -except AttributeError: - # Cython prior to 0.14 didn't have __version__. - # Oh well. We don't support such old versions anyway. - cython_version = '0' -cython_version = distutils.version.LooseVersion(cython_version) -if cython_version < min_cython_version: - raise RuntimeError('Cython >= {v} is required'.format(v=min_cython_version)) - -import Cython.Build # pylint: disable=wrong-import-position - -class cmd_sdist(distutils_sdist): - - def maybe_move_file(self, base_dir, src, dst): - src = os.path.join(base_dir, src) - dst = os.path.join(base_dir, dst) - if os.path.exists(src): - self.move_file(src, dst) - - def make_release_tree(self, base_dir, files): - distutils_sdist.make_release_tree(self, base_dir, files) - self.maybe_move_file(base_dir, 'LICENSE', 'doc/LICENSE') - -def d(**kwargs): - return dict( - (k, v) for k, v in kwargs.items() - if v is not None - ) - -distutils.core.setup( - ext_modules=Cython.Build.cythonize('afl.pyx'), +setup( scripts=glob.glob('py-afl-*'), - cmdclass=d( - bdist_wheel=bdist_wheel, - sdist=cmd_sdist, - ), **meta )
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor