Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-invoke for openSUSE:Factory checked in at 2023-10-22 21:01:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-invoke (Old) and /work/SRC/openSUSE:Factory/.python-invoke.new.1945 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-invoke" Sun Oct 22 21:01:19 2023 rev:19 rq:1118990 version:2.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-invoke/python-invoke.changes 2023-05-24 20:21:45.735964832 +0200 +++ /work/SRC/openSUSE:Factory/.python-invoke.new.1945/python-invoke.changes 2023-10-22 21:01:34.412665615 +0200 @@ -1,0 +2,16 @@ +Thu Oct 19 09:31:17 UTC 2023 - OndÅej Súkup <[email protected]> + +- update to 2.2.0 + * [Feature]: Remove the somewhat inaccurate subclass requirement + around Configâs .clone(into=... constructor call. It was broken + for certain use cases ()such as trying to clone one subclass + into a sibling subclass, which would yield a TypeError) and is + irrelevant if one is using the new type annotations. + * [Support] #936: Make sure py.typed is in our packaging manifest + * [Bug] #944: After the release of 2.1, package-style task modules + started looking in the wrong place for project-level config files + (inside oneâs eg tasks/ dir, instead of next to that dir) due to + a subtlety in the new import/discovery mechanism used. + This has been fixed + +------------------------------------------------------------------- Old: ---- invoke-2.1.2.tar.gz New: ---- invoke-2.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-invoke.spec ++++++ --- /var/tmp/diff_new_pack.TmOmhJ/_old 2023-10-22 21:01:35.424702414 +0200 +++ /var/tmp/diff_new_pack.TmOmhJ/_new 2023-10-22 21:01:35.428702560 +0200 @@ -27,11 +27,10 @@ %{?sle15_python_module_pythons} Name: python-invoke%{psuffix} -Version: 2.1.2 +Version: 2.2.0 Release: 0 Summary: Pythonic Task Execution License: BSD-2-Clause -Group: Development/Languages/Python URL: https://www.pyinvoke.org Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz # PATCH-FIX-OPENSUSE remove-icecream.patch [email protected] ++++++ invoke-2.1.2.tar.gz -> invoke-2.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/PKG-INFO new/invoke-2.2.0/PKG-INFO --- old/invoke-2.1.2/PKG-INFO 2023-05-16 00:15:29.000000000 +0200 +++ new/invoke-2.2.0/PKG-INFO 2023-07-12 20:04:56.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: invoke -Version: 2.1.2 +Version: 2.2.0 Summary: Pythonic task execution Home-page: https://pyinvoke.org Author: Jeff Forcier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/invoke/_version.py new/invoke-2.2.0/invoke/_version.py --- old/invoke-2.1.2/invoke/_version.py 2023-05-16 00:15:28.000000000 +0200 +++ new/invoke-2.2.0/invoke/_version.py 2023-07-12 20:04:56.000000000 +0200 @@ -1,2 +1,2 @@ -__version_info__ = (2, 1, 2) +__version_info__ = (2, 2, 0) __version__ = ".".join(map(str, __version_info__)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/invoke/config.py new/invoke-2.2.0/invoke/config.py --- old/invoke-2.1.2/invoke/config.py 2023-05-02 04:04:35.000000000 +0200 +++ new/invoke-2.2.0/invoke/config.py 2023-07-12 20:04:20.000000000 +0200 @@ -1014,16 +1014,8 @@ :returns: A `.Config`, or an instance of the class given to ``into``. - :raises: - ``TypeError``, if ``into`` is given a value and that value is not a - `.Config` subclass. - .. versionadded:: 1.0 """ - # Sanity check for 'into' - if into is not None and not issubclass(into, self.__class__): - err = "'into' must be a subclass of {}!" - raise TypeError(err.format(self.__class__.__name__)) # Construct new object klass = self.__class__ if into is None else into # Also allow arbitrary constructor kwargs, for subclasses where passing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/invoke/loader.py new/invoke-2.2.0/invoke/loader.py --- old/invoke-2.1.2/invoke/loader.py 2023-05-02 04:12:54.000000000 +0200 +++ new/invoke-2.2.0/invoke/loader.py 2023-06-15 01:06:05.000000000 +0200 @@ -2,6 +2,7 @@ import sys from importlib.machinery import ModuleSpec from importlib.util import module_from_spec, spec_from_file_location +from pathlib import Path from types import ModuleType from typing import Any, Optional, Tuple @@ -68,18 +69,28 @@ name = self.config.tasks.collection_name spec = self.find(name) if spec and spec.loader and spec.origin: - path = spec.origin - # Ensure containing directory is on sys.path in case the module - # being imported is trying to load local-to-it names. - if os.path.isfile(spec.origin): - path = os.path.dirname(spec.origin) - if path not in sys.path: - sys.path.insert(0, path) + # Typically either tasks.py or tasks/__init__.py + source_file = Path(spec.origin) + # Will be 'the dir tasks.py is in', or 'tasks/', in both cases this + # is what wants to be in sys.path for "from . import sibling" + enclosing_dir = source_file.parent + # Will be "the directory above the spot that 'import tasks' found", + # namely the parent of "your task tree", i.e. "where project level + # config files are looked for". So, same as enclosing_dir for + # tasks.py, but one more level up for tasks/__init__.py... + module_parent = enclosing_dir + if spec.parent: # it's a package, so we have to go up again + module_parent = module_parent.parent + # Get the enclosing dir on the path + enclosing_str = str(enclosing_dir) + if enclosing_str not in sys.path: + sys.path.insert(0, enclosing_str) # Actual import module = module_from_spec(spec) sys.modules[spec.name] = module # so 'from . import xxx' works spec.loader.exec_module(module) - return module, os.path.dirname(spec.origin) + # Return the module and the folder it was found in + return module, str(module_parent) msg = "ImportError loading {!r}, raising ImportError" debug(msg.format(name)) raise ImportError diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/invoke.egg-info/PKG-INFO new/invoke-2.2.0/invoke.egg-info/PKG-INFO --- old/invoke-2.1.2/invoke.egg-info/PKG-INFO 2023-05-16 00:15:29.000000000 +0200 +++ new/invoke-2.2.0/invoke.egg-info/PKG-INFO 2023-07-12 20:04:56.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: invoke -Version: 2.1.2 +Version: 2.2.0 Summary: Pythonic task execution Home-page: https://pyinvoke.org Author: Jeff Forcier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/invoke.egg-info/SOURCES.txt new/invoke-2.2.0/invoke.egg-info/SOURCES.txt --- old/invoke-2.1.2/invoke.egg-info/SOURCES.txt 2023-05-16 00:15:29.000000000 +0200 +++ new/invoke-2.2.0/invoke.egg-info/SOURCES.txt 2023-07-12 20:04:56.000000000 +0200 @@ -157,6 +157,8 @@ tests/_support/configs/json-and-python/invoke.json tests/_support/configs/json-and-python/invoke.py tests/_support/configs/nested/invoke.yaml +tests/_support/configs/package/invoke.yml +tests/_support/configs/package/tasks/__init__.py tests/_support/configs/python/invoke.py tests/_support/configs/three-of-em/invoke.json tests/_support/configs/three-of-em/invoke.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/sites/www/changelog.rst new/invoke-2.2.0/sites/www/changelog.rst --- old/invoke-2.1.2/sites/www/changelog.rst 2023-05-16 00:15:26.000000000 +0200 +++ new/invoke-2.2.0/sites/www/changelog.rst 2023-07-12 20:04:51.000000000 +0200 @@ -2,6 +2,19 @@ Changelog ========= +- :release:`2.2.0 <2023-07-12>` +- :feature:`-` Remove the somewhat inaccurate subclass requirement around + `~invoke.config.Config`'s ``.clone(into=...)`` constructor call. It was + broken for certain use cases (such as trying to clone one subclass into a + sibling subclass, which would yield a ``TypeError``) and is irrelevant if one + is using the new type annotations. +- :release:`2.1.3 <2023-06-14>` +- :bug:`944` After the release of 2.1, package-style task modules started + looking in the wrong place for project-level config files (inside one's eg + ``tasks/`` dir, instead of *next to* that dir) due to a subtlety in the new + import/discovery mechanism used. This has been fixed. Thanks to Arnaud V. and + Hunter Kelly for the reports and to Jesse P. Johnson for initial + debugging/diagnosis. - :release:`2.1.2 <2023-05-15>` - :support:`936 backported` Make sure ``py.typed`` is in our packaging manifest; without it, users working from a regular installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/tasks.py new/invoke-2.2.0/tasks.py --- old/invoke-2.1.2/tasks.py 2023-05-02 04:04:35.000000000 +0200 +++ new/invoke-2.2.0/tasks.py 2023-05-23 17:52:36.000000000 +0200 @@ -118,6 +118,7 @@ watch_docs, ci, checks.blacken, + checks, ) ns.configure( { @@ -128,7 +129,6 @@ "find_opts": "-and -not \( -path './invoke/vendor*' -or -path './build*' \)" # noqa }, "packaging": { - "sign": True, "wheel": True, "check_desc": True, "changelog_file": os.path.join( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/tests/_support/configs/package/invoke.yml new/invoke-2.2.0/tests/_support/configs/package/invoke.yml --- old/invoke-2.1.2/tests/_support/configs/package/invoke.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/invoke-2.2.0/tests/_support/configs/package/invoke.yml 2023-06-15 01:06:05.000000000 +0200 @@ -0,0 +1,3 @@ +outer: + inner: + hooray: "package" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/tests/_support/configs/package/tasks/__init__.py new/invoke-2.2.0/tests/_support/configs/package/tasks/__init__.py --- old/invoke-2.1.2/tests/_support/configs/package/tasks/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/invoke-2.2.0/tests/_support/configs/package/tasks/__init__.py 2023-06-15 01:06:05.000000000 +0200 @@ -0,0 +1,6 @@ +from invoke import task + + +@task +def mytask(c): + assert c.outer.inner.hooray == "package" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/tests/config.py new/invoke-2.2.0/tests/config.py --- old/invoke-2.1.2/tests/config.py 2023-02-17 21:13:42.000000000 +0100 +++ new/invoke-2.2.0/tests/config.py 2023-07-12 20:04:20.000000000 +0200 @@ -1039,24 +1039,6 @@ c2 = c.clone() assert c2.meh == "okay" - def raises_TypeError_if_value_is_not_Config_subclass(self): - try: - Config().clone(into=17) - except TypeError: - pass - else: - assert False, "Non-class obj did not raise TypeError!" - - class Foo: - pass - - try: - Config().clone(into=Foo) - except TypeError: - pass - else: - assert False, "Non-subclass did not raise TypeError!" - def resulting_clones_are_typed_as_new_class(self): class MyConfig(Config): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/tests/loader.py new/invoke-2.2.0/tests/loader.py --- old/invoke-2.1.2/tests/loader.py 2023-05-02 04:12:54.000000000 +0200 +++ new/invoke-2.2.0/tests/loader.py 2023-06-15 01:06:05.000000000 +0200 @@ -61,11 +61,11 @@ def can_load_package(self): loader = _BasicLoader() # Load itself doesn't explode (tests 'from . import xxx' internally) - mod, loc = loader.load("package") + mod, enclosing_dir = loader.load("package") # Properties of returned values look as expected - package = Path(support) / "package" - assert loc == str(package) - assert mod.__file__ == str(package / "__init__.py") + # (enclosing dir is always the one above the module-or-package) + assert enclosing_dir == support + assert mod.__file__ == str(Path(support) / "package" / "__init__.py") def load_name_defaults_to_config_tasks_collection_name(self): "load() name defaults to config.tasks.collection_name" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/invoke-2.1.2/tests/program.py new/invoke-2.2.0/tests/program.py --- old/invoke-2.1.2/tests/program.py 2023-04-28 21:58:26.000000000 +0200 +++ new/invoke-2.2.0/tests/program.py 2023-06-15 01:06:05.000000000 +0200 @@ -2,6 +2,7 @@ import os import sys from io import BytesIO +from pathlib import Path from invoke.util import Lexicon from unittest.mock import patch, Mock, ANY @@ -35,6 +36,7 @@ skip_if_windows, support_file, support_path, + support, ) @@ -241,6 +243,10 @@ Program(loader_class=klass).run("myapp --help foo", exit=False) klass.assert_called_with(start=ANY, config=ANY) + def config_location_correct_for_package_type_task_trees(self): + with cd(Path(support) / "configs" / "package"): + expect("mytask") # will assert if config not loaded right + class execute: def uses_executor_class_given(self): klass = Mock()
