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 2021-05-21 21:50:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-atpublic (Old)
and /work/SRC/openSUSE:Factory/.python-atpublic.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-atpublic"
Fri May 21 21:50:18 2021 rev:3 rq:894788 version:2.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-atpublic/python-atpublic.changes
2020-12-02 13:58:15.781803772 +0100
+++
/work/SRC/openSUSE:Factory/.python-atpublic.new.2988/python-atpublic.changes
2021-05-21 21:50:32.834101463 +0200
@@ -1,0 +2,16 @@
+Fri May 21 08:42:52 UTC 2021 - [email protected]
+
+- version update to 2.3
+ 2.3 (2021-04-13)
+ ================
+ * Do type hinting the right way. (GL#10)
+
+ 2.2 (2021-04-13)
+ ================
+ * ``public()`` and ``private()`` can't be correctly type annotated, so the
+ type hints on these two functions have been removed. The ``ModuleAware``
+ was also removed. (GL#10)
+ * Added a ``py.typed`` file to satisfy type checkers. (GL#9)
+ * Fixed a documentation cross-reference bug.
+
+-------------------------------------------------------------------
Old:
----
atpublic-2.1.1.tar.gz
New:
----
atpublic-2.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-atpublic.spec ++++++
--- /var/tmp/diff_new_pack.Mjd2no/_old 2021-05-21 21:50:33.246099757 +0200
+++ /var/tmp/diff_new_pack.Mjd2no/_new 2021-05-21 21:50:33.246099757 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-atpublic
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-atpublic
-Version: 2.1.1
+Version: 2.3
Release: 0
Summary: @public decorator for populating __all__
License: Apache-2.0
++++++ atpublic-2.1.1.tar.gz -> atpublic-2.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/LICENSE new/public-2.3/LICENSE
--- old/public-2.1.1/LICENSE 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/LICENSE 2021-04-14 03:23:18.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright 2016-2020 Barry Warsaw
+Copyright 2016-2021 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.1.1/MANIFEST.in new/public-2.3/MANIFEST.in
--- old/public-2.1.1/MANIFEST.in 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/MANIFEST.in 2021-04-14 03:23:18.000000000 +0200
@@ -1,5 +1,7 @@
include *.py MANIFEST.in LICENSE README.rst
-global-include *.txt *.rst *.ini *.c *.h *.cfg
+global-include *.txt *.rst *.ini *.c *.h *.cfg py.typed
+recursive-include test *.py
+recursive-include docs *.py
exclude .gitignore
exclude *.so
prune build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/README.rst new/public-2.3/README.rst
--- old/public-2.1.1/README.rst 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/README.rst 2021-04-14 03:23:18.000000000 +0200
@@ -10,7 +10,7 @@
Author
======
-``public`` is Copyright (C) 2016-2020 Barry Warsaw <[email protected]>
+``public`` is Copyright (C) 2016-2021 Barry Warsaw <[email protected]>
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.1.1/docs/NEWS.rst
new/public-2.3/docs/NEWS.rst
--- old/public-2.1.1/docs/NEWS.rst 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/docs/NEWS.rst 2021-04-14 03:23:18.000000000 +0200
@@ -2,6 +2,27 @@
@public NEWS
==============
+2.3 (2021-04-13)
+================
+* Do type hinting the right way. (GL#10)
+
+2.2 (2021-04-13)
+================
+* ``public()`` and ``private()`` can't be correctly type annotated, so the
+ type hints on these two functions have been removed. The ``ModuleAware``
+ was also removed. (GL#10)
+* Added a ``py.typed`` file to satisfy type checkers. (GL#9)
+* Fixed a documentation cross-reference bug.
+
+2.1.3 (2021-02-15)
+==================
+* I `blue <https://blue.readthedocs.io/en/latest/>`_ it!
+
+2.1.2 (2021-01-01)
+==================
+* Update copyright years.
+* Include ``test/__init__.py`` and ``docs/__init__.py`` (GL#9)
+
2.1.1 (2020-10-22)
==================
* Rename top-level tests/ directory to test/ (GL#8)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/docs/apiref.rst
new/public-2.3/docs/apiref.rst
--- old/public-2.1.1/docs/apiref.rst 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/docs/apiref.rst 2021-04-14 03:23:18.000000000 +0200
@@ -10,9 +10,3 @@
.. autofunction:: public.private
.. autofunction:: public.install
-
-
-Types:
-
-.. autoclass:: public.ModuleAware
- :members:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/docs/conf.py new/public-2.3/docs/conf.py
--- old/public-2.1.1/docs/conf.py 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/docs/conf.py 2021-04-14 03:23:18.000000000 +0200
@@ -47,7 +47,7 @@
# General information about the project.
project = u'public'
-copyright = u'2016-2020 by Barry Warsaw'
+copyright = u'2016-2021 by Barry Warsaw'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/docs/index.rst
new/public-2.3/docs/index.rst
--- old/public-2.1.1/docs/index.rst 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/docs/index.rst 2021-04-14 03:23:18.000000000 +0200
@@ -53,7 +53,7 @@
Copyright
=========
-Copyright (C) 2016-2020 Barry A. Warsaw
+Copyright (C) 2016-2021 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.
@@ -81,5 +81,5 @@
NEWS
-.. _`simple guide`: docs/using.html
-.. _`API reference`: docs/apiref.html
+.. _`simple guide`: using.html
+.. _`API reference`: apiref.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/public/__init__.py
new/public-2.3/public/__init__.py
--- old/public-2.1.1/public/__init__.py 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/public/__init__.py 2021-04-14 03:23:18.000000000 +0200
@@ -1,20 +1,27 @@
from .private import private
from .public import public
-from .types import ModuleAware
-__version__ = '2.1.1'
+__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(
- ModuleAware=ModuleAware,
- public=public,
private=private,
- )
+ public=public,
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/public/public.py
new/public-2.3/public/public.py
--- old/public-2.1.1/public/public.py 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/public/public.py 2021-04-14 03:23:18.000000000 +0200
@@ -1,14 +1,21 @@
import sys
-from typing import Any, Optional
+from typing import Any, overload
from .types import ModuleAware
-# http://bugs.python.org/issue26632
-def public(thing: Optional[ModuleAware] = None,
- **kws: Any
- ) -> Optional[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
@@ -43,7 +50,8 @@
sys._getframe(1).f_globals
if thing is None
# The decorator syntax.
- else sys.modules[thing.__module__].__dict__)
+ 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)}')
@@ -59,8 +67,9 @@
# 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')
+ 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.1.1/public/types.py
new/public-2.3/public/types.py
--- old/public-2.1.1/public/types.py 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/public/types.py 2021-04-14 03:23:18.000000000 +0200
@@ -1,10 +1,4 @@
-try:
- from typing import Protocol
-except ImportError: # pragma: nocover
- # Python < 3.8
- from typing_extensions import Protocol # type: ignore
+from typing import Any, Callable, TypeVar
-class ModuleAware(Protocol):
- __module__: str
- __name__: str
+ModuleAware = TypeVar('ModuleAware', bound=Callable[..., Any])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/setup.cfg new/public-2.3/setup.cfg
--- old/public-2.1.1/setup.cfg 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/setup.cfg 2021-04-14 03:23:18.000000000 +0200
@@ -4,7 +4,6 @@
[flake8]
exclude = conf.py
-hang-closing = true
jobs = 1
max-line-length = 79
@@ -22,13 +21,14 @@
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 = 4
+multi_line_output = 3
order_by_type = false
skip = conf.py
-known_first_party = public
[mypy]
namespace_packages = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/setup.py new/public-2.3/setup.py
--- old/public-2.1.1/setup.py 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/setup.py 2021-04-14 03:23:18.000000000 +0200
@@ -24,6 +24,9 @@
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',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/test/test_mypy.py
new/public-2.3/test/test_mypy.py
--- old/public-2.1.1/test/test_mypy.py 1970-01-01 01:00:00.000000000 +0100
+++ new/public-2.3/test/test_mypy.py 2021-04-14 03:23:18.000000000 +0200
@@ -0,0 +1,19 @@
+# https://gitlab.com/warsaw/public/-/issues/10
+
+from public import private, public
+
+
+@public
+def one(x: int) -> int:
+ return x * 2
+
+
+one(4)
+
+
+@private
+def two(x: int) -> int:
+ return x * 3
+
+
+two(4)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/public-2.1.1/tox.ini new/public-2.3/tox.ini
--- old/public-2.1.1/tox.ini 2020-10-22 23:37:55.000000000 +0200
+++ new/public-2.3/tox.ini 2021-04-14 03:23:18.000000000 +0200
@@ -20,11 +20,14 @@
commands =
python -m flake8 public
isort public
+ blue --diff public
mypy -p public
+ mypy test/test_mypy.py
deps =
flake8
isort>=5.4.1
mypy
+ blue>=0.6.0
[testenv:docs]
basepython = python3