commit eb409c082b7fd173c9633b481c67e96331083062 from: Jelmer Vernooij via: GitHub date: Fri Oct 21 07:19:21 2022 UTC Merge pull request #1070 from jelmer/setup.cfg-optional-exts Use standard infrastructure to mark extensions as optional commit - 8fa8c678122e2da16b5a37496ded5605b67cbd81 commit + eb409c082b7fd173c9633b481c67e96331083062 blob - ed03ded03f771fbc687348894609170f83f7ee37 blob + 493f6405273ca7755867e020dc403490e815a358 --- CONTRIBUTING.rst +++ CONTRIBUTING.rst @@ -9,7 +9,7 @@ New functionality and bug fixes should be accompanied Coding style ------------ -Where possible, please follow PEP8 with regard to coding style. +Where possible, please follow PEP8 with regard to coding style. Run flake8. Furthermore, triple-quotes should always be """, single quotes are ' unless using " would result in less escaping within the string. @@ -26,7 +26,7 @@ will run the tests using unittest. :: $ make check -Tox configuration is also present as well as a Travis configuration file. +Tox configuration is also present. String Types ------------ blob - 14647e0efffdd73b2fdfde3c6a8a9513002db6e4 blob + c2c39f007c6434f4a1d794f73630028ee2de7b36 --- disperse.conf +++ disperse.conf @@ -3,13 +3,7 @@ news_file: "NEWS" timeout_days: 5 tag_name: "dulwich-$VERSION" verify_command: "flake8 && make check" -github_url: "https://github.com/dulwich/dulwich" update_version { - path: "setup.py" - match: "^dulwich_version_string = '(.*)'$" - new_line: "dulwich_version_string = '$VERSION'" -} -update_version { path: "dulwich/__init__.py" match: "^__version__ = \((.*)\)$" new_line: "__version__ = $TUPLED_VERSION" 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)