Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-versioningit for
openSUSE:Factory checked in at 2022-11-10 14:23:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-versioningit (Old)
and /work/SRC/openSUSE:Factory/.python-versioningit.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-versioningit"
Thu Nov 10 14:23:13 2022 rev:4 rq:1034977 version:2.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-versioningit/python-versioningit.changes
2022-10-12 18:26:13.245891828 +0200
+++
/work/SRC/openSUSE:Factory/.python-versioningit.new.1597/python-versioningit.changes
2022-11-10 14:24:10.510991758 +0100
@@ -1,0 +2,8 @@
+Wed Nov 9 19:36:14 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to version 2.1.0
+ * Drop support for Python 3.6
+ * Support Python 3.11
+ * Use tomllib on Python 3.11
+
+-------------------------------------------------------------------
Old:
----
versioningit-2.0.1.tar.gz
New:
----
versioningit-2.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-versioningit.spec ++++++
--- /var/tmp/diff_new_pack.ixHM9k/_old 2022-11-10 14:24:10.994994498 +0100
+++ /var/tmp/diff_new_pack.ixHM9k/_new 2022-11-10 14:24:11.002994543 +0100
@@ -25,7 +25,7 @@
%endif
Name: python-versioningit
-Version: 2.0.1
+Version: 2.1.0
Release: 0
Summary: Versioning It with your Version In Git
License: MIT
++++++ versioningit-2.0.1.tar.gz -> versioningit-2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/CHANGELOG.md
new/versioningit-2.1.0/CHANGELOG.md
--- old/versioningit-2.0.1/CHANGELOG.md 2022-08-01 18:10:19.000000000 +0200
+++ new/versioningit-2.1.0/CHANGELOG.md 2022-10-26 00:44:23.000000000 +0200
@@ -1,3 +1,9 @@
+v2.1.0 (2022-10-25)
+-------------------
+- Drop support for Python 3.6
+- Support Python 3.11
+- Use `tomllib` on Python 3.11
+
v2.0.1 (2022-08-01)
-------------------
- Don't run the `onbuild` step under setuptools' upcoming PEP 660 editable mode
@@ -40,6 +46,12 @@
- When resolving entry points, if multiple entry points with the given group &
name are found, error instead of using the first one returned
+v1.1.2 (2022-08-12)
+-------------------
+- Backport "Don't run the `onbuild` step under setuptools' upcoming PEP 660
+ editable mode" from v2.0.1 (contributed by
+ [@abravalheri](https://github.com/abravalheri))
+
v1.1.1 (2022-04-08)
-------------------
- Do not import setuptools unless needed (contributed by
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/PKG-INFO
new/versioningit-2.1.0/PKG-INFO
--- old/versioningit-2.0.1/PKG-INFO 2022-08-01 18:10:26.419421200 +0200
+++ new/versioningit-2.1.0/PKG-INFO 2022-10-26 00:44:29.964681100 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: versioningit
-Version: 2.0.1
+Version: 2.1.0
Summary: Versioning It with your Version In Git
Home-page: https://github.com/jwodder/versioningit
Author: John Thorvald Wodder II
@@ -13,11 +13,11 @@
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: License :: OSI Approved :: MIT License
@@ -28,7 +28,7 @@
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Software Development :: Version Control :: Mercurial
Classifier: Typing :: Typed
-Requires-Python: >=3.6
+Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
@@ -101,7 +101,7 @@
Installation & Setup
====================
-``versioningit`` requires Python 3.6 or higher. Just use `pip
+``versioningit`` requires Python 3.7 or higher. Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``versioningit`` and its dependencies::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/README.rst
new/versioningit-2.1.0/README.rst
--- old/versioningit-2.0.1/README.rst 2022-07-07 15:00:11.000000000 +0200
+++ new/versioningit-2.1.0/README.rst 2022-10-16 19:53:49.000000000 +0200
@@ -67,7 +67,7 @@
Installation & Setup
====================
-``versioningit`` requires Python 3.6 or higher. Just use `pip
+``versioningit`` requires Python 3.7 or higher. Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``versioningit`` and its dependencies::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/docs/changelog.rst
new/versioningit-2.1.0/docs/changelog.rst
--- old/versioningit-2.0.1/docs/changelog.rst 2022-08-01 18:10:19.000000000
+0200
+++ new/versioningit-2.1.0/docs/changelog.rst 2022-10-26 00:44:23.000000000
+0200
@@ -3,6 +3,13 @@
Changelog
=========
+v2.1.0 (2022-10-25)
+-------------------
+- Drop support for Python 3.6
+- Support Python 3.11
+- Use `tomllib` on Python 3.11
+
+
v2.0.1 (2022-08-01)
-------------------
- Don't run the ``onbuild`` step under setuptools' upcoming PEP 660 editable
@@ -61,6 +68,13 @@
name are found, error instead of using the first one returned
+v1.1.2 (2022-08-12)
+-------------------
+- Backport "Don't run the ``onbuild`` step under setuptools' upcoming PEP 660
+ editable mode" from v2.0.1 (contributed by `@abravalheri
+ <https://github.com/abravalheri>`_)
+
+
v1.1.1 (2022-04-08)
-------------------
- Do not import setuptools unless needed (contributed by `@jenshnielsen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/docs/index.rst
new/versioningit-2.1.0/docs/index.rst
--- old/versioningit-2.0.1/docs/index.rst 2022-07-07 15:00:17.000000000
+0200
+++ new/versioningit-2.1.0/docs/index.rst 2022-10-16 19:53:49.000000000
+0200
@@ -61,7 +61,7 @@
Installation & Setup
====================
-``versioningit`` requires Python 3.6 or higher. Just use `pip
+``versioningit`` requires Python 3.7 or higher. Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``versioningit`` and its dependencies::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/docs/notes.rst
new/versioningit-2.1.0/docs/notes.rst
--- old/versioningit-2.0.1/docs/notes.rst 2022-06-20 00:29:24.000000000
+0200
+++ new/versioningit-2.1.0/docs/notes.rst 2022-08-12 22:55:51.000000000
+0200
@@ -47,3 +47,7 @@
dependency.
.. _Semantic Versioning: https://semver.org
+
+Bug fixes may, on occasion, be backported to previous major versions of
+``versioningit``, but this is in general unlikely to happen unless a user
+specifically requests it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/docs/writing-methods.rst
new/versioningit-2.1.0/docs/writing-methods.rst
--- old/versioningit-2.0.1/docs/writing-methods.rst 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/docs/writing-methods.rst 2022-10-16
21:48:33.000000000 +0200
@@ -52,7 +52,7 @@
A custom ``vcs`` method is a callable with the following synopsis:
-.. function:: funcname(*, project_dir: Union[str, pathlib.Path], params:
Dict[str, Any]) -> versioningit.VCSDescription
+.. function:: funcname(*, project_dir: str | pathlib.Path, params: dict[str,
Any]) -> versioningit.VCSDescription
:noindex:
:param path project_dir: the path to a project directory
@@ -71,7 +71,7 @@
A custom ``tag2version`` method is a callable with the following synopsis:
-.. function:: funcname(*, tag: str, params: Dict[str, Any]) -> str
+.. function:: funcname(*, tag: str, params: dict[str, Any]) -> str
:noindex:
:param str tag: a tag retrieved from version control
@@ -85,7 +85,7 @@
A custom ``next-version`` method is a callable with the following synopsis:
-.. function:: funcname(*, version: str, branch: Optional[str], params:
Dict[str, Any]) -> str
+.. function:: funcname(*, version: str, branch: Optional[str], params:
dict[str, Any]) -> str
:noindex:
:param str version: a project version (as extracted from a VCS tag)
@@ -103,7 +103,7 @@
A custom ``format`` method is a callable with the following synopsis:
-.. function:: funcname(*, description: versioningit.VCSDescription,
base_version: str, next_version: str, params: Dict[str, Any]) -> str
+.. function:: funcname(*, description: versioningit.VCSDescription,
base_version: str, next_version: str, params: dict[str, Any]) -> str
:noindex:
:param description:
@@ -128,7 +128,7 @@
A custom ``template-fields`` method is a callable with the following synopsis:
-.. function:: funcname(*, version: str, description: Optional[VCSDescription],
base_version: Optional[str], next_version: Optional[str], params: Dict[str,
Any]) -> Dict[str, Any]
+.. function:: funcname(*, version: str, description: Optional[VCSDescription],
base_version: Optional[str], next_version: Optional[str], params: dict[str,
Any]) -> dict[str, Any]
:noindex:
:param str version: the project's final version
@@ -142,14 +142,14 @@
a "next version" calculated by the ``next-version`` step; `None` if the
step or a previous one failed
:param dict params: a collection of user-supplied parameters
- :rtype: Dict[str, Any]
+ :rtype: dict[str, Any]
``write``
---------
A custom ``write`` method is a callable with the following synopsis:
-.. function:: funcname(*, project_dir: Union[str, pathlib.Path],
template_fields: Dict[str, Any], params: Dict[str, Any]) -> None
+.. function:: funcname(*, project_dir: str | pathlib.Path, template_fields:
dict[str, Any], params: dict[str, Any]) -> None
:noindex:
:param path project_dir: the path to a project directory
@@ -168,7 +168,7 @@
A custom ``onbuild`` method is a callable with the following synopsis:
-.. function:: funcname(*, build_dir: Union[str, pathlib.Path], is_source:
bool, template_fields: Dict[str, Any], params: Dict[str, Any]) -> None
+.. function:: funcname(*, build_dir: str | pathlib.Path, is_source: bool,
template_fields: dict[str, Any], params: dict[str, Any]) -> None
:noindex:
Modifies one or more files in ``build_dir``
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/setup.cfg
new/versioningit-2.1.0/setup.cfg
--- old/versioningit-2.0.1/setup.cfg 2022-08-01 18:10:26.420459700 +0200
+++ new/versioningit-2.1.0/setup.cfg 2022-10-26 00:44:29.965502500 +0200
@@ -20,11 +20,11 @@
Development Status :: 5 - Production/Stable
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
- Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
+ Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
License :: OSI Approved :: MIT License
@@ -45,12 +45,11 @@
package_dir =
=src
include_package_data = True
-python_requires = >=3.6
+python_requires = >=3.7
install_requires =
- dataclasses; python_version < "3.7"
importlib-metadata >= 3.6; python_version < "3.10"
packaging >= 17.1
- tomli >= 1.2, < 3.0
+ tomli >= 1.2, < 3.0; python_version < "3.11"
[options.packages.find]
where = src
@@ -82,19 +81,19 @@
replace-version = versioningit.onbuild:replace_version_onbuild
[mypy]
+allow_incomplete_defs = False
+allow_untyped_defs = False
ignore_missing_imports = True
-disallow_untyped_defs = True
-disallow_incomplete_defs = True
no_implicit_optional = True
-warn_redundant_casts = True
-warn_return_any = True
-warn_unreachable = True
+implicit_reexport = False
local_partial_types = True
-no_implicit_reexport = True
-strict_equality = True
+pretty = True
show_error_codes = True
show_traceback = True
-pretty = True
+strict_equality = True
+warn_redundant_casts = True
+warn_return_any = True
+warn_unreachable = True
exclude = test/data/
[egg_info]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/__init__.py
new/versioningit-2.1.0/src/versioningit/__init__.py
--- old/versioningit-2.0.1/src/versioningit/__init__.py 2022-08-01
18:10:19.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/__init__.py 2022-10-26
00:44:23.000000000 +0200
@@ -38,7 +38,7 @@
<https://versioningit.rtfd.io> for more information.
"""
-__version__ = "2.0.1"
+__version__ = "2.1.0"
__author__ = "John Thorvald Wodder II"
__author_email__ = "[email protected]"
__license__ = "MIT"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/__main__.py
new/versioningit-2.1.0/src/versioningit/__main__.py
--- old/versioningit-2.0.1/src/versioningit/__main__.py 2022-06-12
22:46:11.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/__main__.py 2022-10-16
20:26:28.000000000 +0200
@@ -1,10 +1,11 @@
+from __future__ import annotations
import argparse
import logging
import os
import subprocess
import sys
import traceback
-from typing import List, Optional
+from typing import Optional
from . import __version__
from .core import get_next_version, get_version
from .errors import Error
@@ -12,7 +13,7 @@
from .util import showcmd
-def main(argv: Optional[List[str]] = None) -> None:
+def main(argv: Optional[list[str]] = None) -> None:
parser = argparse.ArgumentParser(
description="Show the version of a versioningit-enabled project"
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/basics.py
new/versioningit-2.1.0/src/versioningit/basics.py
--- old/versioningit-2.0.1/src/versioningit/basics.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/basics.py 2022-10-16
20:26:48.000000000 +0200
@@ -1,7 +1,8 @@
+from __future__ import annotations
from copy import deepcopy
from pathlib import Path
import re
-from typing import Any, Dict, Optional, Union
+from typing import Any, Optional
from .core import VCSDescription
from .errors import ConfigError, InvalidTagError
from .logging import log, warn_extra_fields
@@ -23,7 +24,7 @@
}
-def basic_tag2version(*, tag: str, params: Dict[str, Any]) -> str:
+def basic_tag2version(*, tag: str, params: dict[str, Any]) -> str:
"""Implements the ``"basic"`` ``tag2version`` method"""
params = params.copy()
try:
@@ -82,7 +83,7 @@
description: VCSDescription,
base_version: str,
next_version: str,
- params: Dict[str, Any],
+ params: dict[str, Any],
) -> str:
"""Implements the ``"basic"`` ``format`` method"""
branch: Optional[str]
@@ -110,9 +111,9 @@
def basic_write(
*,
- project_dir: Union[str, Path],
- template_fields: Dict[str, Any],
- params: Dict[str, Any],
+ project_dir: str | Path,
+ template_fields: dict[str, Any],
+ params: dict[str, Any],
) -> None:
"""Implements the ``"basic"`` ``write`` method"""
params = params.copy()
@@ -148,8 +149,8 @@
description: Optional[VCSDescription],
base_version: Optional[str],
next_version: Optional[str],
- params: Dict[str, Any],
-) -> Dict[str, Any]:
+ params: dict[str, Any],
+) -> dict[str, Any]:
"""Implements the ``"basic"`` ``template-fields`` method"""
params = deepcopy(params)
vtuple_params = params.pop("version-tuple", {})
@@ -185,7 +186,7 @@
version_tuple = split_version(
version, split_on=split_on, double_quote=double_quote
)
- fields: Dict[str, Any] = {}
+ fields: dict[str, Any] = {}
if description is not None:
fields.update(description.fields)
fields["branch"] = description.branch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/cmdclasses.py
new/versioningit-2.1.0/src/versioningit/cmdclasses.py
--- old/versioningit-2.0.1/src/versioningit/cmdclasses.py 2022-08-01
18:09:43.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/cmdclasses.py 2022-10-16
20:35:59.000000000 +0200
@@ -1,5 +1,6 @@
+from __future__ import annotations
from pathlib import Path
-from typing import TYPE_CHECKING, Any, Dict, Optional, Type
+from typing import TYPE_CHECKING, Any, Optional
from .core import get_template_fields_from_distribution, run_onbuild
from .logging import init_logging, log
@@ -8,8 +9,8 @@
def get_cmdclasses(
- bases: Optional[Dict[str, Type["Command"]]] = None
-) -> Dict[str, Type["Command"]]:
+ bases: Optional[dict[str, type[Command]]] = None
+) -> dict[str, type[Command]]:
"""
.. versionadded:: 1.1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/config.py
new/versioningit-2.1.0/src/versioningit/config.py
--- old/versioningit-2.0.1/src/versioningit/config.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/config.py 2022-10-25
22:25:54.000000000 +0200
@@ -1,7 +1,8 @@
+from __future__ import annotations
from dataclasses import Field, dataclass, field, fields
from pathlib import Path
-from typing import Any, Dict, Optional, Union
-import tomli
+import sys
+from typing import Any, Optional
from .errors import ConfigError, NotVersioningitError
from .logging import warn_extra_fields
from .methods import (
@@ -13,6 +14,11 @@
)
from .util import optional_str_guard
+if sys.version_info[:2] >= (3, 11):
+ from tomllib import load as toml_load
+else:
+ from tomli import load as toml_load
+
@dataclass
class ConfigSection:
@@ -22,9 +28,9 @@
method_spec: MethodSpec
#: Additional parameters to pass to the method
- params: Dict[str, Any]
+ params: dict[str, Any]
- def load(self, project_dir: Union[str, Path]) -> VersioningitMethod:
+ def load(self, project_dir: str | Path) -> VersioningitMethod:
"""Loads the method and returns a `VersioningitMethod`"""
return VersioningitMethod(self.method_spec.load(project_dir),
self.params)
@@ -63,7 +69,7 @@
default_version: Optional[str] = None
@classmethod
- def parse_toml_file(cls, filepath: Union[str, Path]) -> "Config":
+ def parse_toml_file(cls, filepath: str | Path) -> Config:
"""
Parse the ``[tool.versioningit]`` table in the given TOML file
@@ -74,13 +80,13 @@
the correct type
"""
with open(filepath, "rb") as fp:
- data = tomli.load(fp).get("tool", {}).get("versioningit")
+ data = toml_load(fp).get("tool", {}).get("versioningit")
if data is None:
raise NotVersioningitError("versioningit not enabled in
pyproject.toml")
return cls.parse_obj(data)
@classmethod
- def parse_obj(cls, obj: Any) -> "Config":
+ def parse_obj(cls, obj: Any) -> Config:
"""
Parse a raw Python configuration structure
@@ -94,7 +100,7 @@
default_version = optional_str_guard(
obj.pop("default-version", None),
"tool.versioningit.default-version"
)
- sections: Dict[str, Optional[ConfigSection]] = {}
+ sections: dict[str, Optional[ConfigSection]] = {}
for f in fields(cls):
if not f.metadata:
continue
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/core.py
new/versioningit-2.1.0/src/versioningit/core.py
--- old/versioningit-2.0.1/src/versioningit/core.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/core.py 2022-10-16
21:27:09.000000000 +0200
@@ -1,7 +1,8 @@
+from __future__ import annotations
from dataclasses import dataclass
import os
from pathlib import Path
-from typing import TYPE_CHECKING, Any, Dict, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional
from .config import Config
from .errors import Error, MethodError, NotSdistError, NotVCSError,
NotVersioningitError
from .logging import log, warn_bad_version
@@ -35,7 +36,7 @@
#: A `dict` of additional information about the repository state to make
#: available to the ``format`` method. Custom ``vcs`` methods are advised
#: to adhere closely to the set of fields used by the built-in methods.
- fields: Dict[str, Any]
+ fields: dict[str, Any]
@dataclass
@@ -64,7 +65,7 @@
#: A `dict` of fields for use in templating by the "write" and "onbuild"
#: steps
- template_fields: Dict[str, Any]
+ template_fields: dict[str, Any]
#: `True` iff an error occurred during version calculation, causing a
#: ``default-version`` setting to be used
@@ -138,8 +139,8 @@
@classmethod
def from_project_dir(
- cls, project_dir: Union[str, Path] = os.curdir, config: Optional[dict]
= None
- ) -> "Versioningit":
+ cls, project_dir: str | Path = os.curdir, config: Optional[dict] = None
+ ) -> Versioningit:
"""
Construct a `Versioningit` object for the project rooted at
``project_dir`` (default: the current directory).
@@ -170,9 +171,7 @@
return cls.from_config(project_dir, cfg)
@classmethod
- def from_config(
- cls, project_dir: Union[str, Path], config: Config
- ) -> "Versioningit":
+ def from_config(cls, project_dir: str | Path, config: Config) ->
Versioningit:
"""
Construct a `Versioningit` object from a parsed configuration object
@@ -223,7 +222,7 @@
def run(
self, write: bool = False, fallback: bool = True
- ) -> Union[Report, FallbackReport]:
+ ) -> Report | FallbackReport:
"""
.. versionadded:: 2.0.0
@@ -410,7 +409,7 @@
log.debug("Template fields available to `write` and `onbuild`: %r",
fields)
return fields
- def do_write(self, template_fields: Dict[str, Any]) -> None:
+ def do_write(self, template_fields: dict[str, Any]) -> None:
"""
Run the ``write`` step
@@ -425,9 +424,9 @@
def do_onbuild(
self,
- build_dir: Union[str, Path],
+ build_dir: str | Path,
is_source: bool,
- template_fields: Dict[str, Any],
+ template_fields: dict[str, Any],
) -> None:
"""
.. versionadded:: 1.1.0
@@ -449,7 +448,7 @@
def get_version(
- project_dir: Union[str, Path] = os.curdir,
+ project_dir: str | Path = os.curdir,
config: Optional[dict] = None,
write: bool = False,
fallback: bool = True,
@@ -492,7 +491,7 @@
def get_next_version(
- project_dir: Union[str, Path] = os.curdir, config: Optional[dict] = None
+ project_dir: str | Path = os.curdir, config: Optional[dict] = None
) -> str:
"""
.. versionadded:: 0.3.0
@@ -525,7 +524,7 @@
return next_version
-def get_version_from_pkg_info(project_dir: Union[str, Path]) -> str:
+def get_version_from_pkg_info(project_dir: str | Path) -> str:
"""
Return the :mailheader:`Version` field from the :file:`PKG-INFO` file in
``project_dir``
@@ -545,10 +544,10 @@
def run_onbuild(
*,
- build_dir: Union[str, Path],
+ build_dir: str | Path,
is_source: bool,
- template_fields: Dict[str, Any],
- project_dir: Union[str, Path] = os.curdir,
+ template_fields: dict[str, Any],
+ project_dir: str | Path = os.curdir,
config: Optional[dict] = None,
) -> None:
"""
@@ -596,8 +595,8 @@
def get_template_fields_from_distribution(
- dist: "Distribution",
-) -> Optional[Dict[str, Any]]:
+ dist: Distribution,
+) -> Optional[dict[str, Any]]:
"""
Extract the template fields (calculated by the "template-fields" step) that
were stashed on the `setuptools.Distribution` by ``versioningit``'s
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/git.py
new/versioningit-2.1.0/src/versioningit/git.py
--- old/versioningit-2.0.1/src/versioningit/git.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/git.py 2022-10-16
21:26:47.000000000 +0200
@@ -1,9 +1,10 @@
+from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
import re
import subprocess
-from typing import Any, Dict, List, NamedTuple, Optional, Union
+from typing import Any, NamedTuple, Optional
from .core import VCSDescription
from .errors import ConfigError, NoTagError, NotVCSError
from .logging import log, warn_extra_fields
@@ -50,7 +51,7 @@
rev: str
@classmethod
- def parse(cls, s: str) -> "Describe":
+ def parse(cls, s: str) -> Describe:
m =
re.fullmatch(r"(?P<tag>.+)-(?P<distance>[0-9]+)-g(?P<rev>[0-9a-f]+)?", s)
if not m:
raise ValueError("Could not parse `git describe` output")
@@ -65,19 +66,19 @@
@dataclass
class DescribeOpts:
tags: bool
- match: List[str]
- exclude: List[str]
+ match: list[str]
+ exclude: list[str]
@classmethod
- def parse_describe_subst(cls, s: str) -> "DescribeOpts":
+ def parse_describe_subst(cls, s: str) -> DescribeOpts:
m = re.fullmatch(r"\$Format:%\(describe(?::(?P<options>.*))?\)\$", s)
if not m:
raise ValueError(
f"Expected string in format '$Format:%(describe[:options])$',
got {s!r}"
)
tags = False
- match: List[str] = []
- exclude: List[str] = []
+ match: list[str] = []
+ exclude: list[str] = []
options = m["options"]
if options:
# As of Git 2.35.1, though the docs say that %(describe) options
@@ -117,8 +118,8 @@
raise ValueError(f"Unknown option: {opt!r}")
return cls(tags=tags, match=match, exclude=exclude)
- def as_args(self) -> List[str]:
- args: List[str] = []
+ def as_args(self) -> list[str]:
+ args: list[str] = []
if self.tags:
args.append("--tags")
for pat in self.match:
@@ -133,7 +134,7 @@
"""Methods for querying a Git repository"""
#: The repository's working tree or a subdirectory thereof
- path: Union[str, Path]
+ path: str | Path
def ensure_is_repo(self) -> None:
"""
@@ -208,9 +209,7 @@
return None
-def describe_git(
- *, project_dir: Union[str, Path], params: Dict[str, Any]
-) -> VCSDescription:
+def describe_git(*, project_dir: str | Path, params: dict[str, Any]) ->
VCSDescription:
"""Implements the ``"git"`` ``vcs`` method"""
params = params.copy()
match = list_str_guard(params.pop("match", []),
"tool.versioningit.vcs.match")
@@ -241,7 +240,7 @@
def describe_git_archive(
- *, project_dir: Union[str, Path], params: Dict[str, Any]
+ *, project_dir: str | Path, params: dict[str, Any]
) -> VCSDescription:
"""Implements the ``"git-archive"`` ``vcs`` method"""
params = params.copy()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/hg.py
new/versioningit-2.1.0/src/versioningit/hg.py
--- old/versioningit-2.0.1/src/versioningit/hg.py 2022-06-05
03:29:46.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/hg.py 2022-10-16
20:35:59.000000000 +0200
@@ -1,8 +1,9 @@
+from __future__ import annotations
from dataclasses import dataclass
import os
from pathlib import Path
import subprocess
-from typing import Any, Dict, Union
+from typing import Any
from .core import VCSDescription
from .errors import NoTagError, NotVCSError
from .logging import log, warn_extra_fields
@@ -14,7 +15,7 @@
"""Methods for querying a Mercurial repository"""
#: The repository's working tree or a subdirectory thereof
- path: Union[str, Path]
+ path: str | Path
def ensure_is_repo(self) -> None:
"""
@@ -54,9 +55,7 @@
)
-def describe_hg(
- *, project_dir: Union[str, Path], params: Dict[str, Any]
-) -> VCSDescription:
+def describe_hg(*, project_dir: str | Path, params: dict[str, Any]) ->
VCSDescription:
"""Implements the ``"hg"`` ``vcs`` method"""
params = params.copy()
pattern = optional_str_guard(
@@ -139,8 +138,8 @@
)
-def parse_hg_archival(path: Path) -> Dict[str, str]:
- data: Dict[str, str] = {}
+def parse_hg_archival(path: Path) -> dict[str, str]:
+ data: dict[str, str] = {}
with path.open() as fp:
for line in fp:
key, _, value = line.strip().partition(": ")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/hook.py
new/versioningit-2.1.0/src/versioningit/hook.py
--- old/versioningit-2.0.1/src/versioningit/hook.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/hook.py 2022-10-16
21:31:14.000000000 +0200
@@ -1,3 +1,4 @@
+from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from .core import Report, Versioningit
@@ -8,7 +9,7 @@
from setuptools import Distribution
-def setuptools_finalizer(dist: "Distribution") -> None:
+def setuptools_finalizer(dist: Distribution) -> None:
"""
The entry point called by setuptools to retrieve the version for a project
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/logging.py
new/versioningit-2.1.0/src/versioningit/logging.py
--- old/versioningit-2.0.1/src/versioningit/logging.py 2022-06-09
03:41:30.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/logging.py 2022-10-16
20:35:59.000000000 +0200
@@ -1,7 +1,8 @@
+from __future__ import annotations
from difflib import get_close_matches
import logging
import os
-from typing import Iterable, List, Optional
+from typing import Iterable, Optional
from packaging.version import Version
log = logging.getLogger(__package__)
@@ -55,7 +56,7 @@
def warn_extra_fields(
- params: dict, fieldname: str, valid: Optional[List[str]] = None
+ params: dict, fieldname: str, valid: Optional[list[str]] = None
) -> None:
"""
For each key in ``params``, emit a log message indicating that the given
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/methods.py
new/versioningit-2.1.0/src/versioningit/methods.py
--- old/versioningit-2.0.1/src/versioningit/methods.py 2022-06-12
22:21:23.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/methods.py 2022-10-16
20:30:51.000000000 +0200
@@ -1,11 +1,13 @@
+from __future__ import annotations
from abc import ABC, abstractmethod
+from collections.abc import Callable
from contextlib import suppress
from dataclasses import dataclass
from importlib import import_module
import os.path
from pathlib import Path
import sys
-from typing import Any, Callable, Dict, Optional, Union, cast
+from typing import Any, Optional, cast
from .errors import ConfigError, MethodError
from .logging import didyoumean, log
@@ -27,7 +29,7 @@
"""
@abstractmethod
- def load(self, project_dir: Union[str, Path]) -> Callable:
+ def load(self, project_dir: str | Path) -> Callable:
"""
Load & return the callable specified by the `MethodSpec`.
``project_dir`` is provided in case the method needs to load anything
@@ -48,7 +50,7 @@
#: The name of the entry point
name: str
- def load(self, _project_dir: Union[str, Path]) -> Callable:
+ def load(self, _project_dir: str | Path) -> Callable:
"""
Loads & returns the entry point
@@ -96,7 +98,7 @@
#: ``project_dir``
module_dir: Optional[str]
- def load(self, project_dir: Union[str, Path]) -> Callable:
+ def load(self, project_dir: str | Path) -> Callable:
"""
Loads the module and returns the callable
@@ -134,7 +136,7 @@
#: The callable
func: Callable
- def load(self, _project_dir: Union[str, Path]) -> Callable:
+ def load(self, _project_dir: str | Path) -> Callable:
"""Return the callable"""
return self.func
@@ -150,7 +152,7 @@
method: Callable
#: User-supplied parameters obtained from the original configuration
- params: Dict[str, Any]
+ params: dict[str, Any]
def __call__(self, **kwargs: Any) -> Any:
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/next_version.py
new/versioningit-2.1.0/src/versioningit/next_version.py
--- old/versioningit-2.0.1/src/versioningit/next_version.py 2022-06-05
03:29:46.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/next_version.py 2022-10-16
21:26:52.000000000 +0200
@@ -1,6 +1,7 @@
+from __future__ import annotations
from dataclasses import dataclass
import re
-from typing import Any, Dict, List, Optional
+from typing import Any, Optional
from packaging.version import Version
from .errors import InvalidVersionError
from .logging import warn_extra_fields
@@ -14,10 +15,10 @@
epoch: int
#: The integer values of the components of the release segment
- release: List[int]
+ release: list[int]
@classmethod
- def parse(cls, version: str) -> "BasicVersion":
+ def parse(cls, version: str) -> BasicVersion:
"""
Parse the initial epoch and release segment from a version string and
discard any other trailing characters
@@ -52,7 +53,7 @@
*,
version: str,
branch: Optional[str], # noqa: U100
- params: Dict[str, Any],
+ params: dict[str, Any],
) -> str:
"""Implements the ``"minor"`` ``next-version`` method"""
warn_extra_fields(params, "tool.versioningit.next-version")
@@ -67,7 +68,7 @@
*,
version: str,
branch: Optional[str], # noqa: U100
- params: Dict[str, Any],
+ params: dict[str, Any],
) -> str:
"""Implements the ``"smallest"`` ``next-version`` method"""
warn_extra_fields(params, "tool.versioningit.next-version")
@@ -80,7 +81,7 @@
*,
version: str,
branch: Optional[str], # noqa: U100
- params: Dict[str, Any],
+ params: dict[str, Any],
) -> str:
"""Implements the ``"null"`` ``next-version`` method"""
warn_extra_fields(params, "tool.versioningit.next-version")
@@ -91,7 +92,7 @@
*,
version: str,
branch: Optional[str], # noqa: U100
- params: Dict[str, Any],
+ params: dict[str, Any],
) -> str:
"""
Implements the ``"minor-release"`` ``next-version`` method.
@@ -119,7 +120,7 @@
*,
version: str,
branch: Optional[str], # noqa: U100
- params: Dict[str, Any],
+ params: dict[str, Any],
) -> str:
"""
Implements the ``"smallest-release"`` ``next-version`` method.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/onbuild.py
new/versioningit-2.1.0/src/versioningit/onbuild.py
--- old/versioningit-2.0.1/src/versioningit/onbuild.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/onbuild.py 2022-10-16
20:31:34.000000000 +0200
@@ -1,6 +1,7 @@
+from __future__ import annotations
from pathlib import Path
import re
-from typing import Any, Dict, Union
+from typing import Any
from .errors import ConfigError
from .logging import log, warn_extra_fields
from .util import bool_guard, ensure_terminated, optional_str_guard, str_guard
@@ -8,10 +9,10 @@
def replace_version_onbuild(
*,
- build_dir: Union[str, Path],
+ build_dir: str | Path,
is_source: bool,
- template_fields: Dict[str, Any],
- params: Dict[str, Any],
+ template_fields: dict[str, Any],
+ params: dict[str, Any],
) -> None:
"""Implements the ``"replace-version"`` ``onbuild`` method"""
@@ -66,7 +67,7 @@
m = rgx.search(ln)
if m:
log.debug("onbuild.regex matched file on line %d", i + 1)
- vgroup: Union[str, int]
+ vgroup: str | int
if "version" in m.groupdict():
vgroup = "version"
else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/src/versioningit/util.py
new/versioningit-2.1.0/src/versioningit/util.py
--- old/versioningit-2.0.1/src/versioningit/util.py 2022-06-12
22:46:11.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit/util.py 2022-10-16
20:32:32.000000000 +0200
@@ -1,3 +1,5 @@
+from __future__ import annotations
+from collections.abc import Sequence
from datetime import datetime, timezone
import json
import os
@@ -5,7 +7,7 @@
import re
import shlex
import subprocess
-from typing import Any, List, Optional, Sequence, Union
+from typing import Any, Optional
from packaging.version import Version
from .errors import ConfigError, InvalidVersionError
from .logging import log
@@ -33,7 +35,7 @@
raise ConfigError(f"{fieldname} must be a string")
-def list_str_guard(v: Any, fieldname: str) -> List[str]:
+def list_str_guard(v: Any, fieldname: str) -> list[str]:
"""
If ``v`` is a `list` of `str`\\s, return it; otherwise, raise a
`ConfigError`. ``fieldname`` is an identifier for ``v`` to include in the
@@ -56,7 +58,7 @@
raise ConfigError(f"{fieldname} must be set to a boolean")
-def runcmd(*args: Union[str, Path], **kwargs: Any) ->
subprocess.CompletedProcess:
+def runcmd(*args: str | Path, **kwargs: Any) -> subprocess.CompletedProcess:
"""Run and log a given command"""
arglist = [str(a) for a in args]
log.debug("Running: %s", showcmd(arglist))
@@ -64,9 +66,9 @@
return subprocess.run(arglist, **kwargs)
-def readcmd(*args: Union[str, Path], **kwargs: Any) -> str:
+def readcmd(*args: str | Path, **kwargs: Any) -> str:
"""Run a command, capturing & returning its stdout"""
- s = runcmd(*args, stdout=subprocess.PIPE, universal_newlines=True,
**kwargs).stdout
+ s = runcmd(*args, stdout=subprocess.PIPE, text=True, **kwargs).stdout
assert isinstance(s, str)
return s.strip()
@@ -137,7 +139,7 @@
return " ".join(shlex.quote(os.fsdecode(a)) for a in args)
-def is_sdist(project_dir: Union[str, Path]) -> bool:
+def is_sdist(project_dir: str | Path) -> bool:
"""
Performs a simplistic check whether ``project_dir`` (which presumably is
not under version control) is an unpacked sdist by testing whether
@@ -169,7 +171,7 @@
vobj = Version(v)
except ValueError:
raise InvalidVersionError(f"{v!r} is not a valid PEP 440 version")
- parts: List[Union[str, int]] = []
+ parts: list[str | int] = []
if epoch or (vobj.epoch and epoch is None):
parts.append(vobj.epoch)
parts.extend(vobj.release)
@@ -185,8 +187,8 @@
return repr_tuple(parts, double_quote)
-def repr_tuple(parts: Sequence[Union[str, int]], double_quote: bool = True) ->
str:
- strparts: List[str] = []
+def repr_tuple(parts: Sequence[str | int], double_quote: bool = True) -> str:
+ strparts: list[str] = []
for p in parts:
if isinstance(p, int):
strparts.append(str(p))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/versioningit-2.0.1/src/versioningit.egg-info/PKG-INFO
new/versioningit-2.1.0/src/versioningit.egg-info/PKG-INFO
--- old/versioningit-2.0.1/src/versioningit.egg-info/PKG-INFO 2022-08-01
18:10:26.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit.egg-info/PKG-INFO 2022-10-26
00:44:29.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: versioningit
-Version: 2.0.1
+Version: 2.1.0
Summary: Versioning It with your Version In Git
Home-page: https://github.com/jwodder/versioningit
Author: John Thorvald Wodder II
@@ -13,11 +13,11 @@
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: License :: OSI Approved :: MIT License
@@ -28,7 +28,7 @@
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Software Development :: Version Control :: Mercurial
Classifier: Typing :: Typed
-Requires-Python: >=3.6
+Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
@@ -101,7 +101,7 @@
Installation & Setup
====================
-``versioningit`` requires Python 3.6 or higher. Just use `pip
+``versioningit`` requires Python 3.7 or higher. Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``versioningit`` and its dependencies::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/versioningit-2.0.1/src/versioningit.egg-info/requires.txt
new/versioningit-2.1.0/src/versioningit.egg-info/requires.txt
--- old/versioningit-2.0.1/src/versioningit.egg-info/requires.txt
2022-08-01 18:10:26.000000000 +0200
+++ new/versioningit-2.1.0/src/versioningit.egg-info/requires.txt
2022-10-26 00:44:29.000000000 +0200
@@ -1,8 +1,7 @@
packaging>=17.1
-tomli<3.0,>=1.2
[:python_version < "3.10"]
importlib-metadata>=3.6
-[:python_version < "3.7"]
-dataclasses
+[:python_version < "3.11"]
+tomli<3.0,>=1.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_config.py
new/versioningit-2.1.0/test/test_config.py
--- old/versioningit-2.0.1/test/test_config.py 2022-06-12 17:36:17.000000000
+0200
+++ new/versioningit-2.1.0/test/test_config.py 2022-10-16 20:33:06.000000000
+0200
@@ -1,6 +1,7 @@
+from __future__ import annotations
from operator import attrgetter
from pathlib import Path
-from typing import Any, Dict
+from typing import Any
import pytest
from versioningit.config import Config, ConfigSection
from versioningit.errors import ConfigError, NotVersioningitError
@@ -18,7 +19,7 @@
)
def test_parse_toml_file(tomlfile: Path) -> None:
cfg = Config.parse_toml_file(tomlfile)
- namespace: Dict[str, Any] = {}
+ namespace: dict[str, Any] = {}
exec(tomlfile.with_suffix(".py").read_text(encoding="utf-8"), namespace)
assert cfg == namespace["cfg"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_end2end.py
new/versioningit-2.1.0/test/test_end2end.py
--- old/versioningit-2.0.1/test/test_end2end.py 2022-06-12 17:36:17.000000000
+0200
+++ new/versioningit-2.1.0/test/test_end2end.py 2022-10-16 20:33:51.000000000
+0200
@@ -1,10 +1,12 @@
+from __future__ import annotations
+from collections.abc import Iterator
import logging
import os
from pathlib import Path
import shutil
import subprocess
import sys
-from typing import Iterator, List, Optional, Tuple, Type, Union, cast
+from typing import List, Optional, Type, Union, cast
from _pytest.mark.structures import ParameterSet
from pydantic import BaseModel, Field
import pytest
@@ -50,7 +52,7 @@
level: str
message: str
- def as_tuple(self) -> Tuple[str, int, str]:
+ def as_tuple(self) -> tuple[str, int, str]:
return ("versioningit", getattr(logging, self.level), self.message)
@@ -69,7 +71,7 @@
def mkcases(
subdir: str,
- marks: List[pytest.MarkDecorator],
+ marks: list[pytest.MarkDecorator],
details_cls: Type[BaseModel] = CaseDetails,
) -> Iterator[ParameterSet]:
for repozip in sorted((DATA_DIR / "repos" / subdir).glob("*.zip")):
@@ -238,7 +240,7 @@
[sys.executable, "-m", "build", "--no-isolation", str(tmp_path)],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- universal_newlines=True,
+ text=True,
)
assert r.returncode != 0
out = r.stdout
@@ -254,7 +256,7 @@
[sys.executable, "-m", "build", "--no-isolation", str(tmp_path)],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- universal_newlines=True,
+ text=True,
)
assert r.returncode != 0
out = r.stdout
@@ -334,7 +336,7 @@
["setup.py", "develop"],
],
)
-def test_editable_mode(cmd: List[str], tmp_path: Path) -> None:
+def test_editable_mode(cmd: list[str], tmp_path: Path) -> None:
repozip = DATA_DIR / "repos" / "git" / "onbuild-write-fields.zip"
details = CaseDetails.parse_file(repozip.with_suffix(".json"))
srcdir = tmp_path / "src"
@@ -401,7 +403,7 @@
return sdist_src
-def unpack_wheel(dist_dir: Path, tmp_path: Path) -> Tuple[Path, Path]:
+def unpack_wheel(dist_dir: Path, tmp_path: Path) -> tuple[Path, Path]:
(wheel,) = dist_dir.glob("*.whl")
wheel_src = tmp_path / "wheel"
shutil.unpack_archive(str(wheel), str(wheel_src), "zip")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_methods/test_format.py
new/versioningit-2.1.0/test/test_methods/test_format.py
--- old/versioningit-2.0.1/test/test_methods/test_format.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_format.py 2022-10-16
20:34:06.000000000 +0200
@@ -1,5 +1,6 @@
+from __future__ import annotations
from datetime import datetime, timezone
-from typing import Any, Dict
+from typing import Any
import pytest
from versioningit.basics import basic_format
from versioningit.core import VCSDescription
@@ -137,7 +138,7 @@
description: VCSDescription,
base_version: str,
next_version: str,
- params: Dict[str, Any],
+ params: dict[str, Any],
r: str,
) -> None:
assert (
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_methods/test_git.py
new/versioningit-2.1.0/test/test_methods/test_git.py
--- old/versioningit-2.0.1/test/test_methods/test_git.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_git.py 2022-10-16
20:34:17.000000000 +0200
@@ -1,10 +1,11 @@
+from __future__ import annotations
from datetime import datetime, timezone
import logging
from pathlib import Path
import re
import shutil
import subprocess
-from typing import Any, Dict
+from typing import Any
import pytest
from versioningit.core import VCSDescription
from versioningit.errors import ConfigError, NoTagError, NotVCSError
@@ -224,7 +225,7 @@
],
)
def test_describe_git(
- repo: str, params: Dict[str, Any], description: VCSDescription, tmp_path:
Path
+ repo: str, params: dict[str, Any], description: VCSDescription, tmp_path:
Path
) -> None:
shutil.unpack_archive(
str(DATA_DIR / "repos" / "git" / f"{repo}.zip"), str(tmp_path)
@@ -254,7 +255,7 @@
@needs_git
@pytest.mark.parametrize("params", [{}, {"default-tag": "0.0.0"}])
-def test_describe_git_no_commits(tmp_path: Path, params: Dict[str, Any]) ->
None:
+def test_describe_git_no_commits(tmp_path: Path, params: dict[str, Any]) ->
None:
subprocess.run(["git", "init"], check=True, cwd=str(tmp_path))
with pytest.raises(NotVCSError) as excinfo:
describe_git(project_dir=tmp_path, params=params)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_methods/test_hg.py
new/versioningit-2.1.0/test/test_methods/test_hg.py
--- old/versioningit-2.0.1/test/test_methods/test_hg.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_hg.py 2022-10-16
20:34:32.000000000 +0200
@@ -1,3 +1,4 @@
+from __future__ import annotations
from datetime import datetime, timezone
import json
import logging
@@ -5,7 +6,7 @@
from pathlib import Path
import shutil
import subprocess
-from typing import Any, Dict
+from typing import Any
import pytest
from versioningit.core import VCSDescription
from versioningit.errors import NoTagError, NotVCSError
@@ -129,7 +130,7 @@
],
)
def test_describe_hg(
- repo: str, params: Dict[str, Any], description: VCSDescription, tmp_path:
Path
+ repo: str, params: dict[str, Any], description: VCSDescription, tmp_path:
Path
) -> None:
shutil.unpack_archive(str(DATA_DIR / "repos" / "hg" / f"{repo}.zip"),
str(tmp_path))
desc = describe_hg(project_dir=tmp_path, params=params)
@@ -160,7 +161,7 @@
@needs_hg
@pytest.mark.parametrize("params", [{}, {"default-tag": "0.0.0"}])
-def test_describe_hg_no_commits(tmp_path: Path, params: Dict[str, Any]) ->
None:
+def test_describe_hg_no_commits(tmp_path: Path, params: dict[str, Any]) ->
None:
subprocess.run(["hg", "--cwd", str(tmp_path), "init"], check=True)
with pytest.raises(NotVCSError) as excinfo:
describe_hg(project_dir=tmp_path, params=params)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_methods/test_onbuild.py
new/versioningit-2.1.0/test/test_methods/test_onbuild.py
--- old/versioningit-2.0.1/test/test_methods/test_onbuild.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_onbuild.py 2022-10-16
20:34:42.000000000 +0200
@@ -1,7 +1,8 @@
+from __future__ import annotations
from datetime import datetime, timezone
from pathlib import Path
from shutil import copytree
-from typing import Any, Dict
+from typing import Any
import pytest
from versioningit.errors import ConfigError
from versioningit.onbuild import replace_version_onbuild
@@ -160,7 +161,7 @@
],
)
def test_replace_version_onbuild(
- outfile: str, is_source: bool, params: Dict[str, Any], tmp_path: Path
+ outfile: str, is_source: bool, params: dict[str, Any], tmp_path: Path
) -> None:
tmp_path /= "tmp" # copytree() can't copy to a dir that already exists
copytree(DATA_DIR / "replace-version" / "base", tmp_path)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/versioningit-2.0.1/test/test_methods/test_tag2version.py
new/versioningit-2.1.0/test/test_methods/test_tag2version.py
--- old/versioningit-2.0.1/test/test_methods/test_tag2version.py
2022-06-12 17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_tag2version.py
2022-10-16 20:34:51.000000000 +0200
@@ -1,4 +1,5 @@
-from typing import Any, Dict
+from __future__ import annotations
+from typing import Any
import pytest
from versioningit.basics import basic_tag2version
from versioningit.errors import InvalidTagError
@@ -28,7 +29,7 @@
),
],
)
-def test_basic_tag2version(tag: str, params: Dict[str, Any], version: str) ->
None:
+def test_basic_tag2version(tag: str, params: dict[str, Any], version: str) ->
None:
assert basic_tag2version(tag=tag, params=params) == version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/versioningit-2.0.1/test/test_methods/test_template_fields.py
new/versioningit-2.1.0/test/test_methods/test_template_fields.py
--- old/versioningit-2.0.1/test/test_methods/test_template_fields.py
2022-06-12 17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_template_fields.py
2022-10-16 20:35:13.000000000 +0200
@@ -1,6 +1,7 @@
+from __future__ import annotations
from datetime import datetime, timezone
import logging
-from typing import Any, Dict, List, Optional
+from typing import Any, Optional
import pytest
from versioningit.basics import basic_template_fields
from versioningit.core import VCSDescription
@@ -79,9 +80,9 @@
def test_basic_template_fields(
caplog: pytest.LogCaptureFixture,
version: str,
- params: Dict[str, Any],
+ params: dict[str, Any],
version_tuple: str,
- warnings: List[str],
+ warnings: list[str],
) -> None:
assert basic_template_fields(
version=version,
@@ -177,7 +178,7 @@
description: Optional[VCSDescription],
base_version: Optional[str],
next_version: Optional[str],
- fields: Dict[str, Any],
+ fields: dict[str, Any],
) -> None:
assert (
basic_template_fields(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_methods/test_write.py
new/versioningit-2.1.0/test/test_methods/test_write.py
--- old/versioningit-2.0.1/test/test_methods/test_write.py 2022-06-12
17:36:17.000000000 +0200
+++ new/versioningit-2.1.0/test/test_methods/test_write.py 2022-10-16
20:35:32.000000000 +0200
@@ -1,6 +1,7 @@
+from __future__ import annotations
from datetime import datetime, timezone
from pathlib import Path
-from typing import Any, Dict
+from typing import Any
import pytest
from versioningit.basics import basic_write
from versioningit.errors import ConfigError
@@ -31,7 +32,7 @@
],
)
def test_basic_write(
- filename: str, params: Dict[str, Any], content: str, tmp_path: Path
+ filename: str, params: dict[str, Any], content: str, tmp_path: Path
) -> None:
basic_write(
project_dir=tmp_path,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/test/test_util.py
new/versioningit-2.1.0/test/test_util.py
--- old/versioningit-2.0.1/test/test_util.py 2022-06-12 17:36:17.000000000
+0200
+++ new/versioningit-2.1.0/test/test_util.py 2022-10-16 20:35:51.000000000
+0200
@@ -1,7 +1,8 @@
+from __future__ import annotations
from datetime import datetime, timedelta, timezone
import os
from pathlib import Path
-from typing import Any, List, Optional, Union
+from typing import Any, Optional
import pytest
from versioningit.errors import ConfigError, InvalidVersionError
from versioningit.git import DescribeOpts
@@ -162,7 +163,7 @@
),
],
)
-def test_showcmd(cmd: List[Union[str, Path]], s: str) -> None:
+def test_showcmd(cmd: list[str | Path], s: str) -> None:
assert showcmd(cmd) == s
@@ -341,7 +342,7 @@
),
],
)
-def test_parse_describe_opts(fmt: str, opts: DescribeOpts, args: List[str]) ->
None:
+def test_parse_describe_opts(fmt: str, opts: DescribeOpts, args: list[str]) ->
None:
actual = DescribeOpts.parse_describe_subst(fmt)
assert actual == opts
assert actual.as_args() == args
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/versioningit-2.0.1/tox.ini
new/versioningit-2.1.0/tox.ini
--- old/versioningit-2.0.1/tox.ini 2022-06-05 03:29:46.000000000 +0200
+++ new/versioningit-2.1.0/tox.ini 2022-10-25 21:03:32.000000000 +0200
@@ -1,18 +1,31 @@
[tox]
-envlist = lint,typing,py36,py37,py38,py39,py310,pypy3
+envlist = lint,typing,py37,py38,py39,py310,py311,pypy3,py-oldsetup
skip_missing_interpreters = True
isolated_build = True
minversion = 3.3.0
[testenv]
deps =
- build~=0.7 # Must be a version that builds wheels from sdists
+ build>=0.7 # Must be a version that builds wheels from sdists
setuptools>=42
pip
- pydantic~=1.8
- pytest~=7.0
- pytest-cov~=3.0
- pytest-mock~=3.0
+ pydantic
+ pytest
+ pytest-cov
+ pytest-mock
+ wheel
+commands =
+ pytest {posargs:-v} test
+
+[testenv:py-oldsetup]
+deps =
+ build>=0.7 # Must be a version that builds wheels from sdists
+ setuptools<64
+ pip
+ pydantic
+ pytest
+ pytest-cov
+ pytest-mock
wheel
commands =
pytest {posargs:-v} test
@@ -20,17 +33,16 @@
[testenv:lint]
skip_install = True
deps =
- flake8~=4.0
+ flake8
flake8-bugbear
- flake8-builtins~=1.4
+ flake8-builtins
flake8-unused-arguments
commands =
flake8 src test
[testenv:typing]
deps =
- mypy~=0.900
- types-dataclasses; python_version < "3.7"
+ mypy
types-setuptools
{[testenv]deps}
commands =
@@ -69,11 +81,11 @@
doctests = True
exclude = .*/,build/,dist/,test/data,venv/
hang-closing = False
-max-doc-length = 80
+max-doc-length = 100
max-line-length = 80
unused-arguments-ignore-stub-functions = True
-select = C,B,B902,B950,E,E242,F,I,U100,W
-ignore = B005,E203,E262,E266,E501,I201,W503
+select = C,B,B902,B950,E,E242,F,U100,W
+ignore = B005,E203,E262,E266,E501,W503
[isort]
atomic = True