From nobody Wed Jan 19 15:10:31 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D7CAD1961631; Wed, 19 Jan 2022 15:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jf8GH5jBDz4Rc8; Wed, 19 Jan 2022 15:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642605031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=biz9sjyOEDhRRAr9KUQYnxPBUKqJh+TdR/W7np9doH4=; b=uCEJzgMyBPNk+MScSBBVcX3T9l6Nh2CYwtdJDnpDvVb31PH0bf0GUS177rTm3lqccYhqT6 IyC5rKWKz9bo4hNCxsjJWkm79FBanefPUQhm2Hn7xQimt1zMVLG/v8dFGpndY6U4u4u6dh RctFU4Im/HoNrEZrfH8fDHRdtJolUb350168h/5NauQ/xPWvi8D9g7novBcuB6GK3mTaso 31tCxpLYoNChCEdyQjM5G8/If/zUVFoCww0AAnMnqhaegdFvJGVDtDd/UHJKalIvuZJvNb KJnOfCtgsut+m8FU6zKv7e8BwSJtcPPQ7hT4FXCNxtk1Um+AnwcVeXCo5VSoHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3B5416D62; Wed, 19 Jan 2022 15:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20JFAVTo073045; Wed, 19 Jan 2022 15:10:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20JFAV8d073044; Wed, 19 Jan 2022 15:10:31 GMT (envelope-from git) Date: Wed, 19 Jan 2022 15:10:31 GMT Message-Id: <202201191510.20JFAV8d073044@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jose Alonso Cardenas Marquez Subject: git: 9d8c3018ff4c - main - devel/py-atpublic: Fix build List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: acm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d8c3018ff4c2e2d91c9c23af79aac8d5fc6174b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642605031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=biz9sjyOEDhRRAr9KUQYnxPBUKqJh+TdR/W7np9doH4=; b=RXqsyFZ6epbXcEKqjAB7ZNTek0EFgI79sTWo8/AdzZP7sAj1nRJJjdABnvXu4P/mxw4LPd qHgCnrz/hVIcddPi726gUoMdo7geqqNLOFZHqNl98TZA4gSF+PwFfH5TK7RObQ7en+jnba 5VKXp3Yv91/4Rcaq+VfbZ28rn6KrtQ88imEpI7U+LnzpyU9KLu4R+eQmC4aeZ9motVjG95 6wkRtmTO/SakeYkKEpejx9dN0vOy9qKxgj9b4Ig5kOEsuL2dRuJz1gKlGl5FkEgN2/gOM2 w27UBr5mAfyIxVFscJdZrTCDAWOi7XAxNBX6eSsw63ofstVhII3FbFYXuTfMLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642605031; a=rsa-sha256; cv=none; b=FTMNCyPToiA/8NV+UabKOC8e7GskDN8Yndi3EFbocNEaRxcESkAs+oCmgkuAp++/etmUdu rAd+N6IDn/ez/unzmxXXfH6wHJmWnHG7s3wIi/l60ZdSuyw9PpX+Fv8Y6SMWS+sJ2rL7OA hRO6g5IHyodFRSA9mWe9/4UWo/RzmwD0ckowXcyyTOcClyIOsLuD3M6z38x/m9FI7nDrKJ sFKnzSWcacDMPG4LRMMnHsOMnUXr9AtvGIrzg7yz/l3EHR+d5Lj3BfsluORc1d9SpW97Cx 2QQiDk1LaVCrOFwBrHbR0E6FAuXGpwaUN5CR0lTgObP8oNQWDVkx7DQqMU+r3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by acm: URL: https://cgit.FreeBSD.org/ports/commit/?id=9d8c3018ff4c2e2d91c9c23af79aac8d5fc6174b commit 9d8c3018ff4c2e2d91c9c23af79aac8d5fc6174b Author: Jose Alonso Cardenas Marquez AuthorDate: 2022-01-19 15:06:24 +0000 Commit: Jose Alonso Cardenas Marquez CommitDate: 2022-01-19 15:06:24 +0000 devel/py-atpublic: Fix build - Latest version of py-atpublic removed support for setup.py. I am adding setup stuff for fix current problem PR: 261270 Reported by: yasu --- devel/py-atpublic/Makefile | 5 +- devel/py-atpublic/files/setup.cfg | 76 +++++++++++++++ devel/py-atpublic/files/setup.py | 55 +++++++++++ devel/py-atpublic/files/setup_helpers.py | 153 +++++++++++++++++++++++++++++++ 4 files changed, 288 insertions(+), 1 deletion(-) diff --git a/devel/py-atpublic/Makefile b/devel/py-atpublic/Makefile index ed1e5a1ceb12..5a81c4ff5b73 100644 --- a/devel/py-atpublic/Makefile +++ b/devel/py-atpublic/Makefile @@ -9,9 +9,12 @@ COMMENT= Very simple decorator and function of module's all LICENSE= APACHE20 -USES= python:3.3+ +USES= python:3.8+ USE_PYTHON= autoplist distutils MAKE_ENV= ATPUBLIC_BUILD_EXTENSION=1 +post-extract: + ${CP} ${FILESDIR}/setup* ${WRKSRC} + .include diff --git a/devel/py-atpublic/files/setup.cfg b/devel/py-atpublic/files/setup.cfg new file mode 100644 index 000000000000..f1ef71fac8f9 --- /dev/null +++ b/devel/py-atpublic/files/setup.cfg @@ -0,0 +1,76 @@ +[tool:pytest] +addopts = --cov=src/public +testpaths = test docs + +[flake8] +exclude = conf.py +jobs = 1 +max-line-length = 79 + +[coverage:report] +fail_under = 100 +show_missing = true + +[coverage:run] +branch = true +parallel = true +omit = + +[coverage:paths] +source = + src/public + +[tool:isort] +include_trailing_comma = true +known_first_party = public +length_sort_straight = true +lines_after_imports = 2 +lines_between_types = 1 +multi_line_output = 3 +order_by_type = false +skip = conf.py + +[mypy] +namespace_packages = true + +# Disallow dynamic typing +disallow_any_generics = true +disallow_subclassing_any = true + +# Untyped definitions and calls +disallow_untyped_calls = false +disallow_untyped_defs = true +disallow_incomplete_defs = true +check_untyped_defs = true +disallow_untyped_decorators = false + +# None and Optional handling +no_implicit_optional = true + +# Configuring warnings +warn_redundant_casts = true +warn_unused_ignores = true +warn_no_return = true +warn_return_any = true +warn_unreachable = true + +# Miscellaneous strictness flags +implicit_reexport = false +strict_equality = true + +# Configuring error messages +show_error_context = true +show_column_numbers = true +show_error_codes = true +pretty = true +show_absolute_path = true + +# Miscellaneous +warn_unused_configs = true +verbosity = 0 + +[mypy-pytest] +ignore_missing_imports = true + +[mypy-sybil.*] +ignore_missing_imports = true diff --git a/devel/py-atpublic/files/setup.py b/devel/py-atpublic/files/setup.py new file mode 100644 index 000000000000..385c5d8f70ba --- /dev/null +++ b/devel/py-atpublic/files/setup.py @@ -0,0 +1,55 @@ +"""public -- @public for populating __all__""" + +from setup_helpers import get_version, require_python +from setuptools import setup, find_packages + +require_python(0x30800f0) +__version__ = get_version('src/public/__init__.py') + + +with open('README.rst') as fp: + readme = fp.read() + + +setup( + name='atpublic', + version=__version__, + author='Barry Warsaw', + author_email='barry@python.org', + description=__doc__, + long_description=readme, + long_description_content_type='text/x-rst', + license='Apache 2.0', + keywords='__all__ public', + url='http://public.readthedocs.io/', + packages=["src/public"], + include_package_data=True, + package_data={ + 'public': ['src/public/py.typed'], + }, + # readthedocs builds fail unless zip_safe is False. + zip_safe=False, + python_requires='>=3.8', + install_requires=[ + 'typing_extensions;python_version<"3.8"', + ], + project_urls={ + 'Documentation': 'https://public.readthedocs.io', + 'Source': 'https://gitlab.com/warsaw/public.git', + 'Tracker': 'https://gitlab.com/warsaw/public/issues', + }, + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Development Status :: 6 - Mature', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: POSIX', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Utilities', + ], + ) diff --git a/devel/py-atpublic/files/setup_helpers.py b/devel/py-atpublic/files/setup_helpers.py new file mode 100644 index 000000000000..52c6fd34e952 --- /dev/null +++ b/devel/py-atpublic/files/setup_helpers.py @@ -0,0 +1,153 @@ +# Copyright (C) 2009-2017 Barry Warsaw +# +# This file is part of setup_helpers.py +# +# setup_helpers.py is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation, version 3 of the License. +# +# setup_helpers.py is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with setup_helpers.py. If not, see . + +"""setup.py helper functions.""" + +from __future__ import absolute_import, print_function, unicode_literals + + +__metaclass__ = type +__all__ = [ + 'description', + 'find_doctests', + 'get_version', + 'long_description', + 'require_python', + ] + + +import os +import re +import sys + + +DEFAULT_VERSION_RE = re.compile( + r'(?P\d+\.\d+(?:\.\d+)?(?:(?:a|b|rc)\d+)?)') +EMPTYSTRING = '' + +__version__ = '3.0' + + +def require_python(minimum): + """Require at least a minimum Python version. + + The version number is expressed in terms of `sys.hexversion`. E.g. to + require a minimum of Python 2.6, use:: + + >>> require_python(0x206000f0) + + :param minimum: Minimum Python version supported. + :type minimum: integer + """ + if sys.hexversion < minimum: + hversion = hex(minimum)[2:] + if len(hversion) % 2 != 0: + hversion = '0' + hversion + split = list(hversion) + parts = [] + while split: + parts.append(int(''.join((split.pop(0), split.pop(0))), 16)) + major, minor, micro, release = parts + if release == 0xf0: + print('Python {0}.{1}.{2} or better is required'.format( + major, minor, micro)) + else: + print('Python {0}.{1}.{2} ({3}) or better is required'.format( + major, minor, micro, hex(release)[2:])) + sys.exit(1) + + +def get_version(filename, pattern=None): + """Extract the __version__ from a file without importing it. + + While you could get the __version__ by importing the module, the very act + of importing can cause unintended consequences. For example, Distribute's + automatic 2to3 support will break. Instead, this searches the file for a + line that starts with __version__, and extract the version number by + regular expression matching. + + By default, two or three dot-separated digits are recognized, but by + passing a pattern parameter, you can recognize just about anything. Use + the `version` group name to specify the match group. + + :param filename: The name of the file to search. + :type filename: string + :param pattern: Optional alternative regular expression pattern to use. + :type pattern: string + :return: The version that was extracted. + :rtype: string + """ + if pattern is None: + cre = DEFAULT_VERSION_RE + else: + cre = re.compile(pattern) + with open(filename) as fp: + for line in fp: + if line.startswith('__version__'): + mo = cre.search(line) + assert mo, 'No valid __version__ string found' + return mo.group('version') + raise AssertionError('No __version__ assignment found') + + +def find_doctests(start='.', extension='.rst'): + """Find separate-file doctests in the package. + + This is useful for Distribute's automatic 2to3 conversion support. The + `setup()` keyword argument `convert_2to3_doctests` requires file names, + which may be difficult to track automatically as you add new doctests. + + :param start: Directory to start searching in (default is cwd) + :type start: string + :param extension: Doctest file extension (default is .txt) + :type extension: string + :return: The doctest files found. + :rtype: list + """ + doctests = [] + for dirpath, dirnames, filenames in os.walk(start): + doctests.extend(os.path.join(dirpath, filename) + for filename in filenames + if filename.endswith(extension)) + return doctests + + +def long_description(*filenames): + """Provide a long description.""" + res = [''] + for filename in filenames: + with open(filename) as fp: + for line in fp: + res.append(' ' + line) + res.append('') + res.append('\n') + return EMPTYSTRING.join(res) + + +def description(filename): + """Provide a short description.""" + # This ends up in the Summary header for PKG-INFO and it should be a + # one-liner. It will get rendered on the package page just below the + # package version header but above the long_description, which ironically + # gets stuff into the Description header. It should not include reST, so + # pick out the first single line after the double header. + with open(filename) as fp: + for lineno, line in enumerate(fp): + if lineno < 3: + continue + line = line.strip() + if len(line) > 0: + return line