Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-atpublic for openSUSE:Factory checked in at 2022-12-06 14:22:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-atpublic (Old) and /work/SRC/openSUSE:Factory/.python-atpublic.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-atpublic" Tue Dec 6 14:22:43 2022 rev:5 rq:1040386 version:3.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-atpublic/python-atpublic.changes 2022-01-13 23:21:53.300065026 +0100 +++ /work/SRC/openSUSE:Factory/.python-atpublic.new.1835/python-atpublic.changes 2022-12-06 14:22:45.913372469 +0100 @@ -1,0 +2,26 @@ +Sun Dec 4 20:31:51 UTC 2022 - Torsten Gruner <simmpho...@opensuse.org> + +- Update to v3.1.1 + * Improvements to the GitLab CI integration. + +- version 3.1 (2022-08-27) + * Fix a typo in pyproject.toml file. + * Exclude certain local cache files from the sdist/wheel. + * Add support for Python 3.11. + * Updates for pdm and dependencies. + +- version 3.0.1 (2022-01-10) + * Fix a typo in the README.rst. + +- version 3.0 (2022-01-10) + * Use modern package management by adopting pdm and pyproject.toml, and dropping setup.py and setup.cfg. + * Build the docs with Python 3.8. + * Update to version 3.0 of Sybil. + * Adopt the Furo documentation theme. + * Use importlib.metadata.version() as a better way to get the package version number for the documentation. + * Drop Python 3.6 support. + * Update Windows GitLab runner to include Python 3.10. + * Update copyright years. + * The master branch is renamed to main. (GL#11) + +------------------------------------------------------------------- Old: ---- atpublic-2.3.tar.gz New: ---- _multibuild atpublic-3.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-atpublic.spec ++++++ --- /var/tmp/diff_new_pack.UF77gK/_old 2022-12-06 14:22:46.377375014 +0100 +++ /var/tmp/diff_new_pack.UF77gK/_new 2022-12-06 14:22:46.385375058 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-atpublic # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,55 +16,68 @@ # -%{?!python_module:%define python_module() python3-%{**}} +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif %define skip_python2 1 Name: python-atpublic -Version: 2.3 +Version: 3.1.1 Release: 0 Summary: @public decorator for populating __all__ License: Apache-2.0 Group: Development/Languages/Python URL: http://public.readthedocs.io/ Source: https://gitlab.com/warsaw/public/-/archive/%{version}/public-%{version}.tar.gz#/atpublic-%{version}.tar.gz -BuildRequires: %{python_module devel} +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module pdm-pep517 >= 1.0} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-typing_extensions BuildArch: noarch +%if %{with test} # SECTION test requirements +BuildRequires: %{python_module atpublic} +BuildRequires: %{python_module coverage} +BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest} BuildRequires: %{python_module sybil} BuildRequires: %{python_module typing_extensions} # /SECTION +%endif %python_subpackages %description public -- @public for populating __all__. %prep -%setup -q -n public-%{version} -rm setup.cfg -# API change in sybil 3 -if [ -d %{python3_sitelib}/sybil-3*-info ]; then - sed -i 's/CodeBlockParser/PythonCodeBlockParser/' conftest.py -fi +%setup -q -n atpublic-%{version} %build -%python_build +%pyproject_wheel %install -%python_install - +%if !%{with test} +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%else %check %pytest +%endif +%if !%{with test} %files %{python_files} %doc docs/NEWS.rst README.rst %license LICENSE %{python_sitelib}/public %{python_sitelib}/atpublic-%{version}*-info +%endif %changelog ++++++ _multibuild ++++++ <multibuild> <package>test</package> </multibuild> ++++++ atpublic-2.3.tar.gz -> atpublic-3.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/.gitignore new/atpublic-3.1.1/.gitignore --- old/public-2.3/.gitignore 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -*.so -*.egg-info -build -.coverage -dist -htmlcov -coverage.xml -diffcov.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/.gitlab-ci.yml new/atpublic-3.1.1/.gitlab-ci.yml --- old/public-2.3/.gitlab-ci.yml 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/.gitlab-ci.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -linux job: - tags: - - linux - - image: quay.io/python-devs/ci-image:master - - script: - - tox - - -windows job: - tags: - - windows - - before_script: - # Allow chocolatey to install without confirmation. - - choco feature enable -n allowGlobalConfirmation - # Install latest stable Python (currently 3.9). - - choco install python -r - # Add default Python and its scripts to the Path. - - $ENV:Path+=";C:\Python39;C:\Python39\Scripts" - # Install older Pythons. - - choco install python -r --side-by-side --version=3.8.6 - - choco install python -r --side-by-side --version=3.7.9 - - choco install python -r --side-by-side --version=3.6.8 - # Upgrade/install the latest pip and tox. - - py -m pip install --upgrade pip - - py -3.8 -m pip install --upgrade pip - - py -3.7 -m pip install --upgrade pip - - py -3.6 -m pip install --upgrade pip - - py -m pip install tox - - script: - - tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/.readthedocs-req.txt new/atpublic-3.1.1/.readthedocs-req.txt --- old/public-2.3/.readthedocs-req.txt 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/.readthedocs-req.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -sphinx_autodoc_typehints diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/.readthedocs.yml new/atpublic-3.1.1/.readthedocs.yml --- old/public-2.3/.readthedocs.yml 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/.readthedocs.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +0,0 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -version: 2 - -sphinx: - configuration: docs/conf.py - -python: - version: 3.7 - install: - - requirements: .readthedocs-req.txt - - method: setuptools - path: . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/LICENSE new/atpublic-3.1.1/LICENSE --- old/public-2.3/LICENSE 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/LICENSE 2022-09-03 02:43:18.056890700 +0200 @@ -1,4 +1,4 @@ -Copyright 2016-2021 Barry Warsaw +Copyright 2016-2022 Barry Warsaw Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/MANIFEST.in new/atpublic-3.1.1/MANIFEST.in --- old/public-2.3/MANIFEST.in 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -include *.py MANIFEST.in LICENSE README.rst -global-include *.txt *.rst *.ini *.c *.h *.cfg py.typed -recursive-include test *.py -recursive-include docs *.py -exclude .gitignore -exclude *.so -prune build -prune dist -prune .tox -prune .git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/PKG-INFO new/atpublic-3.1.1/PKG-INFO --- old/public-2.3/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/atpublic-3.1.1/PKG-INFO 2022-09-03 02:43:54.018859000 +0200 @@ -0,0 +1,53 @@ +Metadata-Version: 2.1 +Name: atpublic +Version: 3.1.1 +Summary: Keep all y'all's __all__'s in sync +License: Apache-2.0 +Keywords: __all__,public,private +Author-email: Barry Warsaw <ba...@python.org> +Requires-Python: >=3.7 +Classifier: Development Status :: 5 - Production/Stable +Classifier: Development Status :: 6 - Mature +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: POSIX +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Utilities +Project-URL: Bug Tracker, https://gitlab.com/warsaw/public/issues +Project-URL: Documentation, https://public.readthedocs.io +Project-URL: Home Page, https://public.readthedocs.io +Project-URL: Source, https://gitlab.com/warsaw/public.git +Description-Content-Type: text/x-rst + +====================== + @public and @private +====================== + +This library provides two very simple decorators that document the +*publicness* of the names in your module. They keep your module's ``__all__`` +in sync so you don't have to. + + +Author +====== + +``public`` is Copyright (C) 2016-2022 Barry Warsaw <ba...@python.org> + +Licensed under the terms of the Apache License Version 2.0. See the LICENSE +file for details. + + +Project details +=============== + + * Project home: https://gitlab.com/warsaw/public + * Report bugs at: https://gitlab.com/warsaw/public/issues + * Code hosting: https://gitlab.com/warsaw/public.git + * Documentation: https://public.readthedocs.io + * PyPI: https://pypi.python.org/pypi/atpublic + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/README.rst new/atpublic-3.1.1/README.rst --- old/public-2.3/README.rst 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/README.rst 2022-09-03 02:43:18.056890700 +0200 @@ -10,7 +10,7 @@ Author ====== -``public`` is Copyright (C) 2016-2021 Barry Warsaw <ba...@python.org> +``public`` is Copyright (C) 2016-2022 Barry Warsaw <ba...@python.org> Licensed under the terms of the Apache License Version 2.0. See the LICENSE file for details. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/conftest.py new/atpublic-3.1.1/conftest.py --- old/public-2.3/conftest.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/conftest.py 2022-09-03 02:43:18.056890700 +0200 @@ -4,7 +4,7 @@ from contextlib import ExitStack, contextmanager from doctest import ELLIPSIS, REPORT_NDIFF, NORMALIZE_WHITESPACE from sybil import Sybil -from sybil.parsers.codeblock import CodeBlockParser +from sybil.parsers.codeblock import PythonCodeBlockParser from sybil.parsers.doctest import DocTestParser from tempfile import TemporaryDirectory from types import ModuleType @@ -94,7 +94,7 @@ pytest_collect_file = Sybil( parsers=[ DocTestParser(optionflags=DOCTEST_FLAGS), - CodeBlockParser(), + PythonCodeBlockParser(), ], pattern='*.rst', setup=namespace.setup, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/docs/NEWS.rst new/atpublic-3.1.1/docs/NEWS.rst --- old/public-2.3/docs/NEWS.rst 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/docs/NEWS.rst 2022-09-03 02:43:18.056890700 +0200 @@ -1,6 +1,37 @@ -============== - @public NEWS -============== +================== +@public change log +================== + +3.1.1 (2022-09-02) +================== +* Improvements to the GitLab CI integration. + +3.1 (2022-08-27) +================ +* Fix a typo in pyproject.toml file. +* Exclude certain local cache files from the sdist/wheel. +* Add support for Python 3.11. +* Updates for pdm and dependencies. + +3.0.1 (2022-01-10) +================== +* Fix a typo in the README.rst. + +3.0 (2022-01-10) +================ +* Use modern package management by adopting `pdm + <https://pdm.fming.dev/>`_ and ``pyproject.toml``, and dropping ``setup.py`` + and ``setup.cfg``. +* Build the docs with Python 3.8. +* Update to version 3.0 of `Sybil <https://sybil.readthedocs.io/en/latest/>`_. +* Adopt the `Furo <https://pradyunsg.me/furo/quickstart/>`_ documentation theme. +* Use `importlib.metadata.version() + <https://docs.python.org/3/library/importlib.metadata.html#distribution-versions>`_ + as a better way to get the package version number for the documentation. +* Drop Python 3.6 support. +* Update Windows GitLab runner to include Python 3.10. +* Update copyright years. +* The ``master`` branch is renamed to ``main``. (GL#11) 2.3 (2021-04-13) ================ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/docs/conf.py new/atpublic-3.1.1/docs/conf.py --- old/public-2.3/docs/conf.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/docs/conf.py 2022-09-03 02:43:18.056890700 +0200 @@ -10,6 +10,8 @@ # serve to show the default. import sys, os +from datetime import date +import importlib.metadata # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -47,14 +49,15 @@ # General information about the project. project = u'public' -copyright = u'2016-2021 by Barry Warsaw' +author = 'Barry Warsaw' +copyright = f'2004-{date.today().year}, {author}' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -from public import __version__ as version +version = importlib.metadata.version('atpublic') # The full version, including alpha/beta/rc tags. release = version @@ -97,7 +100,12 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'furo' +## html_favicon = '_static/lock-light.svg' +## html_theme_options = { +## 'light_logo': 'logo-light.png', +## 'dark_logo': 'logo-dark.png', +## } # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/docs/index.rst new/atpublic-3.1.1/docs/index.rst --- old/public-2.3/docs/index.rst 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/docs/index.rst 2022-09-03 02:43:18.056890700 +0200 @@ -16,7 +16,7 @@ Requirements ============ -``public`` requires Python 3.6 or newer. +``public`` requires Python 3.7 or newer. Documentation @@ -41,19 +41,19 @@ **Do not install "public"; that is a different package!** -You can grab the latest development copy of the code using git. The master +You can grab the latest development copy of the code using git. The main repository is hosted on GitLab. If you have git installed, you can grab your own branch of the code like this:: $ git clone https://gitlab.com/warsaw/public.git -You may contact the author via ba...@python.org. +You can contact the author via ba...@python.org. Copyright ========= -Copyright (C) 2016-2021 Barry A. Warsaw +Copyright (C) 2016-2022 Barry A. Warsaw Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/docs/using.rst new/atpublic-3.1.1/docs/using.rst --- old/public-2.3/docs/using.rst 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/docs/using.rst 2022-09-03 02:43:18.056890700 +0200 @@ -1,6 +1,6 @@ -====================== - @public and @private -====================== +========================== +Using @public and @private +========================== This library provies two very simple decorators that document the *publicness* of the names in your module. They keep your module's ``__all__`` in sync so diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/public/__init__.py new/atpublic-3.1.1/public/__init__.py --- old/public-2.3/public/__init__.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/public/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -from .private import private -from .public import public - - -__version__ = '2.3' - - -def install() -> None: - """Install @public and @private into builtins.""" - import builtins - - builtins.public = public # type: ignore [attr-defined] - builtins.private = private # type: ignore [attr-defined] - - -# mypy does not understand that __all__ gets populated at runtime via the -# following call, -__all__ = [ - 'private', - 'public', -] - - -public( - private=private, - public=public, -) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/public/private.py new/atpublic-3.1.1/public/private.py --- old/public-2.3/public/private.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/public/private.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -import sys - -from .types import ModuleAware - - -def private(thing: ModuleAware) -> ModuleAware: - """Remove names from __all__ - - This decorator documents private names and ensures that the names do not - appear in the module's __all__. - - :param thing: An object with both a __module__ and a __name__ argument. - :return: The original `thing` object. - :raises ValueError: When this function finds a non-list __all__ attribute. - """ - mdict = sys.modules[thing.__module__].__dict__ - dunder_all = mdict.setdefault('__all__', []) - if not isinstance(dunder_all, list): - raise ValueError(f'__all__ must be a list not: {type(dunder_all)}') - if thing.__name__ in dunder_all: - dunder_all.remove(thing.__name__) - return thing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/public/public.py new/atpublic-3.1.1/public/public.py --- old/public-2.3/public/public.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/public/public.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,75 +0,0 @@ -import sys - -from typing import Any, overload - -from .types import ModuleAware - - -@overload -def public(thing: ModuleAware) -> ModuleAware: - ... # pragma: no cover - - -@overload -def public(**kws: Any) -> None: - ... # pragma: no cover - - -def public(thing=None, **kws): # type: ignore - """Add a name or names to __all__ - - There are two forms of use for this function. Most commonly it will - be used as a decorator on a class or function at module scope. In - this case, `thing` will be an object with both __module__ and - __name__ attributes, and the name is added to the module's __all__ - list, creating that if necessary. - - When used in its function call form, `thing` will be None. __all__ - is looked up in the globals at the function's call site, and each - key in the keyword arguments is added to the __all__. In addition, - the key will be bound to the value in the globals. - - Only one or the other format may be used. - - :param thing: None, or an object with both a __module__ and a __name__ - argument. - :param kws: Keyword arguments. - :return: The original `thing` object. - :raises ValueError: When the inputs are invalid, or this function finds - a non-list __all__ attribute. - """ - # 2020-07-14(warsaw): I considered using inspect.getmodule() here but - # looking at its implementation, I feel like it does a ton of unnecessary - # work in the oddball cases (i.e. where the object does not have an - # __module__ attribute). Because @public runs at module import time, and - # because I'm not really sure we even want to support those oddball cases, - # I'm taking the more straightforward approach of just looking the module - # up in sys.modules. That should be good enough for our purposes. - mdict = ( - # The function call syntax. - sys._getframe(1).f_globals - if thing is None - # The decorator syntax. - else sys.modules[thing.__module__].__dict__ - ) - dunder_all = mdict.setdefault('__all__', []) - if not isinstance(dunder_all, list): - raise ValueError(f'__all__ must be a list not: {type(dunder_all)}') - if thing is None: - # The function call form. - for key, value in kws.items(): - # This overwrites any previous similarly named __all__ entry. - if key not in dunder_all: - dunder_all.append(key) - # We currently do not check for duplications in the globals. - mdict[key] = value - else: - # I think it's impossible to use the @public decorator and pass in - # keyword arguments. Not quite syntactically impossible, but you'll - # get a TypeError if you try it, before you even get to this code. - assert ( - len(kws) == 0 - ), 'Keyword arguments are incompatible with use as decorator' - if thing.__name__ not in dunder_all: - dunder_all.append(thing.__name__) - return thing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/public/types.py new/atpublic-3.1.1/public/types.py --- old/public-2.3/public/types.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/public/types.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -from typing import Any, Callable, TypeVar - - -ModuleAware = TypeVar('ModuleAware', bound=Callable[..., Any]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/pyproject.toml new/atpublic-3.1.1/pyproject.toml --- old/public-2.3/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/atpublic-3.1.1/pyproject.toml 2022-09-03 02:43:18.057891000 +0200 @@ -0,0 +1,137 @@ +[project] +name = "atpublic" +authors = [ + { name = "Barry Warsaw", email = "ba...@python.org" }, +] +description = "Keep all y'all's __all__'s in sync" +readme = "README.rst" +requires-python = ">=3.7" +keywords = [ + "__all__", + "public", + "private", +] +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", +] +dependencies = [] +dynamic = [] +version = "3.1.1" + +[project.license] +text = "Apache-2.0" + +[project.urls] +"Home Page" = "https://public.readthedocs.io" +Documentation = "https://public.readthedocs.io" +Source = "https://gitlab.com/warsaw/public.git" +"Bug Tracker" = "https://gitlab.com/warsaw/public/issues" + +[project.optional-dependencies] + +[tool.pdm.version] +from = "src/public/__init__.py" + +[tool.pdm.build] +source-includes = [ + "docs/", + "test/", + "tox.ini", + "conftest.py", +] +excludes = [ + "*/.mypy_cache/", +] + +[tool.pdm.dev-dependencies] +testing = [ + "coverage[toml]", + "diff-cover", + "pytest", + "pytest-cov", + "sybil", +] +qa = [ + "flake8", + "isort", + "mypy", + "blue", +] +docs = [ + "sphinx", + "sphinx-autodoc-typehints", + "furo", +] + +[tool.pytest.ini_options] +addopts = "--cov=public --cov-report=term --cov-report=xml -p no:doctest" +testpaths = "test docs" + +[tool.coverage.report] +fail_under = 100 +show_missing = true + +[tool.coverage.run] +branch = true +parallel = true + +[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", +] + +[tool.mypy] +mypy_path = "src" +disallow_any_generics = true +disallow_subclassing_any = true +disallow_untyped_calls = false +disallow_untyped_defs = true +disallow_incomplete_defs = true +check_untyped_defs = true +disallow_untyped_decorators = false +no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_no_return = true +warn_return_any = true +warn_unreachable = true +implicit_reexport = false +strict_equality = true +show_error_context = true +show_column_numbers = true +show_error_codes = true +pretty = true +show_absolute_path = true +warn_unused_configs = true +verbosity = 0 + +[[tool.mypy.overrides]] +module = [ + "pytest", + "sybil.*", +] +ignore_missing_imports = true + +[build-system] +requires = [ + "pdm-pep517", +] +build-backend = "pdm.pep517.api" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/setup.cfg new/atpublic-3.1.1/setup.cfg --- old/public-2.3/setup.cfg 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/setup.cfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,76 +0,0 @@ -[tool:pytest] -addopts = --cov=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 = - 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/setup.py new/atpublic-3.1.1/setup.py --- old/public-2.3/setup.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,55 +0,0 @@ -"""public -- @public for populating __all__""" - -from setup_helpers import get_version, require_python -from setuptools import setup, find_packages - -require_python(0x30600f0) -__version__ = get_version('public/__init__.py') - - -with open('README.rst') as fp: - readme = fp.read() - - -setup( - name='atpublic', - version=__version__, - author='Barry Warsaw', - author_email='ba...@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=find_packages(where='.', exclude=['test*', 'docs']), - include_package_data=True, - package_data={ - 'public': ['public/py.typed'], - }, - # readthedocs builds fail unless zip_safe is False. - zip_safe=False, - python_requires='>=3.6', - 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/setup_helpers.py new/atpublic-3.1.1/setup_helpers.py --- old/public-2.3/setup_helpers.py 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/setup_helpers.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,153 +0,0 @@ -# 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 <http://www.gnu.org/licenses/>. - -"""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<version>\d+\.\d+(?:\.\d+)?(?:(?:a|b|rc)\d+)?)') -EMPTYSTRING = '' - -__version__ = '2.3' - - -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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/src/public/__init__.py new/atpublic-3.1.1/src/public/__init__.py --- old/public-2.3/src/public/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/atpublic-3.1.1/src/public/__init__.py 2022-09-03 02:43:18.057891000 +0200 @@ -0,0 +1,27 @@ +from .private import private +from .public import public + + +__version__ = '3.1.1' + + +def install() -> None: + """Install @public and @private into builtins.""" + import builtins + + builtins.public = public # type: ignore [attr-defined] + builtins.private = private # type: ignore [attr-defined] + + +# mypy does not understand that __all__ gets populated at runtime via the +# following call, +__all__ = [ + 'private', + 'public', +] + + +public( + private=private, + public=public, +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/src/public/private.py new/atpublic-3.1.1/src/public/private.py --- old/public-2.3/src/public/private.py 1970-01-01 01:00:00.000000000 +0100 +++ new/atpublic-3.1.1/src/public/private.py 2022-09-03 02:43:18.057891000 +0200 @@ -0,0 +1,22 @@ +import sys + +from .types import ModuleAware + + +def private(thing: ModuleAware) -> ModuleAware: + """Remove names from __all__ + + This decorator documents private names and ensures that the names do not + appear in the module's __all__. + + :param thing: An object with both a __module__ and a __name__ argument. + :return: The original `thing` object. + :raises ValueError: When this function finds a non-list __all__ attribute. + """ + mdict = sys.modules[thing.__module__].__dict__ + dunder_all = mdict.setdefault('__all__', []) + if not isinstance(dunder_all, list): + raise ValueError(f'__all__ must be a list not: {type(dunder_all)}') + if thing.__name__ in dunder_all: + dunder_all.remove(thing.__name__) + return thing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/src/public/public.py new/atpublic-3.1.1/src/public/public.py --- old/public-2.3/src/public/public.py 1970-01-01 01:00:00.000000000 +0100 +++ new/atpublic-3.1.1/src/public/public.py 2022-09-03 02:43:18.057891000 +0200 @@ -0,0 +1,75 @@ +import sys + +from typing import Any, overload + +from .types import ModuleAware + + +@overload +def public(thing: ModuleAware) -> ModuleAware: + ... # pragma: no cover + + +@overload +def public(**kws: Any) -> None: + ... # pragma: no cover + + +def public(thing=None, **kws): # type: ignore + """Add a name or names to __all__ + + There are two forms of use for this function. Most commonly it will + be used as a decorator on a class or function at module scope. In + this case, `thing` will be an object with both __module__ and + __name__ attributes, and the name is added to the module's __all__ + list, creating that if necessary. + + When used in its function call form, `thing` will be None. __all__ + is looked up in the globals at the function's call site, and each + key in the keyword arguments is added to the __all__. In addition, + the key will be bound to the value in the globals. + + Only one or the other format may be used. + + :param thing: None, or an object with both a __module__ and a __name__ + argument. + :param kws: Keyword arguments. + :return: The original `thing` object. + :raises ValueError: When the inputs are invalid, or this function finds + a non-list __all__ attribute. + """ + # 2020-07-14(warsaw): I considered using inspect.getmodule() here but + # looking at its implementation, I feel like it does a ton of unnecessary + # work in the oddball cases (i.e. where the object does not have an + # __module__ attribute). Because @public runs at module import time, and + # because I'm not really sure we even want to support those oddball cases, + # I'm taking the more straightforward approach of just looking the module + # up in sys.modules. That should be good enough for our purposes. + mdict = ( + # The function call syntax. + sys._getframe(1).f_globals + if thing is None + # The decorator syntax. + else sys.modules[thing.__module__].__dict__ + ) + dunder_all = mdict.setdefault('__all__', []) + if not isinstance(dunder_all, list): + raise ValueError(f'__all__ must be a list not: {type(dunder_all)}') + if thing is None: + # The function call form. + for key, value in kws.items(): + # This overwrites any previous similarly named __all__ entry. + if key not in dunder_all: + dunder_all.append(key) + # We currently do not check for duplications in the globals. + mdict[key] = value + else: + # I think it's impossible to use the @public decorator and pass in + # keyword arguments. Not quite syntactically impossible, but you'll + # get a TypeError if you try it, before you even get to this code. + assert ( + len(kws) == 0 + ), 'Keyword arguments are incompatible with use as decorator' + if thing.__name__ not in dunder_all: + dunder_all.append(thing.__name__) + return thing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/src/public/types.py new/atpublic-3.1.1/src/public/types.py --- old/public-2.3/src/public/types.py 1970-01-01 01:00:00.000000000 +0100 +++ new/atpublic-3.1.1/src/public/types.py 2022-09-03 02:43:18.057891000 +0200 @@ -0,0 +1,4 @@ +from typing import Any, Callable, TypeVar + + +ModuleAware = TypeVar('ModuleAware', bound=Callable[..., Any]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/public-2.3/tox.ini new/atpublic-3.1.1/tox.ini --- old/public-2.3/tox.ini 2021-04-14 03:23:18.000000000 +0200 +++ new/atpublic-3.1.1/tox.ini 2022-09-03 02:43:18.057891000 +0200 @@ -1,38 +1,43 @@ [tox] -envlist = {py36,py37,py38,py39},qa,docs -skip_missing_interpreters = True +envlist = py{37,38,39,310,311},qa,docs +skip_missing_interpreters = true +isolated_build = true +passenv = PDM_IGNORE_SAVED_PYTHON=1 [testenv] +setenv = + PDM_IGNORE_SAVED_PYTHON="1" + PYTHONPATH="" +deps = pdm commands = - python -m pytest {posargs} -usedevelop = True -setenv = PYTHONPATH = '' -deps = - pytest - pytest-cov - sybil -passenv = - ATPUBLIC_* - PYTHON* + pdm config --local python.use_venv true + pdm install -G testing + pytest {posargs} + # The following is only useful in a git repository. + -diff-cover coverage.xml +usedevelop = true [testenv:qa] -basepython = python3 +deps = pdm commands = - python -m flake8 public - isort public - blue --diff public + pdm config --local python.use_venv true + pdm install -G qa + flake8 src/public + isort src/public + blue --check src/public mypy -p public mypy test/test_mypy.py -deps = - flake8 - isort>=5.4.1 - mypy - blue>=0.6.0 [testenv:docs] -basepython = python3 +deps = pdm commands = - python setup.py build_sphinx -c docs -deps: - sphinx - sphinx_autodoc_typehints + pdm config --local python.use_venv true + pdm install -G docs + sphinx-build docs build/html + +[flake8] +# flake8 does not support pyproject.toml +# https://github.com/PyCQA/flake8/issues/234 +exclude = conf.py +jobs = 1 +max-line-length = 79