MFH: r515848

www/py-cheroot: Update to 6.5.6

* There is currently a signification amount of version churn in the upstream
  repository so use the most recent signed release for now.

* Since release 6.3.0 the port installs a CLI tool outside the Python
  environment thus make it concurrent safe.

* Also backport two patches to retain compatibility with recent versions of
  devel/py-setuptools and avoid failures at runtime with Python 3 while I'm
  here. [1]

Changelog since 6.0.0:

https://github.com/cherrypy/cheroot/blob/v6.5.6/CHANGES.rst

PR:		241369
Submitted by:	Keith Gaughan <k@stereochro.me> (maintainer)
Approved by:	Keith Gaughan <k@stereochro.me> (maintainer) [1]

Approved by:	ports-secteam (miwi)
This commit is contained in:
Kai Knoblich 2019-10-30 00:05:58 +00:00
parent 5c659183bf
commit 12b1a135e0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2019Q4/; revision=516042
4 changed files with 176 additions and 7 deletions

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= cheroot
DISTVERSION= 6.0.0
PORTREVISION= 1
DISTVERSION= 6.5.6
CATEGORIES= www python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -14,11 +13,12 @@ COMMENT= Highly-optimized, pure-python HTTP server
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.md
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>=1.15.0:devel/py-setuptools_scm@${PY_FLAVOR}
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>=1.15.0:devel/py-setuptools_scm@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}setuptools_scm_git_archive>=1.0:devel/py-setuptools_scm_git_archive@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>=1.11.0:devel/py-six@${PY_FLAVOR}
USES= python
USE_PYTHON= distutils autoplist
USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
@ -30,4 +30,8 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}more-itertools>=2.6:devel/py-more-itertools
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}more-itertools5>=2.6:devel/py-more-itertools5@${PY_FLAVOR}
.endif
.if ${PYTHON_REL} < 3300
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}backports.functools_lru_cache>0:devel/py-backports.functools_lru_cache@${PY_FLAVOR}
.endif
.include <bsd.port.post.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1513882382
SHA256 (cheroot-6.0.0.tar.gz) = ba474e5149b03fabc2bba2d0b490b4d95443894d45b1430b799dccea3b3f4683
SIZE (cheroot-6.0.0.tar.gz) = 62763
TIMESTAMP = 1571548810
SHA256 (cheroot-6.5.6.tar.gz) = b824f9961eb447809badeb051820a05770354e2f9ae5c355eecc21f22633c217
SIZE (cheroot-6.5.6.tar.gz) = 84633

View File

@ -0,0 +1,16 @@
Backport patch from 6.6.0 to only require backports.functools_lru_cache for
Python < 3.3
https://github.com/cherrypy/cheroot/commit/18447cbee7135f3f5017c8f6a9607dc1f7259570
--- setup.cfg.orig 2019-08-18 22:27:10 UTC
+++ setup.cfg
@@ -57,7 +57,7 @@ setup_requires =
setuptools_scm>=1.15.0
setuptools_scm_git_archive>=1.0
install_requires =
- backports.functools_lru_cache
+ backports.functools_lru_cache ; python_version < '3.3'
six>=1.11.0
more_itertools>=2.6

View File

@ -0,0 +1,149 @@
Backported from 8.0 to be compatible with devel/py-setuptools >= 41.4.0
https://github.com/cherrypy/cheroot/commit/2fe8459086c75b216f9e5efb69963596d6372234
--- setup.py.orig 2019-08-18 22:26:46 UTC
+++ setup.py
@@ -1,138 +1,8 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
+
"""Cheroot package setuptools installer."""
import setuptools
-
-try:
- from setuptools.config import read_configuration, ConfigOptionsHandler
- import setuptools.config
- import setuptools.dist
-
- # Set default value for 'use_scm_version'
- setattr(setuptools.dist.Distribution, 'use_scm_version', False)
-
- # Attach bool parser to 'use_scm_version' option
- class ShimConfigOptionsHandler(ConfigOptionsHandler):
- """Extension class for ConfigOptionsHandler."""
-
- @property
- def parsers(self):
- """Return an option mapping with default data type parsers."""
- _orig_parsers = super(ShimConfigOptionsHandler, self).parsers
- return dict(use_scm_version=self._parse_bool, **_orig_parsers)
-
- setuptools.config.ConfigOptionsHandler = ShimConfigOptionsHandler
-except ImportError:
- """This is a shim for setuptools<30.3."""
- import io
- import json
-
- try:
- from configparser import ConfigParser, NoSectionError
- except ImportError:
- from ConfigParser import ConfigParser, NoSectionError
- ConfigParser.read_file = ConfigParser.readfp
-
- def maybe_read_files(d):
- """Read files if the string starts with `file:` marker."""
- d = d.strip()
- if not d.startswith('file:'):
- return d
- descs = []
- for fname in map(str.strip, d[5:].split(',')):
- with io.open(fname, encoding='utf-8') as f:
- descs.append(f.read())
- return ''.join(descs)
-
- def cfg_val_to_list(v):
- """Turn config val to list and filter out empty lines."""
- return list(filter(bool, map(str.strip, v.strip().splitlines())))
-
- def cfg_val_to_dict(v):
- """Turn config val to dict and filter out empty lines."""
- return dict(
- map(
- lambda l: list(map(str.strip, l.split('=', 1))),
- filter(bool, map(str.strip, v.strip().splitlines())),
- ),
- )
-
- def cfg_val_to_primitive(v):
- """Parse primitive config val to appropriate data type."""
- return json.loads(v.strip().lower())
-
- def read_configuration(filepath):
- """Read metadata and options from setup.cfg located at filepath."""
- cfg = ConfigParser()
- with io.open(filepath, encoding='utf-8') as f:
- cfg.read_file(f)
-
- md = dict(cfg.items('metadata'))
- for list_key in 'classifiers', 'keywords':
- try:
- md[list_key] = cfg_val_to_list(md[list_key])
- except KeyError:
- pass
- try:
- md['long_description'] = maybe_read_files(md['long_description'])
- except KeyError:
- pass
- opt = dict(cfg.items('options'))
- for list_key in 'use_scm_version', 'zip_safe':
- try:
- opt[list_key] = cfg_val_to_primitive(opt[list_key])
- except KeyError:
- pass
- for list_key in 'scripts', 'install_requires', 'setup_requires':
- try:
- opt[list_key] = cfg_val_to_list(opt[list_key])
- except KeyError:
- pass
- try:
- opt['package_dir'] = cfg_val_to_dict(opt['package_dir'])
- except KeyError:
- pass
- opt_package_data = dict(cfg.items('options.package_data'))
- try:
- if not opt_package_data.get('', '').strip():
- opt_package_data[''] = opt_package_data['*']
- del opt_package_data['*']
- except KeyError:
- pass
- try:
- opt_extras_require = dict(cfg.items('options.extras_require'))
- opt['extras_require'] = {}
- for k, v in opt_extras_require.items():
- opt['extras_require'][k] = cfg_val_to_list(v)
- except NoSectionError:
- pass
- opt['package_data'] = {}
- for k, v in opt_package_data.items():
- opt['package_data'][k] = cfg_val_to_list(v)
- cur_pkgs = opt.get('packages', '').strip()
- if '\n' in cur_pkgs:
- opt['packages'] = cfg_val_to_list(opt['packages'])
- elif cur_pkgs.startswith('find:'):
- opt_packages_find = dict(cfg.items('options.packages.find'))
- 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)
+if __name__ == '__main__':
+ setuptools.setup(use_scm_version=True)