Skip to content

Commit

Permalink
Fix build with various Python versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonn committed Dec 21, 2019
1 parent c8b6558 commit afa2ef2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/py-cheroot/distinfo
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
$NetBSD: distinfo,v 1.23 2019/09/18 20:23:12 adam Exp $
$NetBSD: distinfo,v 1.24 2019/12/21 23:51:56 joerg Exp $

SHA1 (cheroot-6.5.8.tar.gz) = fb7f6e0eab185b36ac754bd26fd3ca8a40b810e3
RMD160 (cheroot-6.5.8.tar.gz) = 02e2cc0314d587e93b71b4cfd4353a0d0b8a9486
SHA512 (cheroot-6.5.8.tar.gz) = 5abdf51ddb48b2519c795c5bcefce3d024dbf0fa0f881e94060444d9f5051a2e15b71aa0b3e2823dd7cd8b0e5f1b778580342332bbd3456c61e5493a84199966
Size (cheroot-6.5.8.tar.gz) = 86158 bytes
SHA1 (patch-setup.cfg) = a8e2352c4ca85c82fddc375bb3912a2581307679
SHA1 (patch-setup.py) = d3261389a4422608df336940e73de6634633574c
14 changes: 14 additions & 0 deletions www/py-cheroot/patches/patch-setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$NetBSD: patch-setup.cfg,v 1.1 2019/12/21 23:51:56 joerg Exp $

Python 2.7 doesn't extract the version otherwise.
--- setup.cfg.orig 2019-12-21 21:46:41.214063294 +0000
+++ setup.cfg
@@ -6,6 +6,7 @@ universal = 1
[metadata]
name = cheroot
+version = 6.5.8
url = https://cheroot.cherrypy.org
project_urls =
CI: AppVeyor = https://ci.appveyor.com/project/cherrypy/cheroot
29 changes: 29 additions & 0 deletions www/py-cheroot/patches/patch-setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$NetBSD: patch-setup.py,v 1.1 2019/12/21 23:51:56 joerg Exp $

Drop Python 2 hack that breaks more than it fixes.

--- setup.py.orig 2019-09-05 09:21:53.000000000 +0000
+++ setup.py
@@ -118,21 +118,4 @@ except ImportError:
opt['packages'] = setuptools.find_packages(**opt_packages_find)
return {'metadata': md, 'options': opt}

-
-setup_params = {}
-declarative_setup_params = read_configuration('setup.cfg')
-
-# Patch incorrectly decoded package_dir option
-# ``egg_info`` demands native strings failing with unicode under Python 2
-# Ref https://github.com/pypa/setuptools/issues/1136
-if 'package_dir' in declarative_setup_params['options']:
- declarative_setup_params['options']['package_dir'] = {
- str(k): str(v)
- for k, v in declarative_setup_params['options']['package_dir'].items()
- }
-
-setup_params = dict(setup_params, **declarative_setup_params['metadata'])
-setup_params = dict(setup_params, **declarative_setup_params['options'])
-
-
-__name__ == '__main__' and setuptools.setup(**setup_params)
+__name__ == '__main__' and setuptools.setup()

0 comments on commit afa2ef2

Please sign in to comment.