View | Details | Raw Unified | Return to bug 241369 | Differences between
and this patch

Collapse All | Expand All

(-)www/py-cheroot/Makefile (-4 / +8 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	cheroot
4
PORTNAME=	cheroot
5
DISTVERSION=	6.0.0
5
DISTVERSION=	6.5.6
6
PORTREVISION=	1
7
CATEGORIES=	www python
6
CATEGORIES=	www python
8
MASTER_SITES=	CHEESESHOP
7
MASTER_SITES=	CHEESESHOP
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
Lines 14-24 Link Here
14
LICENSE=	BSD3CLAUSE
13
LICENSE=	BSD3CLAUSE
15
LICENSE_FILE=	${WRKSRC}/LICENSE.md
14
LICENSE_FILE=	${WRKSRC}/LICENSE.md
16
15
17
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools_scm>=1.15.0:devel/py-setuptools_scm@${PY_FLAVOR}
16
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools_scm>=1.15.0:devel/py-setuptools_scm@${PY_FLAVOR} \
17
		${PYTHON_PKGNAMEPREFIX}setuptools_scm_git_archive>=1.0:devel/py-setuptools_scm_git_archive@${PY_FLAVOR}
18
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}six>=1.11.0:devel/py-six@${PY_FLAVOR}
18
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}six>=1.11.0:devel/py-six@${PY_FLAVOR}
19
19
20
USES=		python
20
USES=		python
21
USE_PYTHON=	distutils autoplist
21
USE_PYTHON=	autoplist concurrent distutils
22
22
23
NO_ARCH=	yes
23
NO_ARCH=	yes
24
24
Lines 30-33 Link Here
30
RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}more-itertools5>=2.6:devel/py-more-itertools5@${PY_FLAVOR}
30
RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}more-itertools5>=2.6:devel/py-more-itertools5@${PY_FLAVOR}
31
.endif
31
.endif
32
32
33
.if ${PYTHON_REL} < 3300
34
RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}backports.functools_lru_cache>0:devel/py-backports.functools_lru_cache@${PY_FLAVOR}
35
.endif
36
33
.include <bsd.port.post.mk>
37
.include <bsd.port.post.mk>
(-)www/py-cheroot/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1513882382
1
TIMESTAMP = 1571548810
2
SHA256 (cheroot-6.0.0.tar.gz) = ba474e5149b03fabc2bba2d0b490b4d95443894d45b1430b799dccea3b3f4683
2
SHA256 (cheroot-6.5.6.tar.gz) = b824f9961eb447809badeb051820a05770354e2f9ae5c355eecc21f22633c217
3
SIZE (cheroot-6.0.0.tar.gz) = 62763
3
SIZE (cheroot-6.5.6.tar.gz) = 84633
(-)www/py-cheroot/files/patch-setup.cfg (+16 lines)
Line 0 Link Here
1
Backport patch from 6.6.0 to only require backports.functools_lru_cache for
2
Python < 3.3
3
4
https://github.com/cherrypy/cheroot/commit/18447cbee7135f3f5017c8f6a9607dc1f7259570
5
6
--- setup.cfg.orig	2019-08-18 22:27:10 UTC
7
+++ setup.cfg
8
@@ -57,7 +57,7 @@ setup_requires = 
9
 	setuptools_scm>=1.15.0
10
 	setuptools_scm_git_archive>=1.0
11
 install_requires = 
12
-	backports.functools_lru_cache
13
+	backports.functools_lru_cache ; python_version < '3.3'
14
 	six>=1.11.0
15
 	more_itertools>=2.6
16
 
(-)www/py-cheroot/files/patch-setup.py (+147 lines)
Line 0 Link Here
1
Backported from 8.0 to make it work with devel/py-setuptools >= 41.4.0
2
3
--- setup.py.orig	2019-08-18 22:26:46 UTC
4
+++ setup.py
5
@@ -1,138 +1,8 @@
6
-#! /usr/bin/env python
7
+#!/usr/bin/env python
8
+
9
 """Cheroot package setuptools installer."""
10
 
11
 import setuptools
12
 
13
-
14
-try:
15
-    from setuptools.config import read_configuration, ConfigOptionsHandler
16
-    import setuptools.config
17
-    import setuptools.dist
18
-
19
-    # Set default value for 'use_scm_version'
20
-    setattr(setuptools.dist.Distribution, 'use_scm_version', False)
21
-
22
-    # Attach bool parser to 'use_scm_version' option
23
-    class ShimConfigOptionsHandler(ConfigOptionsHandler):
24
-        """Extension class for ConfigOptionsHandler."""
25
-
26
-        @property
27
-        def parsers(self):
28
-            """Return an option mapping with default data type parsers."""
29
-            _orig_parsers = super(ShimConfigOptionsHandler, self).parsers
30
-            return dict(use_scm_version=self._parse_bool, **_orig_parsers)
31
-
32
-    setuptools.config.ConfigOptionsHandler = ShimConfigOptionsHandler
33
-except ImportError:
34
-    """This is a shim for setuptools<30.3."""
35
-    import io
36
-    import json
37
-
38
-    try:
39
-        from configparser import ConfigParser, NoSectionError
40
-    except ImportError:
41
-        from ConfigParser import ConfigParser, NoSectionError
42
-        ConfigParser.read_file = ConfigParser.readfp
43
-
44
-    def maybe_read_files(d):
45
-        """Read files if the string starts with `file:` marker."""
46
-        d = d.strip()
47
-        if not d.startswith('file:'):
48
-            return d
49
-        descs = []
50
-        for fname in map(str.strip, d[5:].split(',')):
51
-            with io.open(fname, encoding='utf-8') as f:
52
-                descs.append(f.read())
53
-        return ''.join(descs)
54
-
55
-    def cfg_val_to_list(v):
56
-        """Turn config val to list and filter out empty lines."""
57
-        return list(filter(bool, map(str.strip, v.strip().splitlines())))
58
-
59
-    def cfg_val_to_dict(v):
60
-        """Turn config val to dict and filter out empty lines."""
61
-        return dict(
62
-            map(
63
-                lambda l: list(map(str.strip, l.split('=', 1))),
64
-                filter(bool, map(str.strip, v.strip().splitlines())),
65
-            ),
66
-        )
67
-
68
-    def cfg_val_to_primitive(v):
69
-        """Parse primitive config val to appropriate data type."""
70
-        return json.loads(v.strip().lower())
71
-
72
-    def read_configuration(filepath):
73
-        """Read metadata and options from setup.cfg located at filepath."""
74
-        cfg = ConfigParser()
75
-        with io.open(filepath, encoding='utf-8') as f:
76
-            cfg.read_file(f)
77
-
78
-        md = dict(cfg.items('metadata'))
79
-        for list_key in 'classifiers', 'keywords':
80
-            try:
81
-                md[list_key] = cfg_val_to_list(md[list_key])
82
-            except KeyError:
83
-                pass
84
-        try:
85
-            md['long_description'] = maybe_read_files(md['long_description'])
86
-        except KeyError:
87
-            pass
88
-        opt = dict(cfg.items('options'))
89
-        for list_key in 'use_scm_version', 'zip_safe':
90
-            try:
91
-                opt[list_key] = cfg_val_to_primitive(opt[list_key])
92
-            except KeyError:
93
-                pass
94
-        for list_key in 'scripts', 'install_requires', 'setup_requires':
95
-            try:
96
-                opt[list_key] = cfg_val_to_list(opt[list_key])
97
-            except KeyError:
98
-                pass
99
-        try:
100
-            opt['package_dir'] = cfg_val_to_dict(opt['package_dir'])
101
-        except KeyError:
102
-            pass
103
-        opt_package_data = dict(cfg.items('options.package_data'))
104
-        try:
105
-            if not opt_package_data.get('', '').strip():
106
-                opt_package_data[''] = opt_package_data['*']
107
-                del opt_package_data['*']
108
-        except KeyError:
109
-            pass
110
-        try:
111
-            opt_extras_require = dict(cfg.items('options.extras_require'))
112
-            opt['extras_require'] = {}
113
-            for k, v in opt_extras_require.items():
114
-                opt['extras_require'][k] = cfg_val_to_list(v)
115
-        except NoSectionError:
116
-            pass
117
-        opt['package_data'] = {}
118
-        for k, v in opt_package_data.items():
119
-            opt['package_data'][k] = cfg_val_to_list(v)
120
-        cur_pkgs = opt.get('packages', '').strip()
121
-        if '\n' in cur_pkgs:
122
-            opt['packages'] = cfg_val_to_list(opt['packages'])
123
-        elif cur_pkgs.startswith('find:'):
124
-            opt_packages_find = dict(cfg.items('options.packages.find'))
125
-            opt['packages'] = setuptools.find_packages(**opt_packages_find)
126
-        return {'metadata': md, 'options': opt}
127
-
128
-
129
-setup_params = {}
130
-declarative_setup_params = read_configuration('setup.cfg')
131
-
132
-# Patch incorrectly decoded package_dir option
133
-# ``egg_info`` demands native strings failing with unicode under Python 2
134
-# Ref https://github.com/pypa/setuptools/issues/1136
135
-if 'package_dir' in declarative_setup_params['options']:
136
-    declarative_setup_params['options']['package_dir'] = {
137
-        str(k): str(v)
138
-        for k, v in declarative_setup_params['options']['package_dir'].items()
139
-    }
140
-
141
-setup_params = dict(setup_params, **declarative_setup_params['metadata'])
142
-setup_params = dict(setup_params, **declarative_setup_params['options'])
143
-
144
-
145
-__name__ == '__main__' and setuptools.setup(**setup_params)
146
+if __name__ == '__main__':
147
+    setuptools.setup(use_scm_version=True)

Return to bug 241369