Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-validate-pyproject for 
openSUSE:Factory checked in at 2023-06-01 17:19:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-validate-pyproject (Old)
 and      /work/SRC/openSUSE:Factory/.python-validate-pyproject.new.2531 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-validate-pyproject"

Thu Jun  1 17:19:04 2023 rev:4 rq:1089776 version:0.13

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-validate-pyproject/python-validate-pyproject.changes
      2023-05-13 17:17:25.090304096 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-validate-pyproject.new.2531/python-validate-pyproject.changes
    2023-06-01 17:19:09.650032499 +0200
@@ -1,0 +2,9 @@
+Tue May 30 10:17:06 UTC 2023 - Daniel Garcia <[email protected]>
+
+- Update to 0.13:
+  * Make it clear when using input from ``stdin``, #96
+  * Fix summary for ``allOf``, #100
+  * ``setuptools`` plugin:
+    * Improve validation of ``attr`` directives, #101
+
+-------------------------------------------------------------------

Old:
----
  validate-pyproject-0.12.2.tar.gz

New:
----
  validate-pyproject-0.13.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-validate-pyproject.spec ++++++
--- /var/tmp/diff_new_pack.MlMB2o/_old  2023-06-01 17:19:10.102035178 +0200
+++ /var/tmp/diff_new_pack.MlMB2o/_new  2023-06-01 17:19:10.110035225 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-validate-pyproject
-Version:        0.12.2
+Version:        0.13
 Release:        0
 Summary:        Validation library and CLI tool for checking on 'pyprojecttoml'
 License:        BSD-3-Clause AND MIT AND MPL-2.0

++++++ validate-pyproject-0.12.2.tar.gz -> validate-pyproject-0.13.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validate-pyproject-0.12.2/.pre-commit-config.yaml 
new/validate-pyproject-0.13/.pre-commit-config.yaml
--- old/validate-pyproject-0.12.2/.pre-commit-config.yaml       2023-03-27 
23:36:24.000000000 +0200
+++ new/validate-pyproject-0.13/.pre-commit-config.yaml 2023-05-18 
13:30:39.000000000 +0200
@@ -20,7 +20,7 @@
     args: ['--fix=auto']  # replace 'auto' with 'lf' to enforce Linux/Mac line 
endings or 'crlf' for Windows
 
 - repo: https://github.com/PyCQA/autoflake
-  rev: v2.0.2
+  rev: v2.1.1
   hooks:
   - id: autoflake
     args: [
@@ -40,7 +40,7 @@
   - id: isort
 
 - repo: https://github.com/psf/black
-  rev: 23.1.0
+  rev: 23.3.0
   hooks:
   - id: black
     language_version: python3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validate-pyproject-0.12.2/CHANGELOG.rst 
new/validate-pyproject-0.13/CHANGELOG.rst
--- old/validate-pyproject-0.12.2/CHANGELOG.rst 2023-03-27 23:36:24.000000000 
+0200
+++ new/validate-pyproject-0.13/CHANGELOG.rst   2023-05-18 13:30:39.000000000 
+0200
@@ -6,8 +6,16 @@
    Development Version
    ====================
 
-Version 0.12.2 (dev)
-====================
+Version 0.13
+============
+
+- Make it clear when using input from ``stdin``, #96
+- Fix summary for ``allOf``, #100
+- ``setuptools`` plugin:
+    - Improve validation of ``attr`` directives, #101
+
+Version 0.12.2
+==============
 
 - ``setuptools`` plugin:
     - Fix problem with ``license-files`` patterns,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validate-pyproject-0.12.2/PKG-INFO 
new/validate-pyproject-0.13/PKG-INFO
--- old/validate-pyproject-0.12.2/PKG-INFO      2023-03-27 23:38:03.891196500 
+0200
+++ new/validate-pyproject-0.13/PKG-INFO        2023-05-18 13:31:50.768243000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: validate-pyproject
-Version: 0.12.2
+Version: 0.13
 Summary: Validation library and CLI tool for checking on 'pyproject.toml' 
files using JSON Schema
 Home-page: https://github.com/abravalheri/validate-pyproject/
 Author: Anderson Bravalheri
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/src/validate_pyproject/cli.py 
new/validate-pyproject-0.13/src/validate_pyproject/cli.py
--- old/validate-pyproject-0.12.2/src/validate_pyproject/cli.py 2023-03-27 
23:36:24.000000000 +0200
+++ new/validate-pyproject-0.13/src/validate_pyproject/cli.py   2023-05-18 
13:30:39.000000000 +0200
@@ -58,6 +58,8 @@
         raise
 
 
+_STDIN = argparse.FileType("r")("-")
+
 META: Dict[str, dict] = {
     "version": dict(
         flags=("-V", "--version"),
@@ -67,7 +69,7 @@
     "input_file": dict(
         dest="input_file",
         nargs="*",
-        default=[argparse.FileType("r")("-")],
+        # default=[_STDIN],  # postponed to facilitate testing
         type=argparse.FileType("r"),
         help="TOML file to be verified (`stdin` by default)",
     ),
@@ -120,6 +122,7 @@
     """'Hyper parameters' to instruct :mod:`argparse` how to create the CLI"""
     meta = {k: v.copy() for k, v in META.items()}
     meta["enable"]["choices"] = set([p.tool for p in plugins])
+    meta["input_file"]["default"] = [_STDIN]  # lazily defined to facilitate 
testing
     return meta
 
 
@@ -216,12 +219,7 @@
     exceptions = _ExceptionGroup()
     for file in params.input_file:
         try:
-            toml_equivalent = loads(file.read())
-            validator(toml_equivalent)
-            if params.dump_json:
-                print(json.dumps(toml_equivalent, indent=2))
-            else:
-                print(f"Valid {_format_file(file)}")
+            _run_on_file(validator, params, file)
         except _REGULAR_EXCEPTIONS as ex:
             exceptions.add(f"Invalid {_format_file(file)}", ex)
 
@@ -230,6 +228,18 @@
     return 0
 
 
+def _run_on_file(validator: Validator, params: CliParams, file: io.TextIOBase):
+    if file in (sys.stdin, _STDIN):
+        print("Expecting input via `stdin`...", file=sys.stderr, flush=True)
+
+    toml_equivalent = loads(file.read())
+    validator(toml_equivalent)
+    if params.dump_json:
+        print(json.dumps(toml_equivalent, indent=2))
+    else:
+        print(f"Valid {_format_file(file)}")
+
+
 main = exceptions2exit()(run)
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/src/validate_pyproject/error_reporting.py 
new/validate-pyproject-0.13/src/validate_pyproject/error_reporting.py
--- old/validate-pyproject-0.12.2/src/validate_pyproject/error_reporting.py     
2023-03-27 23:36:24.000000000 +0200
+++ new/validate-pyproject-0.13/src/validate_pyproject/error_reporting.py       
2023-05-18 13:30:39.000000000 +0200
@@ -24,7 +24,7 @@
     "must not be there",
 )
 
-_NEED_DETAILS = {"anyOf", "oneOf", "anyOf", "contains", "propertyNames", 
"not", "items"}
+_NEED_DETAILS = {"anyOf", "oneOf", "allOf", "contains", "propertyNames", 
"not", "items"}
 
 _CAMEL_CASE_SPLITTER = re.compile(r"\W+|([A-Z][^A-Z\W]*)")
 _IDENTIFIER = re.compile(r"^[\w_]+$", re.I)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/src/validate_pyproject/plugins/setuptools.schema.json
 
new/validate-pyproject-0.13/src/validate_pyproject/plugins/setuptools.schema.json
--- 
old/validate-pyproject-0.12.2/src/validate_pyproject/plugins/setuptools.schema.json
 2023-03-27 23:36:24.000000000 +0200
+++ 
new/validate-pyproject-0.13/src/validate_pyproject/plugins/setuptools.schema.json
   2023-05-18 13:30:39.000000000 +0200
@@ -256,7 +256,7 @@
       "type": "object",
       "additionalProperties": false,
       "properties": {
-        "attr": {"type": "string"}
+        "attr": {"format": "python-qualified-identifier"}
       },
       "required": ["attr"]
     },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/src/validate_pyproject.egg-info/PKG-INFO 
new/validate-pyproject-0.13/src/validate_pyproject.egg-info/PKG-INFO
--- old/validate-pyproject-0.12.2/src/validate_pyproject.egg-info/PKG-INFO      
2023-03-27 23:38:03.000000000 +0200
+++ new/validate-pyproject-0.13/src/validate_pyproject.egg-info/PKG-INFO        
2023-05-18 13:31:50.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: validate-pyproject
-Version: 0.12.2
+Version: 0.13
 Summary: Validation library and CLI tool for checking on 'pyproject.toml' 
files using JSON Schema
 Home-page: https://github.com/abravalheri/validate-pyproject/
 Author: Anderson Bravalheri
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/src/validate_pyproject.egg-info/SOURCES.txt 
new/validate-pyproject-0.13/src/validate_pyproject.egg-info/SOURCES.txt
--- old/validate-pyproject-0.12.2/src/validate_pyproject.egg-info/SOURCES.txt   
2023-03-27 23:38:03.000000000 +0200
+++ new/validate-pyproject-0.13/src/validate_pyproject.egg-info/SOURCES.txt     
2023-05-18 13:31:50.000000000 +0200
@@ -113,6 +113,8 @@
 
tests/invalid-examples/pep621/non-standardised-project-fields/author_instead_of_authors.toml
 
tests/invalid-examples/pep621/non-standardised-project-fields/requires_instead_of_dependencies.errors.txt
 
tests/invalid-examples/pep621/non-standardised-project-fields/requires_instead_of_dependencies.toml
+tests/invalid-examples/setuptools/attr/missing-attr-name.errors.txt
+tests/invalid-examples/setuptools/attr/missing-attr-name.toml
 tests/invalid-examples/setuptools/cmdclass/invalid-value.errors.txt
 tests/invalid-examples/setuptools/cmdclass/invalid-value.toml
 tests/invalid-examples/setuptools/dependencies/invalid-extra-name.errors.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/tests/invalid-examples/setuptools/attr/missing-attr-name.errors.txt
 
new/validate-pyproject-0.13/tests/invalid-examples/setuptools/attr/missing-attr-name.errors.txt
--- 
old/validate-pyproject-0.12.2/tests/invalid-examples/setuptools/attr/missing-attr-name.errors.txt
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/validate-pyproject-0.13/tests/invalid-examples/setuptools/attr/missing-attr-name.errors.txt
     2023-05-18 13:30:39.000000000 +0200
@@ -0,0 +1,2 @@
+`tool.setuptools.dynamic.version` must be valid exactly by one definition
+'attr': {format: 'python-qualified-identifier'}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/validate-pyproject-0.12.2/tests/invalid-examples/setuptools/attr/missing-attr-name.toml
 
new/validate-pyproject-0.13/tests/invalid-examples/setuptools/attr/missing-attr-name.toml
--- 
old/validate-pyproject-0.12.2/tests/invalid-examples/setuptools/attr/missing-attr-name.toml
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/validate-pyproject-0.13/tests/invalid-examples/setuptools/attr/missing-attr-name.toml
   2023-05-18 13:30:39.000000000 +0200
@@ -0,0 +1,17 @@
+# Issue pypa/setuptools#3928
+# https://github.com/RonnyPfannschmidt/reproduce-setuptools-dynamic-attr
+[build-system]
+build-backend = "_own_version_helper"
+backend-path = ["."]
+requires = ["setuptools" ]
+
+[project]
+name = "ronnypfannschmidt.setuptools-build-attr-error-reproduce"
+description = "reproducer for a setuptools issue"
+requires-python = ">=3.7"
+dynamic = [
+  "version",
+]
+
+[tool.setuptools.dynamic]
+version = { attr = "_own_version_helper."}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validate-pyproject-0.12.2/tests/test_cli.py 
new/validate-pyproject-0.13/tests/test_cli.py
--- old/validate-pyproject-0.12.2/tests/test_cli.py     2023-03-27 
23:36:24.000000000 +0200
+++ new/validate-pyproject-0.13/tests/test_cli.py       2023-05-18 
13:30:39.000000000 +0200
@@ -1,7 +1,9 @@
 import inspect
+import io
 import logging
 import sys
 from pathlib import Path
+from unittest.mock import Mock
 from uuid import uuid4
 
 import pytest
@@ -120,6 +122,19 @@
         assert cli.main([str(invalid_example), "-D", "setuptools"]) == 0
 
 
+class TestInput:
+    def test_inform_user_about_stdin(self, monkeypatch):
+        print_mock = Mock()
+        fake_stdin = io.StringIO('[project]\nname="test"\nversion="0.42"\n')
+        with monkeypatch.context() as ctx:
+            ctx.setattr("validate_pyproject.cli._STDIN", fake_stdin)
+            ctx.setattr("sys.argv", ["validate-pyproject"])
+            ctx.setattr("builtins.print", print_mock)
+            cli.run()
+        calls = print_mock.call_args_list
+        assert any("input via `stdin`" in str(args[0]) for args, _kwargs in 
calls)
+
+
 class TestOutput:
     def test_valid(self, capsys, valid_example):
         cli.main([str(valid_example)])

Reply via email to