Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-cogapp for openSUSE:Factory 
checked in at 2022-09-27 20:14:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cogapp (Old)
 and      /work/SRC/openSUSE:Factory/.python-cogapp.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-cogapp"

Tue Sep 27 20:14:04 2022 rev:5 rq:1006330 version:3.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cogapp/python-cogapp.changes      
2021-05-12 19:31:19.403263051 +0200
+++ /work/SRC/openSUSE:Factory/.python-cogapp.new.2275/python-cogapp.changes    
2022-09-27 20:14:07.769853324 +0200
@@ -1,0 +2,21 @@
+Tue Sep 27 06:52:19 UTC 2022 - Daniel Garcia <daniel.gar...@suse.com>
+
+- Remove not needed patch in prep section 
+- Change preun to postun to run python_uninstall_alternatives to remove rpmlint
+  errors
+
+-------------------------------------------------------------------
+Mon Sep 26 22:06:02 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+
+- Update to 3.3.0:
+  Added the --check option to check whether files would change if run again, 
for use in continuous integration scenarios.
+
+- Update to 3.2.0:
+  Added the -P option to use print() instead of cog.outl() for code output.
+
+- Update to 3.1.0: 
+  * Fix a problem with Python 3.8.10 and 3.9.5 that require absolute paths in 
sys.path
+    https://github.com/nedbat/cog/issues/16
+    Python 3.9 and 3.10 are supported.
+
+-------------------------------------------------------------------

Old:
----
  cogapp-3.0.0.tar.gz

New:
----
  cogapp-3.3.0.tar.gz

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

Other differences:
------------------
++++++ python-cogapp.spec ++++++
--- /var/tmp/diff_new_pack.9IAvas/_old  2022-09-27 20:14:08.297854489 +0200
+++ /var/tmp/diff_new_pack.9IAvas/_new  2022-09-27 20:14:08.301854497 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-cogapp
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-cogapp
-Version:        3.0.0
+Version:        3.3.0
 Release:        0
 Summary:        A code generator for executing Python snippets in source files
 License:        MIT
@@ -30,7 +30,7 @@
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires(post): update-alternatives
-Requires(preun):update-alternatives
+Requires(postun):update-alternatives
 BuildArch:      noarch
 %python_subpackages
 
@@ -41,9 +41,6 @@
 
 %prep
 %setup -q -n cogapp-%{version}
-# The fix for bpo-43105 broke cogapp's way to import relative paths
-# https://github.com/nedbat/cog/issues/16
-sed -i 's/self.addToIncludePath(a)/self.addToIncludePath(os.path.abspath(a))/' 
cogapp/cogapp.py
 
 %build
 %python_build
@@ -61,7 +58,7 @@
 %post
 %python_install_alternative cog
 
-%preun
+%postun
 %python_uninstall_alternative cog
 
 %files %{python_files}

++++++ cogapp-3.0.0.tar.gz -> cogapp-3.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/AUTHORS.txt new/cogapp-3.3.0/AUTHORS.txt
--- old/cogapp-3.0.0/AUTHORS.txt        1970-01-01 01:00:00.000000000 +0100
+++ new/cogapp-3.3.0/AUTHORS.txt        2019-04-01 22:41:00.000000000 +0200
@@ -0,0 +1,12 @@
+Cog was written by Ned Batchelder (n...@nedbatchelder.com).
+
+Contributions have been made by:
+
+Alexander Belchenko
+Anders Hovm??ller
+Blake Winton
+Doug Hellmann
+Daniel Murdin
+Hugh Perkins
+Jean-Fran??ois Giraud
+Petr Gladkiy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/LICENSE.txt new/cogapp-3.3.0/LICENSE.txt
--- old/cogapp-3.0.0/LICENSE.txt        2019-03-26 13:58:41.000000000 +0100
+++ new/cogapp-3.3.0/LICENSE.txt        2021-11-19 13:54:01.000000000 +0100
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2004-2016 Ned Batchelder
+Copyright (c) 2004-2021 Ned Batchelder
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/PKG-INFO new/cogapp-3.3.0/PKG-INFO
--- old/cogapp-3.0.0/PKG-INFO   2019-04-02 12:29:27.000000000 +0200
+++ new/cogapp-3.3.0/PKG-INFO   2021-11-19 18:27:52.461554000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: cogapp
-Version: 3.0.0
+Version: 3.3.0
 Summary: Cog: A content generator for executing Python snippets in source 
files.
 Home-page: http://nedbatchelder.com/code/cog
 Author: Ned Batchelder
@@ -9,49 +9,8 @@
 Project-URL: Documentation, http://nedbatchelder.com/code/cog
 Project-URL: Code, http://github.com/nedbat/cog
 Project-URL: Issues, https://github.com/nedbat/cog/issues
-Description: ===
-        Cog
-        ===
-        
-        Cog content generation tool.
-        
-        |  |license| |versions| |status|
-        |  |ci-status| |win-ci-status|
-        |  |kit| |format|
-        
-        See http://nedbatchelder.com/code/cog for details.
-        
-        Code repository and issue tracker are at
-        `GitHub <https://github.com/nedbat/cog>`_.
-        
-        To run the tests::
-        
-            $ pip install -r requirements.pip
-            $ tox
-        
-        
-        .. |ci-status| image:: 
https://travis-ci.com/nedbat/cog.svg?branch=master
-            :target: https://travis-ci.com/nedbat/cog
-            :alt: Build status
-        .. |win-ci-status| image:: 
https://ci.appveyor.com/api/projects/status/hqq7x2vawnci7v7d/branch/master?svg=true
-            :target: https://ci.appveyor.com/project/nedbat/cog
-            :alt: Windows build status
-        .. |kit| image:: https://badge.fury.io/py/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: PyPI status
-        .. |format| image:: https://img.shields.io/pypi/format/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: Kit format
-        .. |license| image:: https://img.shields.io/pypi/l/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: License
-        .. |versions| image:: https://img.shields.io/pypi/pyversions/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: Python versions supported
-        .. |status| image:: https://img.shields.io/pypi/status/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: Package stability
-        
+Project-URL: Funding, https://github.com/users/nedbat/sponsorship
+Project-URL: Twitter, https://twitter.com/nedbat
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -63,6 +22,51 @@
 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: Topic :: Software Development :: Code Generators
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
 Description-Content-Type: text/x-rst
+License-File: LICENSE.txt
+License-File: AUTHORS.txt
+
+===
+Cog
+===
+
+Cog content generation tool. Small bits of computation for static files.
+
+|  |license| |versions| |status|
+|  |ci-status| |kit| |format|
+
+See http://nedbatchelder.com/code/cog for details.
+
+Code repository and issue tracker are at
+`GitHub <https://github.com/nedbat/cog>`_.
+
+To run the tests::
+
+    $ pip install -r requirements.pip
+    $ tox
+
+
+.. |ci-status| image:: 
https://github.com/nedbat/cog/actions/workflows/ci.yml/badge.svg?branch=master&event=push
+    :target: https://github.com/nedbat/cog/actions/workflows/ci.yml
+    :alt: CI status
+.. |kit| image:: https://img.shields.io/pypi/v/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: PyPI status
+.. |format| image:: https://img.shields.io/pypi/format/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: Kit format
+.. |license| image:: https://img.shields.io/pypi/l/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: License
+.. |versions| image:: https://img.shields.io/pypi/pyversions/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: Python versions supported
+.. |status| image:: https://img.shields.io/pypi/status/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: Package stability
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/README.rst new/cogapp-3.3.0/README.rst
--- old/cogapp-3.0.0/README.rst 2019-04-01 22:34:14.000000000 +0200
+++ new/cogapp-3.3.0/README.rst 2021-11-13 13:54:54.000000000 +0100
@@ -2,11 +2,10 @@
 Cog
 ===
 
-Cog content generation tool.
+Cog content generation tool. Small bits of computation for static files.
 
 |  |license| |versions| |status|
-|  |ci-status| |win-ci-status|
-|  |kit| |format|
+|  |ci-status| |kit| |format|
 
 See http://nedbatchelder.com/code/cog for details.
 
@@ -19,13 +18,10 @@
     $ tox
 
 
-.. |ci-status| image:: https://travis-ci.com/nedbat/cog.svg?branch=master
-    :target: https://travis-ci.com/nedbat/cog
-    :alt: Build status
-.. |win-ci-status| image:: 
https://ci.appveyor.com/api/projects/status/hqq7x2vawnci7v7d/branch/master?svg=true
-    :target: https://ci.appveyor.com/project/nedbat/cog
-    :alt: Windows build status
-.. |kit| image:: https://badge.fury.io/py/cogapp.svg
+.. |ci-status| image:: 
https://github.com/nedbat/cog/actions/workflows/ci.yml/badge.svg?branch=master&event=push
+    :target: https://github.com/nedbat/cog/actions/workflows/ci.yml
+    :alt: CI status
+.. |kit| image:: https://img.shields.io/pypi/v/cogapp.svg
     :target: https://pypi.org/project/cogapp/
     :alt: PyPI status
 .. |format| image:: https://img.shields.io/pypi/format/cogapp.svg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/cogapp/cogapp.py 
new/cogapp-3.3.0/cogapp/cogapp.py
--- old/cogapp-3.0.0/cogapp/cogapp.py   2019-04-01 22:40:53.000000000 +0200
+++ new/cogapp-3.3.0/cogapp/cogapp.py   2021-11-19 18:26:21.000000000 +0100
@@ -2,7 +2,7 @@
 """ Cog content generation tool.
     http://nedbatchelder.com/code/cog
 
-    Copyright 2004-2019, Ned Batchelder.
+    Copyright 2004-2021, Ned Batchelder.
 """
 
 from __future__ import absolute_import, print_function
@@ -11,7 +11,6 @@
 import getopt
 import glob
 import hashlib
-import imp
 import linecache
 import os
 import re
@@ -23,7 +22,7 @@
 
 __all__ = ['Cog', 'CogUsageError', 'main']
 
-__version__ = '3.0.0'
+__version__ = '3.3.0'
 
 usage = """\
 cog - generate content with inlined Python code.
@@ -44,6 +43,7 @@
     -o OUTNAME  Write the output to OUTNAME.
     -p PROLOGUE Prepend the generator source with PROLOGUE. Useful to insert an
                 import line. Example: -p "import math"
+    -P          Use print() instead of cog.outl() for code output.
     -r          Replace the input file with the output.
     -s STRING   Suffix all generated output lines with STRING.
     -U          Write the output with Unix newlines (only LF line-endings).
@@ -52,13 +52,14 @@
     -x          Excise all the generated output without running the generators.
     -z          The end-output marker can be omitted, and is assumed at eof.
     -v          Print the version of cog and exit.
-    --verbosity=VERBOSITY
-                Control the amount of output. 2 (the default) lists all files,
-                1 lists only changed files, 0 lists no files.
+    --check     Check that the files would not change if run again.
     --markers='START END END-OUTPUT'
                 The patterns surrounding cog inline instructions. Should
                 include three values separated by spaces, the start, end,
                 and end-output markers. Defaults to '[[[cog ]]] [[[end]]]'.
+    --verbosity=VERBOSITY
+                Control the amount of output. 2 (the default) lists all files,
+                1 lists only changed files, 0 lists no files.
     -h          Print this help.
 """
 
@@ -95,6 +96,11 @@
     """
     pass
 
+class CogCheckFailed(CogError):
+    """ A --check failed.
+    """
+    pass
+
 class Redirectable:
     """ An object with its own stdout and stderr files.
     """
@@ -164,6 +170,10 @@
         cog.cogmodule.outl = self.outl
         cog.cogmodule.error = self.error
 
+        real_stdout = sys.stdout
+        if self.options.bPrintOutput:
+            sys.stdout = captured_stdout = StringIO()
+
         self.outstring = ''
         try:
             eval(code, globals)
@@ -176,6 +186,11 @@
             msg = "".join(traceback.format_list(frames))
             msg += "{}: {}".format(typ.__name__, err)
             raise CogUserException(msg)
+        finally:
+            sys.stdout = real_stdout
+
+        if self.options.bPrintOutput:
+            self.outstring = captured_stdout.getvalue()
 
         # We need to make sure that the last line in the output
         # ends with a newline, or it will be joined to the
@@ -259,6 +274,8 @@
         self.sEncoding = "utf-8"
         self.verbosity = 2
         self.sPrologue = ''
+        self.bPrintOutput = False
+        self.bCheck = False
 
     def __eq__(self, other):
         """ Comparison operator for tests to use.
@@ -281,8 +298,9 @@
         try:
             opts, self.args = getopt.getopt(
                 argv,
-                'cdD:eI:n:o:rs:p:Uvw:xz',
+                'cdD:eI:n:o:rs:p:PUvw:xz',
                 [
+                    'check',
                     'markers=',
                     'verbosity=',
                 ]
@@ -304,7 +322,7 @@
             elif o == '-e':
                 self.bWarnEmpty = True
             elif o == '-I':
-                self.addToIncludePath(a)
+                self.addToIncludePath(os.path.abspath(a))
             elif o == '-n':
                 self.sEncoding = a
             elif o == '-o':
@@ -315,6 +333,8 @@
                 self.sSuffix = a
             elif o == '-p':
                 self.sPrologue = a
+            elif o == '-P':
+                self.bPrintOutput = True
             elif o == '-U':
                 self.bNewlines = True
             elif o == '-v':
@@ -325,6 +345,8 @@
                 self.bNoGenerate = True
             elif o == '-z':
                 self.bEofCanBeEnd = True
+            elif o == '--check':
+                self.bCheck = True
             elif o == '--markers':
                 self._parse_markers(a)
             elif o == '--verbosity':
@@ -360,7 +382,8 @@
         self.options = CogOptions()
         self._fixEndOutputPatterns()
         self.cogmodulename = "cog"
-        self.installCogModule()
+        self.createCogModule()
+        self.bCheckFailed = False
 
     def _fixEndOutputPatterns(self):
         end_output = re.escape(self.options.sEndOutput)
@@ -379,11 +402,14 @@
     def isEndOutputLine(self, s):
         return self.options.sEndOutput in s
 
-    def installCogModule(self):
-        """ Magic mumbo-jumbo so that imported Python modules
+    def createCogModule(self):
+        """ Make a cog "module" object so that imported Python modules
             can say "import cog" and get our state.
         """
-        self.cogmodule = imp.new_module('cog')
+        class DummyModule(object):
+            """Modules don't have to be anything special, just an object will 
do."""
+            pass
+        self.cogmodule = DummyModule()
         self.cogmodule.path = []
 
     def openOutputFile(self, fname):
@@ -440,7 +466,7 @@
             self.cogmodule.outFile = sFileOut
             self.cogmodulename = 'cog_' + 
hashlib.md5(sFileOut.encode()).hexdigest()
             sys.modules[self.cogmodulename] = self.cogmodule
-            # if "import cog" explicitly done in code by user, note threading 
will cause clashes. 
+            # if "import cog" explicitly done in code by user, note threading 
will cause clashes.
             sys.modules['cog'] = self.cogmodule
 
             # The globals dict we'll use for this file.
@@ -652,11 +678,12 @@
             # How we process the file depends on where the output is going.
             if self.options.sOutputName:
                 self.processFile(sFile, self.options.sOutputName, sFile)
-            elif self.options.bReplace:
+            elif self.options.bReplace or self.options.bCheck:
                 # We want to replace the cog file with the output,
                 # but only if they differ.
+                verb = "Cogging" if self.options.bReplace else "Checking"
                 if self.options.verbosity >= 2:
-                    self.prout("Cogging %s" % sFile, end="")
+                    self.prout("%s %s" % (verb, sFile), end="")
                     bNeedNewline = True
 
                 try:
@@ -667,10 +694,14 @@
                     if sOldText != sNewText:
                         if self.options.verbosity >= 1:
                             if self.options.verbosity < 2:
-                                self.prout("Cogging %s" % sFile, end="")
+                                self.prout("%s %s" % (verb, sFile), end="")
                             self.prout("  (changed)")
                             bNeedNewline = False
-                        self.replaceFile(sFile, sNewText)
+                        if self.options.bReplace:
+                            self.replaceFile(sFile, sNewText)
+                        else:
+                            assert self.options.bCheck
+                            self.bCheckFailed = True
                 finally:
                     # The try-finally block is so we can print a partial line
                     # with the name of the file, and print (changed) on the
@@ -752,6 +783,9 @@
         else:
             raise CogUsageError("No files to process")
 
+        if self.bCheckFailed:
+            raise CogCheckFailed("Check failed")
+
     def main(self, argv):
         """ Handle the command-line execution for cog.
         """
@@ -761,7 +795,7 @@
             return 0
         except CogUsageError as err:
             self.prerr(err)
-            self.prerr("(for help use -?)")
+            self.prerr("(for help use -h)")
             return 2
         except CogGeneratedError as err:
             self.prerr("Error: %s" % err)
@@ -770,6 +804,9 @@
             self.prerr("Traceback (most recent call last):")
             self.prerr(err.args[0])
             return 4
+        except CogCheckFailed as err:
+            self.prerr(err)
+            return 5
         except CogError as err:
             self.prerr(err)
             return 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/cogapp/test_cogapp.py 
new/cogapp-3.3.0/cogapp/test_cogapp.py
--- old/cogapp-3.0.0/cogapp/test_cogapp.py      2019-04-01 22:46:39.000000000 
+0200
+++ new/cogapp-3.3.0/cogapp/test_cogapp.py      2021-11-19 18:22:36.000000000 
+0100
@@ -1,7 +1,7 @@
 """ Test cogapp.
     http://nedbatchelder.com/code/cog
 
-    Copyright 2004-2019, Ned Batchelder.
+    Copyright 2004-2021, Ned Batchelder.
 """
 
 from __future__ import absolute_import
@@ -914,7 +914,7 @@
         ret = main()
         self.assertEqual(ret, 2)
         stderr = sys.stderr.getvalue()
-        self.assertEqual(stderr, 'option -Z not recognized\n(for help use 
-?)\n')
+        self.assertEqual(stderr, 'option -Z not recognized\n(for help use 
-h)\n')
 
     files = {
         'test.cog': """\
@@ -1018,6 +1018,38 @@
         output = self.output.getvalue()
         self.assertIn("(changed)", output)
 
+    def testPrintOutput(self):
+        d = {
+            'test.cog': """\
+                // This is my C++ file.
+                //[[[cog
+                fnames = ['DoSomething', 'DoAnotherThing', 'DoLastThing']
+                for fn in fnames:
+                    print("void %s();" % fn)
+                //]]]
+                //[[[end]]]
+                """,
+
+            'test.out': """\
+                // This is my C++ file.
+                //[[[cog
+                fnames = ['DoSomething', 'DoAnotherThing', 'DoLastThing']
+                for fn in fnames:
+                    print("void %s();" % fn)
+                //]]]
+                void DoSomething();
+                void DoAnotherThing();
+                void DoLastThing();
+                //[[[end]]]
+                """,
+            }
+
+        makeFiles(d)
+        self.cog.callableMain(['argv0', '-rP', 'test.cog'])
+        self.assertFilesSame('test.cog', 'test.out')
+        output = self.output.getvalue()
+        self.assertIn("(changed)", output)
+
     def testWildcards(self):
         d = {
             'test.cog': """\
@@ -1998,7 +2030,7 @@
         self.assertFilesSame('test.cog', 'test.out')
 
     def testThreads(self):
-        # Test that the implictly imported cog module is actually different for
+        # Test that the implicitly imported cog module is actually different 
for
         # different threads.
         numthreads = 20
 
@@ -2021,7 +2053,7 @@
                     ['cog.py', '-r', '-D', 'FIRST={}'.format(num+1), 
'f{}.cog'.format(num)]
                     )
                 assert ret == 0
-            except Exception as exc:
+            except Exception as exc:    # pragma: no cover (only happens on 
test failure)
                 results.append(exc)
             else:
                 results.append(None)
@@ -2034,6 +2066,129 @@
         assert results == [None] * numthreads
 
 
+class CheckTests(TestCaseWithTempDir):
+    def run_check(self, args, status=0):
+        actual_status = self.cog.main(['argv0', '--check'] + args)
+        print(self.output.getvalue())
+        self.assertEqual(status, actual_status)
+
+    def assert_made_files_unchanged(self, d):
+        for name, content in d.items():
+            content = reindentBlock(content)
+            if os.name == 'nt':
+                content = content.replace("\n", "\r\n")
+            self.assertFileContent(name, content)
+
+    def test_check_no_cog(self):
+        d = {
+            'hello.txt': """\
+                Hello.
+                """,
+            }
+        makeFiles(d)
+        self.run_check(['hello.txt'], status=0)
+        self.assertEqual(self.output.getvalue(), "Checking hello.txt\n")
+        self.assert_made_files_unchanged(d)
+
+    def test_check_good(self):
+        d = {
+            'unchanged.cog': """\
+                //[[[cog
+                cog.outl("hello world")
+                //]]]
+                hello world
+                //[[[end]]]
+                """,
+            }
+        makeFiles(d)
+        self.run_check(['unchanged.cog'], status=0)
+        self.assertEqual(self.output.getvalue(), "Checking unchanged.cog\n")
+        self.assert_made_files_unchanged(d)
+
+    def test_check_bad(self):
+        d = {
+            'changed.cog': """\
+                //[[[cog
+                cog.outl("goodbye world")
+                //]]]
+                hello world
+                //[[[end]]]
+                """,
+            }
+        makeFiles(d)
+        self.run_check(['changed.cog'], status=5)
+        self.assertEqual(self.output.getvalue(), "Checking changed.cog  
(changed)\nCheck failed\n")
+        self.assert_made_files_unchanged(d)
+
+    def test_check_mixed(self):
+        d = {
+            'unchanged.cog': """\
+                //[[[cog
+                cog.outl("hello world")
+                //]]]
+                hello world
+                //[[[end]]]
+                """,
+            'changed.cog': """\
+                //[[[cog
+                cog.outl("goodbye world")
+                //]]]
+                hello world
+                //[[[end]]]
+                """,
+            }
+        makeFiles(d)
+        for verbosity, output in [
+            ("0", "Check failed\n"),
+            ("1", "Checking changed.cog  (changed)\nCheck failed\n"),
+            ("2", "Checking unchanged.cog\nChecking changed.cog  
(changed)\nCheck failed\n"),
+        ]:
+            self.newCog()
+            self.run_check(['--verbosity=%s' % verbosity, 'unchanged.cog', 
'changed.cog'], status=5)
+            self.assertEqual(self.output.getvalue(), output)
+            self.assert_made_files_unchanged(d)
+
+    def test_check_with_good_checksum(self):
+        d = {
+            'good.txt': """\
+                //[[[cog
+                cog.outl("This line was newly")
+                cog.outl("generated by cog")
+                cog.outl("blah blah.")
+                //]]]
+                This line was newly
+                generated by cog
+                blah blah.
+                //[[[end]]] (checksum: a8540982e5ad6b95c9e9a184b26f4346)
+                """,
+            }
+        makeFiles(d)
+        # Have to use -c with --check if there are checksums in the file.
+        self.run_check(['-c', 'good.txt'], status=0)
+        self.assertEqual(self.output.getvalue(), "Checking good.txt\n")
+        self.assert_made_files_unchanged(d)
+
+    def test_check_with_bad_checksum(self):
+        d = {
+            'bad.txt': """\
+                //[[[cog
+                cog.outl("This line was newly")
+                cog.outl("generated by cog")
+                cog.outl("blah blah.")
+                //]]]
+                This line was newly
+                generated by cog
+                blah blah.
+                //[[[end]]] (checksum: a9999999e5ad6b95c9e9a184b26f4346)
+                """,
+            }
+        makeFiles(d)
+        # Have to use -c with --check if there are checksums in the file.
+        self.run_check(['-c', 'bad.txt'], status=1)
+        self.assertEqual(self.output.getvalue(), "Checking 
bad.txt\nbad.txt(9): Output has been edited! Delete old checksum to 
unprotect.\n")
+        self.assert_made_files_unchanged(d)
+
+
 class WritabilityTests(TestCaseWithTempDir):
 
     d = {
@@ -2057,11 +2212,11 @@
             """,
         }
 
-    if os.name == 'nt':     #pragma: no cover
+    if os.name == 'nt':
         # for Windows
         cmd_w_args = 'attrib -R %s'
         cmd_w_asterisk = 'attrib -R *'
-    else:   #pragma: no cover
+    else:
         # for unix-like
         cmd_w_args = 'chmod +w %s'
         cmd_w_asterisk = 'chmod +w *'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/cogapp.egg-info/PKG-INFO 
new/cogapp-3.3.0/cogapp.egg-info/PKG-INFO
--- old/cogapp-3.0.0/cogapp.egg-info/PKG-INFO   2019-04-02 12:29:26.000000000 
+0200
+++ new/cogapp-3.3.0/cogapp.egg-info/PKG-INFO   2021-11-19 18:27:52.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: cogapp
-Version: 3.0.0
+Version: 3.3.0
 Summary: Cog: A content generator for executing Python snippets in source 
files.
 Home-page: http://nedbatchelder.com/code/cog
 Author: Ned Batchelder
@@ -9,49 +9,8 @@
 Project-URL: Documentation, http://nedbatchelder.com/code/cog
 Project-URL: Code, http://github.com/nedbat/cog
 Project-URL: Issues, https://github.com/nedbat/cog/issues
-Description: ===
-        Cog
-        ===
-        
-        Cog content generation tool.
-        
-        |  |license| |versions| |status|
-        |  |ci-status| |win-ci-status|
-        |  |kit| |format|
-        
-        See http://nedbatchelder.com/code/cog for details.
-        
-        Code repository and issue tracker are at
-        `GitHub <https://github.com/nedbat/cog>`_.
-        
-        To run the tests::
-        
-            $ pip install -r requirements.pip
-            $ tox
-        
-        
-        .. |ci-status| image:: 
https://travis-ci.com/nedbat/cog.svg?branch=master
-            :target: https://travis-ci.com/nedbat/cog
-            :alt: Build status
-        .. |win-ci-status| image:: 
https://ci.appveyor.com/api/projects/status/hqq7x2vawnci7v7d/branch/master?svg=true
-            :target: https://ci.appveyor.com/project/nedbat/cog
-            :alt: Windows build status
-        .. |kit| image:: https://badge.fury.io/py/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: PyPI status
-        .. |format| image:: https://img.shields.io/pypi/format/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: Kit format
-        .. |license| image:: https://img.shields.io/pypi/l/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: License
-        .. |versions| image:: https://img.shields.io/pypi/pyversions/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: Python versions supported
-        .. |status| image:: https://img.shields.io/pypi/status/cogapp.svg
-            :target: https://pypi.org/project/cogapp/
-            :alt: Package stability
-        
+Project-URL: Funding, https://github.com/users/nedbat/sponsorship
+Project-URL: Twitter, https://twitter.com/nedbat
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -63,6 +22,51 @@
 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: Topic :: Software Development :: Code Generators
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
 Description-Content-Type: text/x-rst
+License-File: LICENSE.txt
+License-File: AUTHORS.txt
+
+===
+Cog
+===
+
+Cog content generation tool. Small bits of computation for static files.
+
+|  |license| |versions| |status|
+|  |ci-status| |kit| |format|
+
+See http://nedbatchelder.com/code/cog for details.
+
+Code repository and issue tracker are at
+`GitHub <https://github.com/nedbat/cog>`_.
+
+To run the tests::
+
+    $ pip install -r requirements.pip
+    $ tox
+
+
+.. |ci-status| image:: 
https://github.com/nedbat/cog/actions/workflows/ci.yml/badge.svg?branch=master&event=push
+    :target: https://github.com/nedbat/cog/actions/workflows/ci.yml
+    :alt: CI status
+.. |kit| image:: https://img.shields.io/pypi/v/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: PyPI status
+.. |format| image:: https://img.shields.io/pypi/format/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: Kit format
+.. |license| image:: https://img.shields.io/pypi/l/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: License
+.. |versions| image:: https://img.shields.io/pypi/pyversions/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: Python versions supported
+.. |status| image:: https://img.shields.io/pypi/status/cogapp.svg
+    :target: https://pypi.org/project/cogapp/
+    :alt: Package stability
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/cogapp.egg-info/SOURCES.txt 
new/cogapp-3.3.0/cogapp.egg-info/SOURCES.txt
--- old/cogapp-3.0.0/cogapp.egg-info/SOURCES.txt        2019-04-02 
12:29:26.000000000 +0200
+++ new/cogapp-3.3.0/cogapp.egg-info/SOURCES.txt        2021-11-19 
18:27:52.000000000 +0100
@@ -1,3 +1,4 @@
+AUTHORS.txt
 LICENSE.txt
 MANIFEST.in
 README.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cogapp-3.0.0/setup.py new/cogapp-3.3.0/setup.py
--- old/cogapp-3.0.0/setup.py   2019-04-01 22:34:14.000000000 +0200
+++ new/cogapp-3.3.0/setup.py   2021-11-19 18:26:21.000000000 +0100
@@ -2,7 +2,7 @@
 """ Setup.py for Cog
     http://nedbatchelder.com/code/cog
 
-    Copyright 2004-2019, Ned Batchelder.
+    Copyright 2004-2021, Ned Batchelder.
 """
 
 from setuptools import setup
@@ -12,7 +12,7 @@
 
 setup(
     name = 'cogapp',    # Because there's already a Cog in pypi!  :(
-    version = '3.0.0',
+    version = '3.3.0',
     url = 'http://nedbatchelder.com/code/cog',
     author = 'Ned Batchelder',
     author_email = 'n...@nedbatchelder.com',
@@ -26,6 +26,8 @@
         'Documentation': 'http://nedbatchelder.com/code/cog',
         'Code': 'http://github.com/nedbat/cog',
         'Issues': 'https://github.com/nedbat/cog/issues',
+        'Funding': 'https://github.com/users/nedbat/sponsorship',
+        'Twitter': 'https://twitter.com/nedbat',
     },
 
     classifiers = [
@@ -39,10 +41,12 @@
         "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",
         "Topic :: Software Development :: Code Generators",
         ],
 
-    python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4",
+    python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
 
     license = 'MIT',
 

Reply via email to