commit 3b22cba273693e20c491de48cfdcbc30ab0c517d from: Jelmer Vernooij date: Fri Oct 21 06:47:23 2022 UTC Use standard python infrastructure to mark extensions as optional commit - 13462c7406274f6c7d5b431409033ce8a705086e commit + 3b22cba273693e20c491de48cfdcbc30ab0c517d blob - 79f30c6b2a3c0a1bcbc0a263e94af50d4f56837b blob + e1c523e097b4dff86bc852c1168c496128793440 --- setup.cfg +++ setup.cfg @@ -10,6 +10,7 @@ url = https://www.dulwich.io/ author = Jelmer Vernooij author_email = jelmer@jelmer.uk license = Apachev2 or later or GPLv2 +keywords = vcs, git classifiers = Development Status :: 4 - Beta License :: OSI Approved :: Apache Software License @@ -41,10 +42,6 @@ console_scripts = [options] python_requires = >=3.6 -scripts = - bin/dul-receive-pack - bin/dul-upload-pack -zip_safe = False packages = dulwich dulwich.cloud @@ -54,3 +51,7 @@ packages = include_package_data = True install_requires = urllib3>=1.25 +zip_safe = False +scripts = + bin/dul-receive-pack + bin/dul-upload-pack blob - 42fa0a973cb4953b16cde66db73a1adb3073c30c blob + 11e82bbe07940e4729e41abb4c58fc8d52a59fbe --- setup.py +++ setup.py @@ -3,7 +3,7 @@ # Setup file for dulwich # Copyright (C) 2008-2022 Jelmer Vernooij -from setuptools import setup, Extension, Distribution +from setuptools import setup, Extension import os import sys @@ -14,25 +14,6 @@ if sys.version_info < (3, 6): 'For 2.7 support, please install a version prior to 0.20') -dulwich_version_string = '0.20.46' - - -class DulwichDistribution(Distribution): - - def is_pure(self): - if self.pure: - return True - - def has_ext_modules(self): - return not self.pure - - global_options = Distribution.global_options + [ - ('pure', None, "use pure Python code instead of C " - "extensions (slower on CPython)")] - - pure = False - - if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'): # XCode 4.0 dropped support for ppc architecture, which is hardcoded in # distutils.sysconfig @@ -56,15 +37,18 @@ if '__pypy__' not in sys.modules and sys.platform != ' 'gevent', 'geventhttpclient', 'setuptools>=17.1']) +optional = os.environ.get('CIBUILDWHEEL', '0') != '1' + + ext_modules = [ - Extension('dulwich._objects', ['dulwich/_objects.c']), - Extension('dulwich._pack', ['dulwich/_pack.c']), - Extension('dulwich._diff_tree', ['dulwich/_diff_tree.c']), + Extension('dulwich._objects', ['dulwich/_objects.c'], + optional=optional), + Extension('dulwich._pack', ['dulwich/_pack.c'], + optional=optional), + Extension('dulwich._diff_tree', ['dulwich/_diff_tree.c'], + optional=optional), ] - -setup(keywords="git vcs", - package_data={'': ['../docs/tutorial/*.txt', 'py.typed']}, +setup(package_data={'': ['../docs/tutorial/*.txt', 'py.typed']}, ext_modules=ext_modules, - distclass=DulwichDistribution, # type: ignore tests_require=tests_require)