openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
August 2020
- 1 participants
- 2816 discussions
Hello community,
here is the log from the commit of package python-distributed for openSUSE:Factory checked in at 2020-08-31 16:51:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-distributed (Old)
and /work/SRC/openSUSE:Factory/.python-distributed.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-distributed"
Mon Aug 31 16:51:09 2020 rev:33 rq:830500 version:2.25.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-distributed/python-distributed.changes 2020-08-17 12:03:37.374635499 +0200
+++ /work/SRC/openSUSE:Factory/.python-distributed.new.3399/python-distributed.changes 2020-08-31 16:51:52.248401564 +0200
@@ -1,0 +2,29 @@
+Sat Aug 29 15:53:08 UTC 2020 - Arun Persaud <arun(a)gmx.de>
+
+- update to version 2.25.0:
+ * Update for black (GH#4081) Tom Augspurger
+ * Provide informative error when connecting an older version of Dask
+ (GH#4076) Matthew Rocklin
+ * Simplify pack_frames (GH#4068) jakirkham
+ * Simplify frame_split_size (GH#4067) jakirkham
+ * Use list.insert to add prelude up front (GH#4066) jakirkham
+ * Graph helper text (GH#4064) Julia Signell
+ * Graph dashboard: Reset container data if task number is too large
+ (GH#4056) Florian Jetter
+ * Ensure semaphore picks correct IOLoop for threadpool workers
+ (GH#4060) Florian Jetter
+ * Add cluster log method (GH#4051) Jacob Tomlinson
+ * Cleanup more exception tracebacks (GH#4054) Krishan Bhasin
+ * Improve documentation of scheduler.locks options (GH#4062) Florian
+ Jetter
+
+- changes from version 2.24.0:
+ * Move toolbar to above and fix y axis (#4043) Julia Signell
+ * Make behavior clearer for how to get worker dashboard (#4047)
+ Julia Signell
+ * Worker dashboard clean up (#4046) Julia Signell
+ * Add a default argument to the datasets and a possibility to
+ override datasets (#4052) Nils Braun
+ * Discover HTTP endpoints (#3744) Martin Durant
+
+-------------------------------------------------------------------
Old:
----
distributed-2.23.0.tar.gz
New:
----
distributed-2.25.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-distributed.spec ++++++
--- /var/tmp/diff_new_pack.ta1URO/_old 2020-08-31 16:51:53.688402262 +0200
+++ /var/tmp/diff_new_pack.ta1URO/_new 2020-08-31 16:51:53.692402264 +0200
@@ -21,7 +21,7 @@
# Test requires network connection
%bcond_with test
Name: python-distributed
-Version: 2.23.0
+Version: 2.25.0
Release: 0
Summary: Library for distributed computing with Python
License: BSD-3-Clause
++++++ distributed-2.23.0.tar.gz -> distributed-2.25.0.tar.gz ++++++
++++ 4291 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package python-dask for openSUSE:Factory checked in at 2020-08-31 16:51:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-dask (Old)
and /work/SRC/openSUSE:Factory/.python-dask.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dask"
Mon Aug 31 16:51:03 2020 rev:37 rq:830499 version:2.25.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-dask/python-dask.changes 2020-08-17 12:03:56.246646016 +0200
+++ /work/SRC/openSUSE:Factory/.python-dask.new.3399/python-dask.changes 2020-08-31 16:51:46.512398783 +0200
@@ -1,0 +2,40 @@
+Sat Aug 29 15:51:43 UTC 2020 - Arun Persaud <arun(a)gmx.de>
+
+- update to version 2.25.0:
+ * Core
+ + Compare key hashes in subs() (:pr:`6559`) Mads R. B. Kristensen
+ + Rerun with latest black release (:pr:`6568`) James Bourbeau
+ + License update (:pr:`6554`) Tom Augspurger
+ * DataFrame
+ + Add gs read_parquet example (:pr:`6548`) Ray Bell
+ * Documentation
+ + Remove version from documentation page names (:pr:`6558`) James
+ Bourbeau
+ + Update kubernetes-helm.rst (:pr:`6523`) David Sheldon
+ + Stop 2020 survey (:pr:`6547`) Tom Augspurger
+
+- changes from version 2.24.0:
+ * Array
+ + Fix setting random seed in tests. (:pr:`6518`) Elliott Sales de
+ Andrade
+ + Support meta in apply gufunc (:pr:`6521`) joshreback
+ + Replace cupy.sparse with cupyx.scipy.sparse (:pr:`6530`) John A
+ Kirkham
+ * Dataframe
+ + Bump up tolerance for rolling tests (:pr:`6502`) Julia Signell
+ + Implement DatFrame.__len__ (:pr:`6515`) Tom Augspurger
+ + Infer arrow schema in to_parquet (for ArrowEngine`) (:pr:`6490`)
+ `Richard Zamora`_
+ + Fix parquet test when no pyarrow (:pr:`6524`) Martin Durant
+ + Remove problematic filter arguments in ArrowEngine (:pr:`6527`)
+ `Richard Zamora`_
+ + Avoid schema validation by default in ArrowEngine (:pr:`6536`)
+ `Richard Zamora`_
+ * Core
+ + Use unpack_collections in make_blockwise_graph (:pr:`6517`)
+ `Thomas Fan`_
+ + Move key_split() from optimization.py to utils.py (:pr:`6529`)
+ Mads R. B. Kristensen
+ + Make tests run on moto server (:pr:`6528`) Martin Durant
+
+-------------------------------------------------------------------
Old:
----
dask-2.23.0.tar.gz
New:
----
dask-2.25.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-dask.spec ++++++
--- /var/tmp/diff_new_pack.trhdTO/_old 2020-08-31 16:51:47.796399405 +0200
+++ /var/tmp/diff_new_pack.trhdTO/_new 2020-08-31 16:51:47.800399407 +0200
@@ -27,7 +27,7 @@
%endif
%define skip_python2 1
Name: python-dask%{psuffix}
-Version: 2.23.0
+Version: 2.25.0
Release: 0
Summary: Minimal task scheduling abstraction
License: BSD-3-Clause
++++++ dask-2.23.0.tar.gz -> dask-2.25.0.tar.gz ++++++
++++ 4925 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package python-cpplint for openSUSE:Factory checked in at 2020-08-31 16:50:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cpplint (Old)
and /work/SRC/openSUSE:Factory/.python-cpplint.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cpplint"
Mon Aug 31 16:50:59 2020 rev:5 rq:830677 version:1.5.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cpplint/python-cpplint.changes 2020-07-01 14:27:02.830833105 +0200
+++ /work/SRC/openSUSE:Factory/.python-cpplint.new.3399/python-cpplint.changes 2020-08-31 16:51:38.252394778 +0200
@@ -1,0 +2,9 @@
+Mon Aug 31 06:47:40 UTC 2020 - Steve Kowalik <steven.kowalik(a)suse.com>
+
+- Update to 1.5.4:
+ * Fix google#166, Allow space before C++11 attributes
+ * Fix #156: sed/gsed output parameter rejected
+ * Fix #156: sed/gsed output without other stdout information
+ * improvements to regression tests
+
+-------------------------------------------------------------------
Old:
----
cpplint-1.5.2.tar.gz
New:
----
cpplint-1.5.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-cpplint.spec ++++++
--- /var/tmp/diff_new_pack.02X0sM/_old 2020-08-31 16:51:41.060396139 +0200
+++ /var/tmp/diff_new_pack.02X0sM/_new 2020-08-31 16:51:41.064396141 +0200
@@ -18,11 +18,10 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-cpplint
-Version: 1.5.2
+Version: 1.5.4
Release: 0
Summary: An automated checker to make sure a C++ file follows Google's C++ style guide
License: BSD-3-Clause
-Group: Development/Languages/Python
URL: https://github.com/cpplint/cpplint
Source: https://files.pythonhosted.org/packages/source/c/cpplint/cpplint-%{version}…
BuildRequires: %{python_module pytest}
++++++ cpplint-1.5.2.tar.gz -> cpplint-1.5.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/PKG-INFO new/cpplint-1.5.4/PKG-INFO
--- old/cpplint-1.5.2/PKG-INFO 2020-06-24 03:04:30.000000000 +0200
+++ new/cpplint-1.5.4/PKG-INFO 2020-08-18 02:50:19.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cpplint
-Version: 1.5.2
+Version: 1.5.4
Summary: Automated checker to ensure C++ files follow Google's style guide
Home-page: https://github.com/cpplint/cpplint
Maintainer: cpplint Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/cpplint.egg-info/PKG-INFO new/cpplint-1.5.4/cpplint.egg-info/PKG-INFO
--- old/cpplint-1.5.2/cpplint.egg-info/PKG-INFO 2020-06-24 03:04:30.000000000 +0200
+++ new/cpplint-1.5.4/cpplint.egg-info/PKG-INFO 2020-08-18 02:50:19.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cpplint
-Version: 1.5.2
+Version: 1.5.4
Summary: Automated checker to ensure C++ files follow Google's style guide
Home-page: https://github.com/cpplint/cpplint
Maintainer: cpplint Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/cpplint.egg-info/SOURCES.txt new/cpplint-1.5.4/cpplint.egg-info/SOURCES.txt
--- old/cpplint-1.5.2/cpplint.egg-info/SOURCES.txt 2020-06-24 03:04:30.000000000 +0200
+++ new/cpplint-1.5.4/cpplint.egg-info/SOURCES.txt 2020-08-18 02:50:19.000000000 +0200
@@ -42,6 +42,7 @@
samples/protobuf-sample/src/descriptor_unittest.cc
samples/silly-sample/filters.def
samples/silly-sample/includeorder_cfirst.def
+samples/silly-sample/sed.def
samples/silly-sample/simple.def
samples/silly-sample/src/sillycode.cpp
samples/simple-sample/main.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/cpplint.py new/cpplint-1.5.4/cpplint.py
--- old/cpplint-1.5.2/cpplint.py 2020-06-24 02:47:38.000000000 +0200
+++ new/cpplint-1.5.4/cpplint.py 2020-08-18 02:48:26.000000000 +0200
@@ -59,7 +59,7 @@
# if empty, use defaults
_valid_extensions = set([])
-__VERSION__ = '1.5.2'
+__VERSION__ = '1.5.4'
try:
xrange # Python 2
@@ -354,6 +354,13 @@
'whitespace/todo',
]
+# keywords to use with --outputs which generate stdout for machine processing
+_MACHINE_OUTPUTS = [
+ 'junit',
+ 'sed',
+ 'gsed'
+]
+
# These error categories are no longer enforced by cpplint, but for backwards-
# compatibility they may still appear in NOLINT comments.
_LEGACY_ERROR_CATEGORIES = [
@@ -854,7 +861,7 @@
# Files to exclude from linting. This is set by the --exclude flag.
_excludes = None
-# Whether to supress PrintInfo messages
+# Whether to supress all PrintInfo messages, UNRELATED to --quiet flag
_quiet = False
# The allowed line length of files.
@@ -1344,7 +1351,9 @@
self.PrintInfo('Total errors found: %d\n' % self.error_count)
def PrintInfo(self, message):
- if not _quiet and self.output_format != 'junit':
+ # _quiet does not represent --quiet flag.
+ # Hide infos from stdout to keep stdout pure for machine consumption
+ if not _quiet and self.output_format not in _MACHINE_OUTPUTS:
sys.stdout.write(message)
def PrintError(self, message):
@@ -1851,7 +1860,7 @@
def RemoveMultiLineCommentsFromRange(lines, begin, end):
"""Clears a range of lines for multi-line comments."""
- # Having // dummy comments makes the lines non-empty, so we will not get
+ # Having // <empty> comments makes the lines non-empty, so we will not get
# unnecessary blank line warnings later in the code.
for i in range(begin, end):
lines[i] = '/**/'
@@ -2225,7 +2234,7 @@
"""Logs an error if no Copyright message appears at the top of the file."""
# We'll say it should occur by line 10. Don't forget there's a
- # dummy line at the front.
+ # placeholder line at the front.
for line in xrange(1, min(len(lines), 11)):
if re.search(r'Copyright', lines[line], re.I): break
else: # means no copyright line was found
@@ -3768,9 +3777,10 @@
# get rid of comments and strings
line = clean_lines.elided[linenum]
- # You shouldn't have spaces before your brackets, except maybe after
- # 'delete []', 'return []() {};', or 'auto [abc, ...] = ...;'.
- if Search(r'\w\s+\[', line) and not Search(r'(?:auto&?|delete|return)\s+\[', line):
+ # You shouldn't have spaces before your brackets, except for C++11 attributes
+ # or maybe after 'delete []', 'return []() {};', or 'auto [abc, ...] = ...;'.
+ if (Search(r'\w\s+\[(?!\[)', line) and
+ not Search(r'(?:auto&?|delete|return)\s+\[', line)):
error(filename, linenum, 'whitespace/braces', 5,
'Extra space before [')
@@ -6743,9 +6753,9 @@
if opt == '--version':
PrintVersion()
elif opt == '--output':
- if val not in ('emacs', 'vs7', 'eclipse', 'junit'):
+ if val not in ('emacs', 'vs7', 'eclipse', 'junit', 'sed', 'gsed'):
PrintUsage('The only allowed output formats are emacs, vs7, eclipse '
- 'and junit.')
+ 'sed, gsed and junit.')
output_format = val
elif opt == '--quiet':
quiet = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/cpplint_clitest.py new/cpplint-1.5.4/cpplint_clitest.py
--- old/cpplint-1.5.2/cpplint_clitest.py 2020-06-24 02:45:33.000000000 +0200
+++ new/cpplint-1.5.4/cpplint_clitest.py 2020-08-05 02:41:14.000000000 +0200
@@ -83,7 +83,7 @@
def setUpClass(cls):
"""setup tmp folder for testing with samples and custom additions by subclasses"""
try:
- cls._root = tempfile.mkdtemp()
+ cls._root = os.path.realpath(tempfile.mkdtemp())
shutil.copytree('samples', os.path.join(cls._root, 'samples'))
cls.prepare_directory(cls._root)
except Exception as e:
@@ -164,7 +164,7 @@
self.checkAllInFolder('./samples/vlc-sample', 1)
def testSillySample(self):
- self.checkAllInFolder('./samples/silly-sample', 3)
+ self.checkAllInFolder('./samples/silly-sample', 4)
def testBoostSample(self):
self.checkAllInFolder('./samples/boost-sample', 4)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/cpplint_unittest.py new/cpplint-1.5.4/cpplint_unittest.py
--- old/cpplint-1.5.2/cpplint_unittest.py 2020-06-24 02:46:02.000000000 +0200
+++ new/cpplint-1.5.4/cpplint_unittest.py 2020-08-05 02:42:58.000000000 +0200
@@ -2705,6 +2705,14 @@
self.TestLint('file_tocs_[i] = (FileToc) {a, b, c};', '')
self.TestMultiLineLint('class X : public Y,\npublic Z {};', '')
+ def testSpacingBeforeBrackets(self):
+ self.TestLint('int numbers [] = { 1, 2, 3 };',
+ 'Extra space before [ [whitespace/braces] [5]')
+ # space allowed in some cases
+ self.TestLint('auto [abc, def] = func();', '')
+ self.TestLint('#define NODISCARD [[nodiscard]]', '')
+ self.TestLint('void foo(int param [[maybe_unused]]);', '')
+
def testLambda(self):
self.TestLint('auto x = []() {};', '')
self.TestLint('return []() {};', '')
@@ -4134,7 +4142,7 @@
def testRecursiveArgument(self):
working_dir = os.getcwd()
- temp_dir = tempfile.mkdtemp()
+ temp_dir = os.path.realpath(tempfile.mkdtemp())
try:
src_dir = os.path.join(temp_dir, "src")
nested_dir = os.path.join(temp_dir, "src", "nested")
@@ -4154,7 +4162,7 @@
def testRecursiveExcludeInvalidFileExtension(self):
working_dir = os.getcwd()
- temp_dir = tempfile.mkdtemp()
+ temp_dir = os.path.realpath(tempfile.mkdtemp())
try:
src_dir = os.path.join(temp_dir, "src")
os.makedirs(src_dir)
@@ -4175,7 +4183,7 @@
def testRecursiveExclude(self):
working_dir = os.getcwd()
- temp_dir = tempfile.mkdtemp()
+ temp_dir = os.path.realpath(tempfile.mkdtemp())
try:
src_dir = os.path.join(temp_dir, 'src')
src2_dir = os.path.join(temp_dir, 'src2')
@@ -4688,7 +4696,7 @@
self.assertEquals([], error_collector.ResultList())
def testBuildHeaderGuardWithRoot(self):
- temp_directory = tempfile.mkdtemp()
+ temp_directory = os.path.realpath(tempfile.mkdtemp())
try:
test_directory = os.path.join(temp_directory, "test")
os.makedirs(test_directory)
@@ -4794,7 +4802,7 @@
os.chdir(cur_dir)
def testIncludeItsHeader(self):
- temp_directory = tempfile.mkdtemp()
+ temp_directory = os.path.realpath(tempfile.mkdtemp())
cur_dir = os.getcwd()
try:
test_directory = os.path.join(temp_directory, "test")
@@ -4895,8 +4903,8 @@
cpplint.PathSplitToList(os.path.join('a', 'b', 'c', 'd')))
def testBuildHeaderGuardWithRepository(self):
- temp_directory = tempfile.mkdtemp()
- temp_directory2 = tempfile.mkdtemp()
+ temp_directory = os.path.realpath(tempfile.mkdtemp())
+ temp_directory2 = os.path.realpath(tempfile.mkdtemp())
try:
os.makedirs(os.path.join(temp_directory, ".svn"))
trunk_dir = os.path.join(temp_directory, "trunk")
@@ -6413,7 +6421,7 @@
class QuietTest(unittest.TestCase):
def setUp(self):
- self.temp_dir = tempfile.mkdtemp()
+ self.temp_dir = os.path.realpath(tempfile.mkdtemp())
self.this_dir_path = os.path.abspath(self.temp_dir)
self.python_executable = sys.executable or 'python'
self.cpplint_test_h = os.path.join(self.this_dir_path,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/samples/silly-sample/sed.def new/cpplint-1.5.4/samples/silly-sample/sed.def
--- old/cpplint-1.5.2/samples/silly-sample/sed.def 1970-01-01 01:00:00.000000000 +0100
+++ new/cpplint-1.5.4/samples/silly-sample/sed.def 2020-08-05 02:41:14.000000000 +0200
@@ -0,0 +1,112 @@
+--output=sed src/*.cpp
+1
+5
+sed -i '120s/,\([^ ]\)/, \1/g' src/sillycode.cpp # Missing space after , [whitespace/comma] [3]
+sed -i '122s/\s*$//' src/sillycode.cpp # Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
+sed -i '126s/,\([^ ]\)/, \1/g' src/sillycode.cpp # Missing space after , [whitespace/comma] [3]
+sed -i '208s/\([^ ]\){/\1 {/' src/sillycode.cpp # Missing space before { [whitespace/braces] [5]
+
+# src/sillycode.cpp:0: "No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>"" [legal/copyright] [5]
+# src/sillycode.cpp:3: "Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other." [build/include_order] [4]
+# src/sillycode.cpp:8: "public: should be indented +1 space inside class Date" [whitespace/indent] [3]
+# src/sillycode.cpp:14: "Is this a non-const reference? If so, make const or use a pointer: vector<string>& v" [runtime/references] [2]
+# src/sillycode.cpp:15: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:39: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:40: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:40: "If/else bodies with multiple statements require braces" [readability/braces] [4]
+# src/sillycode.cpp:49: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:49: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:55: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:60: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:60: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:64: "public: should be indented +1 space inside class X" [whitespace/indent] [3]
+# src/sillycode.cpp:65: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:65: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:66: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:66: "Single-parameter constructors should be marked explicit." [runtime/explicit] [5]
+# src/sillycode.cpp:74: "public: should be indented +1 space inside class X2" [whitespace/indent] [3]
+# src/sillycode.cpp:75: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:76: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:76: "Single-parameter constructors should be marked explicit." [runtime/explicit] [5]
+# src/sillycode.cpp:80: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:80: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:84: "public: should be indented +1 space inside class X3" [whitespace/indent] [3]
+# src/sillycode.cpp:85: "Constructors callable with one argument should be marked explicit." [runtime/explicit] [5]
+# src/sillycode.cpp:86: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:86: "Lines should be <= 80 characters long" [whitespace/line_length] [2]
+# src/sillycode.cpp:94: "public: should be indented +1 space inside class Foo" [whitespace/indent] [3]
+# src/sillycode.cpp:100: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:110: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:111: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:111: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:113: "public: should be indented +1 space inside class Vector2" [whitespace/indent] [3]
+# src/sillycode.cpp:118: "Is this a non-const reference? If so, make const or use a pointer: N::X& a" [runtime/references] [2]
+# src/sillycode.cpp:118: "Is this a non-const reference? If so, make const or use a pointer: N::X& b" [runtime/references] [2]
+# src/sillycode.cpp:119: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:120: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:122: "Weird number of spaces at line-start. Are you using a 2-space indent?" [whitespace/indent] [3]
+# src/sillycode.cpp:123: "Is this a non-const reference? If so, make const or use a pointer: N::X& a" [runtime/references] [2]
+# src/sillycode.cpp:123: "Is this a non-const reference? If so, make const or use a pointer: N::X& b" [runtime/references] [2]
+# src/sillycode.cpp:124: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:125: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:125: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:126: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:143: "Missing spaces around =" [whitespace/operators] [4]
+# src/sillycode.cpp:144: "Missing spaces around =" [whitespace/operators] [4]
+# src/sillycode.cpp:149: "Missing spaces around =" [whitespace/operators] [4]
+# src/sillycode.cpp:150: "Missing spaces around =" [whitespace/operators] [4]
+# src/sillycode.cpp:155: "Missing spaces around =" [whitespace/operators] [4]
+# src/sillycode.cpp:156: "Missing spaces around =" [whitespace/operators] [4]
+# src/sillycode.cpp:162: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:164: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:166: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:168: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:171: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:171: "Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size." [runtime/arrays] [1]
+# src/sillycode.cpp:175: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:178: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:178: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:178: "Static/global string variables are not permitted." [runtime/string] [4]
+# src/sillycode.cpp:179: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:179: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:184: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:184: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:190: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:190: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:195: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:195: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:197: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:197: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:199: "If an else has a brace on one side, it should have it on both" [readability/braces] [5]
+# src/sillycode.cpp:202: "An else should appear on the same line as the preceding }" [whitespace/newline] [4]
+# src/sillycode.cpp:202: "If an else has a brace on one side, it should have it on both" [readability/braces] [5]
+# src/sillycode.cpp:208: "Static/global string variables are not permitted." [runtime/string] [4]
+# src/sillycode.cpp:209: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:209: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:214: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:217: "{ should almost always be at the end of the previous line" [whitespace/braces] [4]
+# src/sillycode.cpp:218: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:218: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:219: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:219: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:220: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:220: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:225: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:225: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:227: "Static/global string variables are not permitted." [runtime/string] [4]
+# src/sillycode.cpp:228: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:228: "Using C-style cast. Use reinterpret_cast<double*>(...) instead" [readability/casting] [4]
+# src/sillycode.cpp:236: "public: should be indented +1 space inside class derived2" [whitespace/indent] [3]
+# src/sillycode.cpp:241: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:243: "Lines should be <= 80 characters long" [whitespace/line_length] [2]
+# src/sillycode.cpp:243: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:243: "Using C-style cast. Use reinterpret_cast<derived2*>(...) instead" [readability/casting] [4]
+# src/sillycode.cpp:244: "Lines should be <= 80 characters long" [whitespace/line_length] [2]
+# src/sillycode.cpp:244: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:253: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:254: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:257: "Tab found; better to use spaces" [whitespace/tab] [1]
+# src/sillycode.cpp:257: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+# src/sillycode.cpp:260: "Empty loop bodies should use {} or continue" [whitespace/empty_loop_body] [5]
+# src/sillycode.cpp:260: "At least two spaces is best between code and comments" [whitespace/comments] [2]
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpplint-1.5.2/samples/simple-sample/main.cpp new/cpplint-1.5.4/samples/simple-sample/main.cpp
--- old/cpplint-1.5.2/samples/simple-sample/main.cpp 2019-12-14 08:47:24.000000000 +0100
+++ new/cpplint-1.5.4/samples/simple-sample/main.cpp 2020-08-05 02:53:26.000000000 +0200
@@ -1,7 +1,7 @@
// Copyright 2020 foo
#include <main.h>
-int main(int argc, char** argv) {
- char* h = "Hello";
+int main(int argc,char** argv) {
+ char* h = "Hello"; //test
printf(h);
return 0;
}
1
0
Hello community,
here is the log from the commit of package python-limnoria for openSUSE:Factory checked in at 2020-08-31 16:50:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-limnoria (Old)
and /work/SRC/openSUSE:Factory/.python-limnoria.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-limnoria"
Mon Aug 31 16:50:55 2020 rev:16 rq:830626 version:2020.08.30
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-limnoria/python-limnoria.changes 2020-07-10 14:13:16.743607818 +0200
+++ /work/SRC/openSUSE:Factory/.python-limnoria.new.3399/python-limnoria.changes 2020-08-31 16:51:26.608389132 +0200
@@ -1,0 +2,44 @@
+Sun Aug 30 10:27:19 UTC 2020 - Atri Bhattacharya <badshah400(a)gmail.com>
+
+- Update to version 2020-08-30:
+ * Herald:
+ - Throttle default heralds.
+ - Use time.monotonic instead of time.time.
+ * DDG:
+ - Fix redirect detection.
+ - Add region and safeSearch configs.
+ - Add region test.
+ * callbacks:
+ - don't crash when the prefix is from network services.
+ - add comments to findCallbacksForArgs.
+ * utils.net:
+ - always check fingerprints if they are set, even if
+ verifyCertificates is False.
+ - Do not disable TLS certificate check when
+ authorityCertificate is set.
+ * Autocomplete:
+ - Initial implementation.
+ - Fix name of response tag.
+ - Only return the end of the current word (or the next one if
+ the current word is finished).
+ - return only the common prefix + one word.
+ - more readable test failures.
+ - configure Black.
+ * ChannelLogger:
+ - Fix regression preventing outgoing messages from being logged.
+ - rewrite relayed messages echoed by the server
+ - Fix typo in variable name.
+ - update comment
+ * irclib: Don't error when 004 is missing umodes and chanmodes.
+ * Selectable User-Agent for HTTP requests
+ (gh#ProgVal/Limnoria#1423)
+ * Fix typo. HttpUserAgent -> HttpUserAgents
+ (gh#ProgVal/Limnoria#1424)
+ * userAgents: avoid potential IndexError
+ * Google: Set User-Agent override. (gh#ProgVal/Limnoria#1426)
+ * Factoids: Add --author filtering to @search.
+ * Rename IrcCallback.echo_message to IrcCallback.echoMessage.
+- Use limnoria-%{version}.ext naming scheme for source instead of
+ python-limnoria-%{version}.ext
+
+-------------------------------------------------------------------
Old:
----
python-limnoria-2020.07.01.tar.gz
New:
----
limnoria-2020.08.30.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-limnoria.spec ++++++
--- /var/tmp/diff_new_pack.9Le4Y2/_old 2020-08-31 16:51:30.560391048 +0200
+++ /var/tmp/diff_new_pack.9Le4Y2/_new 2020-08-31 16:51:30.564391050 +0200
@@ -18,15 +18,15 @@
%define skip_python2 1
%define appname limnoria
-%define srcver 2020-07-01
+%define srcver 2020-08-30
Name: python-limnoria
-Version: 2020.07.01
+Version: 2020.08.30
Release: 0
Summary: A modified version of Supybot (an IRC bot and framework)
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/ProgVal/Limnoria
-Source: https://github.com/ProgVal/Limnoria/archive/master-%{srcver}.tar.gz#/%{name…
+Source: https://github.com/ProgVal/Limnoria/archive/master-%{srcver}.tar.gz#/%{appn…
BuildRequires: %{python_module PySocks}
BuildRequires: %{python_module SQLAlchemy}
BuildRequires: %{python_module chardet}
1
0
Hello community,
here is the log from the commit of package python-bitarray for openSUSE:Factory checked in at 2020-08-31 16:50:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-bitarray (Old)
and /work/SRC/openSUSE:Factory/.python-bitarray.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-bitarray"
Mon Aug 31 16:50:50 2020 rev:4 rq:830624 version:1.5.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-bitarray/python-bitarray.changes 2020-08-05 20:28:31.211071095 +0200
+++ /work/SRC/openSUSE:Factory/.python-bitarray.new.3399/python-bitarray.changes 2020-08-31 16:51:12.696382388 +0200
@@ -1,0 +2,24 @@
+Mon Aug 31 04:58:58 UTC 2020 - Steve Kowalik <steven.kowalik(a)suse.com>
+
+- Update to 1.5.2:
+ * add PyType_Ready usage, issue #66
+ * speedup search() for bitarrays with length 1 in sparse bitarrays,
+ see issue #67
+ * add tests
+ * support signed integers in `util.ba2int()` and `util.int2ba()`,
+ see issue #85
+ * deprecate `.length()` in favor of `len()`
+ * Use `Py_ssize_t` for bitarray index. This means that on 32bit
+ systems, the maximun number of elements in a bitarray is 2 GBits.
+ We used to have a special 64bit index type for all architectures, but
+ this prevented us from using Python's sequence, mapping and number
+ methods, and made those method lookups slow.
+ * speedup slice operations when step size = 1 (if alignment allows
+ copying whole bytes)
+ * Require equal endianness for operations: `&`, `|`, `^`, `&=`, `|=`, `^=`.
+ This should have always been the case but was overlooked in the past.
+ * raise TypeError when tring to create bitarray from boolean
+ * This will be last release to still support Python 2.6 (which was retired
+ in 2013). We do NOT plan to stop support for Python 2.7 anytime soon.
+
+-------------------------------------------------------------------
Old:
----
bitarray-1.4.2.tar.gz
New:
----
bitarray-1.5.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-bitarray.spec ++++++
--- /var/tmp/diff_new_pack.GAFfim/_old 2020-08-31 16:51:14.808383411 +0200
+++ /var/tmp/diff_new_pack.GAFfim/_new 2020-08-31 16:51:14.812383413 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-bitarray
-Version: 1.4.2
+Version: 1.5.2
Release: 0
Summary: Efficient Arrays of Booleans
License: Python-2.0
++++++ bitarray-1.4.2.tar.gz -> bitarray-1.5.2.tar.gz ++++++
++++ 4413 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package python-apiron for openSUSE:Factory checked in at 2020-08-31 16:50:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-apiron (Old)
and /work/SRC/openSUSE:Factory/.python-apiron.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-apiron"
Mon Aug 31 16:50:46 2020 rev:2 rq:830623 version:5.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-apiron/python-apiron.changes 2019-12-04 14:19:58.598417730 +0100
+++ /work/SRC/openSUSE:Factory/.python-apiron.new.3399/python-apiron.changes 2020-08-31 16:51:08.632380417 +0200
@@ -1,0 +2,11 @@
+Mon Aug 31 04:37:49 UTC 2020 - Steve Kowalik <steven.kowalik(a)suse.com>
+
+- Update to 5.1.0:
+ * Ability to specify proxies for a Service definition so all calls to the
+ service use the defined proxies
+ * Ability to specify auth for a Service definition so all calls to the
+ service use the defined authentication
+ * Ability to specify return_raw_response_object at the endpoint level,
+ overridden by any value specified at call time
+
+-------------------------------------------------------------------
Old:
----
apiron-5.0.0.tar.gz
New:
----
apiron-5.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-apiron.spec ++++++
--- /var/tmp/diff_new_pack.fwEVfY/_old 2020-08-31 16:51:09.432380805 +0200
+++ /var/tmp/diff_new_pack.fwEVfY/_new 2020-08-31 16:51:09.436380807 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-apiron
#
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2019 Dr. Axel Braun <DocB(a)opensuse.org>
#
# All modifications and additions to the file contributed by third parties
@@ -21,11 +21,10 @@
%define skip_python2 1
%define modname apiron
Name: python-%{modname}
-Version: 5.0.0
+Version: 5.1.0
Release: 0
Summary: Apiron helps you cook a tasty client for RESTful APIs
License: MIT
-Group: Development/Languages/Python
URL: https://github.com/ithaka/apiron
Source: https://files.pythonhosted.org/packages/source/a/apiron/%{modname}-%{versio…
BuildRequires: %{python_module pytest-cov}
++++++ apiron-5.0.0.tar.gz -> apiron-5.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/LICENSE new/apiron-5.1.0/LICENSE
--- old/apiron-5.0.0/LICENSE 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/LICENSE 2020-07-14 18:03:27.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright 2018 Ithaka Harbors, Inc.
+Copyright 2018-2020 Ithaka Harbors, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/PKG-INFO new/apiron-5.1.0/PKG-INFO
--- old/apiron-5.0.0/PKG-INFO 2019-12-02 19:02:58.015397500 +0100
+++ new/apiron-5.1.0/PKG-INFO 2020-07-14 18:04:08.247610600 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: apiron
-Version: 5.0.0
+Version: 5.1.0
Summary: apiron helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
Home-page: https://github.com/ithaka/apiron
Author: Ithaka Harbors, Inc.
@@ -74,7 +74,7 @@
This package is available under the MIT license.
For more information, [view the full license and copyright notice](./LICENSE).
- Copyright 2018 Ithaka Harbors, Inc.
+ Copyright 2018-2020 Ithaka Harbors, Inc.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/README.md new/apiron-5.1.0/README.md
--- old/apiron-5.0.0/README.md 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/README.md 2020-07-14 18:03:27.000000000 +0200
@@ -63,4 +63,4 @@
This package is available under the MIT license.
For more information, [view the full license and copyright notice](./LICENSE).
-Copyright 2018 Ithaka Harbors, Inc.
+Copyright 2018-2020 Ithaka Harbors, Inc.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/pyproject.toml new/apiron-5.1.0/pyproject.toml
--- old/apiron-5.0.0/pyproject.toml 1970-01-01 01:00:00.000000000 +0100
+++ new/apiron-5.1.0/pyproject.toml 2020-07-14 18:03:27.000000000 +0200
@@ -0,0 +1,3 @@
+[tool.black]
+line-length = 120
+target-version = ['py36', 'py37', 'py38']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/setup.cfg new/apiron-5.1.0/setup.cfg
--- old/apiron-5.0.0/setup.cfg 2019-12-02 19:02:58.015397500 +0100
+++ new/apiron-5.1.0/setup.cfg 2020-07-14 18:04:08.247610600 +0200
@@ -1,6 +1,6 @@
[metadata]
name = apiron
-version = 5.0.0
+version = 5.1.0
description = apiron helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
author = Ithaka Harbors, Inc.
author_email = grp_ithaka_apiron(a)ithaka.org
@@ -44,6 +44,7 @@
test =
pytest==5.2.2
pytest-cov==2.8.1
+ pytest-randomly==3.4.0
docs =
importlib-metadata==0.23
sphinx==2.2.1
@@ -63,7 +64,7 @@
[tool:pytest]
testpaths = tests
-addopts = -ra -q --strict --cov
+addopts = -ra --strict --cov
xfail_strict = True
[tox:tox]
@@ -82,8 +83,8 @@
[testenv:lint]
extras = lint
commands =
- pyflakes src/apiron tests
- black --check src/apiron tests
+ pyflakes {posargs:src tests}
+ black {posargs:--check src tests}
[egg_info]
tag_build =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/setup.py new/apiron-5.1.0/setup.py
--- old/apiron-5.0.0/setup.py 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/setup.py 2020-07-14 18:03:27.000000000 +0200
@@ -1,2 +1,3 @@
from setuptools import setup
+
setup()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/src/apiron/client.py new/apiron-5.1.0/src/apiron/client.py
--- old/apiron-5.0.0/src/apiron/client.py 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/src/apiron/client.py 2020-07-14 18:03:27.000000000 +0200
@@ -145,7 +145,7 @@
timeout_spec=DEFAULT_TIMEOUT,
logger=None,
allow_redirects=True,
- return_raw_response_object=False,
+ return_raw_response_object=None,
**kwargs,
):
"""
@@ -224,6 +224,8 @@
method = method or endpoint.default_method
+ auth = auth or session.auth or service.auth
+
request = build_request_object(
session,
service,
@@ -246,6 +248,7 @@
timeout=(timeout_spec.connection_timeout, timeout_spec.read_timeout),
stream=getattr(endpoint, "streaming", False),
allow_redirects=allow_redirects,
+ proxies=session.proxies or service.proxies,
)
logger.info(
@@ -264,4 +267,11 @@
if encoding:
response.encoding = encoding
- return response if return_raw_response_object else endpoint.format_response(response)
+ # Use the explicitly passed in option, if any
+ # Otherwise, use the endpoint's setting
+ if return_raw_response_object is None:
+ return_raw_response = endpoint.return_raw_response_object
+ else:
+ return_raw_response = return_raw_response_object
+
+ return response if return_raw_response else endpoint.format_response(response)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/src/apiron/endpoint/endpoint.py new/apiron-5.1.0/src/apiron/endpoint/endpoint.py
--- old/apiron-5.0.0/src/apiron/endpoint/endpoint.py 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/src/apiron/endpoint/endpoint.py 2020-07-14 18:03:27.000000000 +0200
@@ -23,7 +23,14 @@
def __call__(self):
raise TypeError("Endpoints are only callable in conjunction with a Service class.")
- def __init__(self, path="/", default_method="GET", default_params=None, required_params=None):
+ def __init__(
+ self,
+ path="/",
+ default_method="GET",
+ default_params=None,
+ required_params=None,
+ return_raw_response_object=False,
+ ):
"""
:param str path:
The URL path for this endpoint, without the protocol or domain
@@ -36,6 +43,10 @@
:param required_params:
An iterable of required parameter names.
Calling an endpoint without its required parameters raises an exception.
+ :param bool return_raw_response_object:
+ Whether to return a :class:`requests.Response` object or call :func:`format_response` on it first.
+ This can be overridden when calling the endpoint.
+ (Default ``False``)
"""
self.default_method = default_method
@@ -50,6 +61,7 @@
self.path = path
self.default_params = default_params or {}
self.required_params = required_params or set()
+ self.return_raw_response_object = return_raw_response_object
def format_response(self, response):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/src/apiron/service/base.py new/apiron-5.1.0/src/apiron/service/base.py
--- old/apiron-5.0.0/src/apiron/service/base.py 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/src/apiron/service/base.py 2020-07-14 18:03:27.000000000 +0200
@@ -19,6 +19,8 @@
class ServiceBase(metaclass=ServiceMeta):
required_headers = {}
+ auth = ()
+ proxies = {}
@classmethod
def get_hosts(cls):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/src/apiron.egg-info/PKG-INFO new/apiron-5.1.0/src/apiron.egg-info/PKG-INFO
--- old/apiron-5.0.0/src/apiron.egg-info/PKG-INFO 2019-12-02 19:02:57.000000000 +0100
+++ new/apiron-5.1.0/src/apiron.egg-info/PKG-INFO 2020-07-14 18:04:08.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: apiron
-Version: 5.0.0
+Version: 5.1.0
Summary: apiron helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
Home-page: https://github.com/ithaka/apiron
Author: Ithaka Harbors, Inc.
@@ -74,7 +74,7 @@
This package is available under the MIT license.
For more information, [view the full license and copyright notice](./LICENSE).
- Copyright 2018 Ithaka Harbors, Inc.
+ Copyright 2018-2020 Ithaka Harbors, Inc.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/src/apiron.egg-info/SOURCES.txt new/apiron-5.1.0/src/apiron.egg-info/SOURCES.txt
--- old/apiron-5.0.0/src/apiron.egg-info/SOURCES.txt 2019-12-02 19:02:57.000000000 +0100
+++ new/apiron-5.1.0/src/apiron.egg-info/SOURCES.txt 2020-07-14 18:04:08.000000000 +0200
@@ -1,6 +1,7 @@
LICENSE
MANIFEST.in
README.md
+pyproject.toml
setup.cfg
setup.py
src/apiron/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/src/apiron.egg-info/requires.txt new/apiron-5.1.0/src/apiron.egg-info/requires.txt
--- old/apiron-5.0.0/src/apiron.egg-info/requires.txt 2019-12-02 19:02:57.000000000 +0100
+++ new/apiron-5.1.0/src/apiron.egg-info/requires.txt 2020-07-14 18:04:08.000000000 +0200
@@ -12,3 +12,4 @@
[test]
pytest==5.2.2
pytest-cov==2.8.1
+pytest-randomly==3.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/tests/service/test_base.py new/apiron-5.1.0/tests/service/test_base.py
--- old/apiron-5.0.0/tests/service/test_base.py 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/tests/service/test_base.py 2020-07-14 18:03:27.000000000 +0200
@@ -3,7 +3,7 @@
from apiron import Endpoint, Service, ServiceBase
-(a)pytest.fixture(scope="class")
+(a)pytest.fixture
def service():
class SomeService(Service):
domain = "http://foo.com"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apiron-5.0.0/tests/test_client.py new/apiron-5.1.0/tests/test_client.py
--- old/apiron-5.0.0/tests/test_client.py 2019-12-02 19:02:20.000000000 +0100
+++ new/apiron-5.1.0/tests/test_client.py 2020-07-14 18:03:27.000000000 +0200
@@ -22,215 +22,287 @@
return endpoint
-class TestClient:
- @mock.patch("requests.sessions.Session", autospec=True)
- def test_get_adapted_session(self, mock_session):
- adapter = mock.Mock()
- adapted_session = client.get_adapted_session(adapter)
- assert adapter == adapted_session.get_adapter("http://foo.com")
- assert adapter == adapted_session.get_adapter("https://foo.com")
-
- def test_get_required_headers(self, mock_endpoint):
- service = mock.Mock()
- service.required_headers = {"one": "two"}
- mock_endpoint.required_headers = {"foo": "bar"}
- expected_headers = {}
- expected_headers.update(service.required_headers)
- expected_headers.update(mock_endpoint.required_headers)
- assert expected_headers == client.get_required_headers(service, mock_endpoint)
-
- @mock.patch("apiron.client.requests.Request")
- @mock.patch("apiron.client.get_required_headers")
- def test_build_request_object_passes_arguments_to_request_constructor(
- self, mock_get_required_headers, mock_request_constructor, mock_endpoint
- ):
- session = mock.Mock()
-
- service = mock.Mock()
- service.get_hosts.return_value = ["http://host1.biz"]
-
- mock_endpoint.default_method = "POST"
- mock_endpoint.required_headers = {"header": "value"}
- mock_endpoint.required_params = set()
-
- params = {"baz": "qux"}
- mock_endpoint.get_merged_params.return_value = params
- data = "I am a data"
- files = {"file_name": io.BytesIO(b"this is a test")}
- json = {"raw": "data"}
- headers = {"Accept": "stuff"}
- cookies = {"chocolate-chip": "yes"}
- auth = mock.Mock()
-
- mock_get_required_headers.return_value = {"header": "value"}
- expected_headers = {}
- expected_headers.update(headers)
- expected_headers.update(mock_endpoint.required_headers)
-
- with mock.patch.object(session, "prepare_request") as mock_prepare_request:
- client.build_request_object(
- session,
- service,
- mock_endpoint,
- params=params,
- data=data,
- files=files,
- json=json,
- headers=headers,
- cookies=cookies,
- auth=auth,
- foo="bar",
- )
-
- mock_request_constructor.assert_called_once_with(
- url="http://host1.biz/foo/",
- method=mock_endpoint.default_method,
- headers=expected_headers,
- cookies=cookies,
- params=params,
- data=data,
- files=files,
- json=json,
- auth=auth,
- )
-
- assert 1 == mock_prepare_request.call_count
-
- @mock.patch("apiron.client.Timeout")
- @mock.patch("apiron.client.get_adapted_session")
- @mock.patch("apiron.client.build_request_object")
- @mock.patch("requests.adapters.HTTPAdapter", autospec=True)
- @mock.patch("requests.Session", autospec=True)
- def test_call(
- self,
- MockSession,
- MockAdapter,
- mock_build_request_object,
- mock_get_adapted_session,
- mock_timeout,
- mock_response,
- mock_endpoint,
- ):
- service = mock.Mock()
- service.get_hosts.return_value = ["http://host1.biz"]
-
- mock_endpoint.default_method = "GET"
- mock_endpoint.streaming = True
-
- request = mock.Mock()
- request.url = "http://host1.biz/foo/"
- mock_build_request_object.return_value = request
-
- mock_logger = mock.Mock()
-
- mock_response.status_code = 200
- mock_response.url = "http://host1.biz/foo/"
-
- mock_session = MockSession()
- mock_session.send.return_value = mock_response
- mock_get_adapted_session.return_value = mock_session
-
- client.call(service, mock_endpoint, timeout_spec=mock_timeout, logger=mock_logger)
-
- mock_get_adapted_session.assert_called_once_with(MockAdapter())
- mock_session.send.assert_called_once_with(
- request,
- timeout=(mock_timeout.connection_timeout, mock_timeout.read_timeout),
- stream=mock_endpoint.streaming,
- allow_redirects=True,
+(a)pytest.fixture
+def mock_logger():
+ return mock.Mock()
+
+
+(a)mock.patch("requests.sessions.Session", autospec=True)
+def test_get_adapted_session(mock_session):
+ adapter = mock.Mock()
+ adapted_session = client.get_adapted_session(adapter)
+ assert adapter == adapted_session.get_adapter("http://foo.com")
+ assert adapter == adapted_session.get_adapter("https://foo.com")
+
+
+def test_get_required_headers(mock_endpoint):
+ service = mock.Mock()
+ service.required_headers = {"one": "two"}
+ mock_endpoint.required_headers = {"foo": "bar"}
+ expected_headers = {}
+ expected_headers.update(service.required_headers)
+ expected_headers.update(mock_endpoint.required_headers)
+ assert expected_headers == client.get_required_headers(service, mock_endpoint)
+
+
+(a)mock.patch("apiron.client.requests.Request")
+(a)mock.patch("apiron.client.get_required_headers")
+def test_build_request_object_passes_arguments_to_request_constructor(
+ mock_get_required_headers, mock_request_constructor, mock_endpoint
+):
+ session = mock.Mock()
+
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+
+ mock_endpoint.default_method = "POST"
+ mock_endpoint.required_headers = {"header": "value"}
+ mock_endpoint.required_params = set()
+
+ params = {"baz": "qux"}
+ mock_endpoint.get_merged_params.return_value = params
+ data = "I am a data"
+ files = {"file_name": io.BytesIO(b"this is a test")}
+ json = {"raw": "data"}
+ headers = {"Accept": "stuff"}
+ cookies = {"chocolate-chip": "yes"}
+ auth = mock.Mock()
+
+ mock_get_required_headers.return_value = {"header": "value"}
+ expected_headers = {}
+ expected_headers.update(headers)
+ expected_headers.update(mock_endpoint.required_headers)
+
+ with mock.patch.object(session, "prepare_request") as mock_prepare_request:
+ client.build_request_object(
+ session,
+ service,
+ mock_endpoint,
+ params=params,
+ data=data,
+ files=files,
+ json=json,
+ headers=headers,
+ cookies=cookies,
+ auth=auth,
+ foo="bar",
)
- mock_logger.info.assert_any_call("GET http://host1.biz/foo/")
- mock_logger.info.assert_any_call("200 http://host1.biz/foo/")
+ mock_request_constructor.assert_called_once_with(
+ url="http://host1.biz/foo/",
+ method=mock_endpoint.default_method,
+ headers=expected_headers,
+ cookies=cookies,
+ params=params,
+ data=data,
+ files=files,
+ json=json,
+ auth=auth,
+ )
- mock_endpoint.default_method = "POST"
- request.method = "POST"
+ assert 1 == mock_prepare_request.call_count
- client.call(service, mock_endpoint, session=mock_session, timeout_spec=mock_timeout, logger=mock_logger)
- mock_session.send.assert_any_call(
- request,
- timeout=(mock_timeout.connection_timeout, mock_timeout.read_timeout),
- stream=mock_endpoint.streaming,
- allow_redirects=True,
- )
+(a)mock.patch("apiron.client.Timeout")
+(a)mock.patch("apiron.client.get_adapted_session")
+(a)mock.patch("apiron.client.build_request_object")
+(a)mock.patch("requests.adapters.HTTPAdapter", autospec=True)
+(a)mock.patch("requests.Session", autospec=True)
+def test_call(
+ MockSession,
+ MockAdapter,
+ mock_build_request_object,
+ mock_get_adapted_session,
+ mock_timeout,
+ mock_response,
+ mock_endpoint,
+ mock_logger,
+):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
- mock_logger.info.assert_any_call("GET http://host1.biz/foo/")
- mock_logger.info.assert_any_call("200 http://host1.biz/foo/")
+ mock_endpoint.default_method = "GET"
+ mock_endpoint.streaming = True
- request.method = "PUT"
+ request = mock.Mock()
+ request.url = "http://host1.biz/foo/"
+ mock_build_request_object.return_value = request
- client.call(
- service, mock_endpoint, method="PUT", session=mock_session, timeout_spec=mock_timeout, logger=mock_logger
- )
+ mock_response.status_code = 200
+ mock_response.url = "http://host1.biz/foo/"
- mock_session.send.assert_any_call(
- request,
- timeout=(mock_timeout.connection_timeout, mock_timeout.read_timeout),
- stream=mock_endpoint.streaming,
- allow_redirects=True,
- )
+ mock_session = MockSession()
+ mock_session.send.return_value = mock_response
+ mock_session.proxies = {}
+ mock_session.auth = ()
+ mock_get_adapted_session.return_value = mock_session
- @mock.patch("apiron.client.get_adapted_session")
- def test_call_with_existing_session(self, mock_get_adapted_session, mock_response, mock_endpoint):
- service = mock.Mock()
- service.get_hosts.return_value = ["http://host1.biz"]
- service.required_headers = {}
+ client.call(service, mock_endpoint, timeout_spec=mock_timeout, logger=mock_logger)
- mock_logger = mock.Mock()
+ mock_get_adapted_session.assert_called_once_with(MockAdapter())
+ mock_session.send.assert_called_once_with(
+ request,
+ timeout=(mock_timeout.connection_timeout, mock_timeout.read_timeout),
+ stream=mock_endpoint.streaming,
+ allow_redirects=True,
+ proxies=service.proxies,
+ )
- session = mock.Mock()
- session.send.return_value = mock_response
+ mock_logger.info.assert_any_call("GET http://host1.biz/foo/")
+ mock_logger.info.assert_any_call("200 http://host1.biz/foo/")
- client.call(service, mock_endpoint, session=session, logger=mock_logger)
+ mock_endpoint.default_method = "POST"
+ request.method = "POST"
- assert not mock_get_adapted_session.called
- assert not session.close.called
+ client.call(service, mock_endpoint, session=mock_session, timeout_spec=mock_timeout, logger=mock_logger)
- def test_call_with_explicit_encoding(self, mock_response, mock_endpoint):
- service = mock.Mock()
- service.get_hosts.return_value = ["http://host1.biz"]
- service.required_headers = {}
+ mock_session.send.assert_any_call(
+ request,
+ timeout=(mock_timeout.connection_timeout, mock_timeout.read_timeout),
+ stream=mock_endpoint.streaming,
+ allow_redirects=True,
+ proxies=service.proxies,
+ )
- session = mock.Mock()
- session.send.return_value = mock_response
+ mock_logger.info.assert_any_call("GET http://host1.biz/foo/")
+ mock_logger.info.assert_any_call("200 http://host1.biz/foo/")
- client.call(service, mock_endpoint, session=session, logger=mock.Mock(), encoding="FAKE-CODEC")
+ request.method = "PUT"
- assert "FAKE-CODEC" == mock_response.encoding
+ client.call(
+ service, mock_endpoint, method="PUT", session=mock_session, timeout_spec=mock_timeout, logger=mock_logger
+ )
- def test_build_request_object_raises_no_host_exception(self):
- service = mock.Mock()
- service.get_hosts.return_value = []
+ mock_session.send.assert_any_call(
+ request,
+ timeout=(mock_timeout.connection_timeout, mock_timeout.read_timeout),
+ stream=mock_endpoint.streaming,
+ allow_redirects=True,
+ proxies=service.proxies,
+ )
- with pytest.raises(NoHostsAvailableException):
- client.build_request_object(None, service, None)
- def test_choose_host_returns_one_of_the_available_hosts(self):
- hosts = ["foo", "bar", "baz"]
- service = mock.Mock()
- service.get_hosts.return_value = hosts
- assert client.choose_host(service) in hosts
+(a)mock.patch("apiron.client.build_request_object")
+(a)mock.patch("apiron.client.get_adapted_session")
+(a)mock.patch("requests.Session", autospec=True)
+def test_call_auth_priority(
+ MockSession, mock_get_adapted_session, mock_build_request_object, mock_endpoint, mock_logger
+):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+ service.required_headers = {}
+ service.auth = ("service-user", "p455w0rd!")
- def test_choose_host_raises_exception_when_no_hosts_available(self):
- service = mock.Mock()
- service.get_hosts.return_value = []
- with pytest.raises(NoHostsAvailableException):
- client.choose_host(service)
+ mock_session = MockSession()
+ mock_session.proxies = {}
+ mock_session.auth = ("session-user", "p455w0rd!")
- def test_call_when_raw_response_object_requested(self, mock_response, mock_endpoint):
- service = mock.Mock()
- service.get_hosts.return_value = ["http://host1.biz"]
- service.required_headers = {}
+ mock_get_adapted_session.return_value = mock_session
- session = mock.Mock()
- session.send.return_value = mock_response
+ client.call(service, mock_endpoint, auth=("direct-user", "p455w0rd!"), session=mock_session, logger=mock_logger)
+ assert mock_build_request_object.call_args[1]["auth"] == ("direct-user", "p455w0rd!")
- response = client.call(
- service, mock_endpoint, session=session, logger=mock.Mock(), return_raw_response_object=True
- )
+ client.call(service, mock_endpoint, session=mock_session, logger=mock_logger)
+ assert mock_build_request_object.call_args[1]["auth"] == ("session-user", "p455w0rd!")
+
+ mock_session.auth = ()
+ client.call(service, mock_endpoint, logger=mock_logger)
+ assert mock_build_request_object.call_args[1]["auth"] == ("service-user", "p455w0rd!")
+
+
+(a)mock.patch("apiron.client.get_adapted_session")
+def test_call_with_existing_session(mock_get_adapted_session, mock_response, mock_endpoint, mock_logger):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+ service.required_headers = {}
+
+ session = mock.Mock()
+ session.send.return_value = mock_response
+
+ client.call(service, mock_endpoint, session=session, logger=mock_logger)
+
+ assert not mock_get_adapted_session.called
+ assert not session.close.called
+
+
+def test_call_with_explicit_encoding(mock_response, mock_endpoint, mock_logger):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+ service.required_headers = {}
+
+ session = mock.Mock()
+ session.send.return_value = mock_response
+
+ client.call(service, mock_endpoint, session=session, logger=mock_logger, encoding="FAKE-CODEC")
+
+ assert "FAKE-CODEC" == mock_response.encoding
+
+
+def test_build_request_object_raises_no_host_exception():
+ service = mock.Mock()
+ service.get_hosts.return_value = []
+
+ with pytest.raises(NoHostsAvailableException):
+ client.build_request_object(None, service, None)
+
+
+def test_choose_host_returns_one_of_the_available_hosts():
+ hosts = ["foo", "bar", "baz"]
+ service = mock.Mock()
+ service.get_hosts.return_value = hosts
+ assert client.choose_host(service) in hosts
+
+
+def test_choose_host_raises_exception_when_no_hosts_available():
+ service = mock.Mock()
+ service.get_hosts.return_value = []
+ with pytest.raises(NoHostsAvailableException):
+ client.choose_host(service)
+
+
+def test_call_when_raw_response_object_requested(mock_response, mock_endpoint, mock_logger):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+ service.required_headers = {}
+
+ session = mock.Mock()
+ session.send.return_value = mock_response
+
+ response = client.call(service, mock_endpoint, session=session, logger=mock_logger, return_raw_response_object=True)
+
+ assert response is mock_response
+
+
+def test_call_when_raw_response_object_requested_on_endpoint(mock_response, mock_endpoint):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+ service.required_headers = {}
+
+ session = mock.Mock()
+ session.send.return_value = mock_response
+
+ mock_endpoint.return_raw_response_object = True
+
+ response = client.call(service, mock_endpoint, session=session, logger=mock.Mock())
+
+ assert response is mock_response
+
+
+def test_return_raw_response_object_in_call_overrides_endpoint(mock_response, mock_endpoint):
+ service = mock.Mock()
+ service.get_hosts.return_value = ["http://host1.biz"]
+ service.required_headers = {}
+
+ session = mock.Mock()
+ session.send.return_value = mock_response
+
+ mock_endpoint.return_raw_response_object = False
+
+ response = client.call(
+ service, mock_endpoint, session=session, logger=mock.Mock(), return_raw_response_object=True,
+ )
- assert response is mock_response
+ assert response is mock_response
@pytest.mark.parametrize(
1
0
Hello community,
here is the log from the commit of package python-beniget for openSUSE:Factory checked in at 2020-08-31 16:50:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-beniget (Old)
and /work/SRC/openSUSE:Factory/.python-beniget.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-beniget"
Mon Aug 31 16:50:41 2020 rev:4 rq:830622 version:0.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-beniget/python-beniget.changes 2019-09-13 15:03:24.253281151 +0200
+++ /work/SRC/openSUSE:Factory/.python-beniget.new.3399/python-beniget.changes 2020-08-31 16:51:03.928378137 +0200
@@ -1,0 +2,6 @@
+Mon Aug 31 04:08:36 UTC 2020 - Steve Kowalik <steven.kowalik(a)suse.com>
+
+- Update to 0.3.0:
+ * Require gast 0.4.0
+
+-------------------------------------------------------------------
Old:
----
beniget-0.2.0.tar.gz
New:
----
beniget-0.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-beniget.spec ++++++
--- /var/tmp/diff_new_pack.47jL7Q/_old 2020-08-31 16:51:04.744378532 +0200
+++ /var/tmp/diff_new_pack.47jL7Q/_new 2020-08-31 16:51:04.744378532 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-beniget
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,20 +18,19 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-beniget
-Version: 0.2.0
+Version: 0.3.0
Release: 0
Summary: Module to extract semantic information about static Python code
License: BSD-3-Clause
-Group: Development/Languages/Python
URL: https://github.com/serge-sans-paille/beniget/
Source: https://files.pythonhosted.org/packages/source/b/beniget/beniget-%{version}…
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-gast >= 0.3.0
+Requires: python-gast >= 0.4.0
BuildArch: noarch
# SECTION test requirements
-BuildRequires: %{python_module gast >= 0.3.0}
+BuildRequires: %{python_module gast >= 0.4.0}
# /SECTION
%python_subpackages
++++++ beniget-0.2.0.tar.gz -> beniget-0.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/PKG-INFO new/beniget-0.3.0/PKG-INFO
--- old/beniget-0.2.0/PKG-INFO 2019-09-07 17:51:31.000000000 +0200
+++ new/beniget-0.3.0/PKG-INFO 2020-08-07 23:52:40.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: beniget
-Version: 0.2.0
+Version: 0.3.0
Summary: Extract semantic information about static Python code
Home-page: https://github.com/serge-sans-paille/beniget/
Author: serge-sans-paille
@@ -9,7 +9,8 @@
Description:
A static analyzer for Python2 and Python3 code.
- Beniget provides a static over-approximation of the global and local definitions inside Python Module/Class/Function.
+ Beniget provides a static over-approximation of the global and
+ local definitions inside Python Module/Class/Function.
It can also compute def-use chains from each definition.
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/beniget/beniget.py new/beniget-0.3.0/beniget/beniget.py
--- old/beniget-0.2.0/beniget/beniget.py 2019-09-07 17:50:27.000000000 +0200
+++ new/beniget-0.3.0/beniget/beniget.py 2020-08-07 23:52:10.000000000 +0200
@@ -1,6 +1,5 @@
from collections import defaultdict, OrderedDict
from contextlib import contextmanager
-from copy import deepcopy
import sys
import gast as ast
@@ -75,7 +74,8 @@
raise ValueError("{} has no parent of type {}".format(node, cls))
def parentFunction(self, node):
- return self.parentInstance(node, (ast.FunctionDef, ast.AsyncFunctionDef))
+ return self.parentInstance(node, (ast.FunctionDef,
+ ast.AsyncFunctionDef))
def parentStmt(self, node):
return self.parentInstance(node, ast.stmt)
@@ -101,7 +101,9 @@
If the node associated to this Def has a name, returns this name.
Otherwise returns its type
"""
- if isinstance(self.node, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)):
+ if isinstance(self.node, (ast.ClassDef,
+ ast.FunctionDef,
+ ast.AsyncFunctionDef)):
return self.node.name
elif isinstance(self.node, ast.Name):
return self.node.id
@@ -128,7 +130,8 @@
else:
nodes[self] = len(nodes)
return "{} -> ({})".format(
- self.node, ", ".join(u._repr(nodes.copy()) for u in self._users)
+ self.node, ", ".join(u._repr(nodes.copy())
+ for u in self._users)
)
def __str__(self):
@@ -140,7 +143,8 @@
else:
nodes[self] = len(nodes)
return "{} -> ({})".format(
- self.name(), ", ".join(u._str(nodes.copy()) for u in self._users)
+ self.name(), ", ".join(u._str(nodes.copy())
+ for u in self._users)
)
@@ -189,9 +193,13 @@
c -> (c -> (Call -> ()))
"""
- def __init__(self):
+ def __init__(self, filename=None):
+ """
+ - filename: str, included in error messages if specified
+ """
self.chains = {}
self.locals = defaultdict(list)
+ self.filename = filename
# deep copy of builtins, to remain reentrant
self._builtins = {k: Def(v) for k, v in Builtins.items()}
@@ -210,9 +218,12 @@
# be defined in another path of the control flow (esp. in loop)
self._undefs = []
- # stack of current node holding definitions (class, module, function...)
+ # stack of current node holding definitions: class, module, function...
self._currenthead = []
+ self._breaks = []
+ self._continues = []
+
# dead code levels
self.deadcode = 0
@@ -221,7 +232,8 @@
def dump_definitions(self, node, ignore_builtins=True):
if isinstance(node, ast.Module) and not ignore_builtins:
builtins = {d for d in self._builtins.values()}
- return sorted(d.name() for d in self.locals[node] if d not in builtins)
+ return sorted(d.name()
+ for d in self.locals[node] if d not in builtins)
else:
return sorted(d.name() for d in self.locals[node])
@@ -233,7 +245,12 @@
def unbound_identifier(self, name, node):
if hasattr(node, "lineno"):
- location = " at {}:{}".format(node.lineno, node.col_offset)
+ filename = "{}:".format(
+ "<unknown>" if self.filename is None else self.filename
+ )
+ location = " at {}{}:{}".format(filename,
+ node.lineno,
+ node.col_offset)
else:
location = ""
print("W: unbound identifier '{}'{}".format(name, location))
@@ -249,7 +266,7 @@
stars = []
for d in reversed(self._definitions):
if name in d:
- return d[name] if not stars else stars + d[name]
+ return d[name] if not stars else stars + list(d[name])
if "*" in d:
stars.extend(d["*"])
@@ -280,7 +297,7 @@
for undef_name, _undefs in self._undefs[-1].items():
if undef_name in self._definitions[-1]:
for newdef in self._definitions[-1][undef_name]:
- for undef, stars in _undefs:
+ for undef, _ in _undefs:
for user in undef.users():
newdef.add_user(user)
else:
@@ -335,7 +352,8 @@
# handle function bodies
for fnode, ctx in self._defered[-1]:
- visitor = getattr(self, "visit_{}".format(type(fnode).__name__))
+ visitor = getattr(self,
+ "visit_{}".format(type(fnode).__name__))
defs, self._definitions = self._definitions, ctx
visitor(fnode, step=DefinitionStep)
self._definitions = defs
@@ -367,13 +385,18 @@
else:
self._definitions[-1][name] = ordered_set(dnode_or_dnodes)
+ @staticmethod
+ def add_to_definition(definition, name, dnode_or_dnodes):
+ if isinstance(dnode_or_dnodes, Def):
+ definition[name].add(dnode_or_dnodes)
+ else:
+ definition[name].update(dnode_or_dnodes)
+
def extend_definition(self, name, dnode_or_dnodes):
if self.deadcode:
return
- if isinstance(dnode_or_dnodes, Def):
- self._definitions[-1][name].add(dnode_or_dnodes)
- else:
- self._definitions[-1][name].update(dnode_or_dnodes)
+ DefUseChains.add_to_definition(self._definitions[-1], name,
+ dnode_or_dnodes)
def visit_FunctionDef(self, node, step=DeclarationStep):
if step is DeclarationStep:
@@ -393,6 +416,9 @@
definitions.pop()
self._defered[-1].append((node, definitions))
elif step is DefinitionStep:
+ # function is not considered as defined when evaluating returns
+ if node.returns:
+ self.visit(node.returns)
with self.DefinitionContext(node):
self.visit(node.args)
self.process_body(node.body)
@@ -420,12 +446,23 @@
if node.value:
self.visit(node.value)
+ def visit_Break(self, _):
+ for k, v in self._definitions[-1].items():
+ DefUseChains.add_to_definition(self._breaks[-1], k, v)
+ self._definitions[-1].clear()
+
+ def visit_Continue(self, _):
+ for k, v in self._definitions[-1].items():
+ DefUseChains.add_to_definition(self._continues[-1], k, v)
+ self._definitions[-1].clear()
+
def visit_Delete(self, node):
for target in node.targets:
self.visit(target)
def visit_Assign(self, node):
- dvalue = self.visit(node.value)
+ # link is implicit through ctx
+ self.visit(node.value)
for target in node.targets:
self.visit(target)
@@ -448,7 +485,12 @@
if node.target.id in self._promoted_locals[-1]:
self.extend_definition(node.target.id, dtarget)
else:
+ loaded_from = [d.name() for d in self.defs(node.target)]
self.set_definition(node.target.id, dtarget)
+ # If we augassign from a value that comes from '*', let's use
+ # this node as the definition point.
+ if '*' in loaded_from:
+ self.locals[self._currenthead[-1]].append(dtarget)
else:
self.visit(node.target).add_user(dvalue)
@@ -461,12 +503,8 @@
def visit_For(self, node):
self.visit(node.iter)
- # process else clause in the case of an early break
- self._undefs.append(defaultdict(list))
- self._definitions.append(self._definitions[-1].copy())
- self.process_body(node.orelse)
- self._definitions.pop() # drop defs because they don't dominate body
- self._undefs.pop()
+ self._breaks.append(defaultdict(ordered_set))
+ self._continues.append(defaultdict(ordered_set))
self._undefs.append(defaultdict(list))
self._definitions.append(self._definitions[-1].copy())
@@ -474,20 +512,34 @@
self.process_body(node.body)
self.process_undefs()
+ continue_defs = self._continues.pop()
+ for d, u in continue_defs.items():
+ self.extend_definition(d, u)
+ self._continues.append(defaultdict(ordered_set))
+
# extra round to ``emulate'' looping
self.visit(node.target)
self.process_body(node.body)
- # reprocess else clause in case of late break
+ # process else clause in case of late break
self._definitions.append(defaultdict(ordered_set))
self.process_body(node.orelse)
orelse_defs = self._definitions.pop()
+ break_defs = self._breaks.pop()
+ continue_defs = self._continues.pop()
+
body_defs = self._definitions.pop()
for d, u in orelse_defs.items():
self.extend_definition(d, u)
+ for d, u in continue_defs.items():
+ self.extend_definition(d, u)
+
+ for d, u in break_defs.items():
+ self.extend_definition(d, u)
+
for d, u in body_defs.items():
self.extend_definition(d, u)
@@ -497,6 +549,8 @@
self._definitions.append(self._definitions[-1].copy())
self._undefs.append(defaultdict(list))
+ self._breaks.append(defaultdict(ordered_set))
+ self._continues.append(defaultdict(ordered_set))
self.process_body(node.orelse)
@@ -509,6 +563,11 @@
self.process_undefs()
+ continue_defs = self._continues.pop()
+ for d, u in continue_defs.items():
+ self.extend_definition(d, u)
+ self._continues.append(defaultdict(ordered_set))
+
# extra round to simulate loop
self.visit(node.test)
self.process_body(node.body)
@@ -521,6 +580,14 @@
orelse_defs = self._definitions.pop()
body_defs = self._definitions.pop()
+ break_defs = self._breaks.pop()
+ continue_defs = self._continues.pop()
+
+ for d, u in continue_defs.items():
+ self.extend_definition(d, u)
+
+ for d, u in break_defs.items():
+ self.extend_definition(d, u)
for d, u in orelse_defs.items():
self.extend_definition(d, u)
@@ -798,7 +865,7 @@
if node.annotation is not None:
self.visit(node.annotation)
- elif isinstance(node.ctx, ast.Load):
+ elif isinstance(node.ctx, (ast.Load, ast.Del)):
node_in_chains = node in self.chains
if node_in_chains:
dnode = self.chains[node]
@@ -808,17 +875,7 @@
d.add_user(dnode)
if not node_in_chains:
self.chains[node] = dnode
-
- elif isinstance(node.ctx, ast.Del):
- dnode = self.chains.setdefault(node, Def(node))
- self.set_definition(node.id, [])
- # should we also remove node.id from locals?
- # for d in self._definitions[-1][node.id]:
- # try:
- # self.locals[self._currenthead[-1]].remove(d)
- # except ValueError:
- # pass
- # del self._definitions[-1][node.id]
+ # currently ignore the effect of a del
else:
raise NotImplementedError()
return dnode
@@ -862,14 +919,6 @@
self.visit(node.step).add_user(dnode)
return dnode
- def visit_ExtSlice(self, node):
- dnode = self.chains.setdefault(node, Def(node))
- for dim in node.dims:
- self.visit(dim).add_user(dnode)
- return dnode
-
- visit_Index = visit_Await
-
# misc
def visit_comprehension(self, node):
@@ -947,20 +996,6 @@
if __name__ == "__main__":
import sys
- class DefUseChainsX(DefUseChains):
- def __init__(self, filename):
- super(DefUseChainsX, self).__init__()
- self.filename = filename
-
- def unbound_identifier(self, name, node):
- if hasattr(node, "lineno"):
- location = " at {}:{}:".format(node.lineno, node.col_offset)
- else:
- location = ""
- print(
- "W: unbound identifier '{}'{}{}".format(name, location, self.filename)
- )
-
class Beniget(ast.NodeVisitor):
def __init__(self, filename, module):
super(Beniget, self).__init__()
@@ -970,7 +1005,7 @@
self.ancestors = Ancestors()
self.ancestors.visit(module)
- self.defuses = DefUseChainsX(self.filename)
+ self.defuses = DefUseChains(self.filename)
self.defuses.visit(module)
self.visit(module)
@@ -1005,7 +1040,8 @@
if self.filename.endswith("__init__.py"):
return
self.check_unused(
- node, skipped_types=(ast.FunctionDef, ast.ClassDef, ast.Name)
+ node, skipped_types=(ast.FunctionDef, ast.AsyncFunctionDef,
+ ast.ClassDef, ast.Name)
)
def visit_FunctionDef(self, node):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/beniget.egg-info/PKG-INFO new/beniget-0.3.0/beniget.egg-info/PKG-INFO
--- old/beniget-0.2.0/beniget.egg-info/PKG-INFO 2019-09-07 17:51:31.000000000 +0200
+++ new/beniget-0.3.0/beniget.egg-info/PKG-INFO 2020-08-07 23:52:39.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: beniget
-Version: 0.2.0
+Version: 0.3.0
Summary: Extract semantic information about static Python code
Home-page: https://github.com/serge-sans-paille/beniget/
Author: serge-sans-paille
@@ -9,7 +9,8 @@
Description:
A static analyzer for Python2 and Python3 code.
- Beniget provides a static over-approximation of the global and local definitions inside Python Module/Class/Function.
+ Beniget provides a static over-approximation of the global and
+ local definitions inside Python Module/Class/Function.
It can also compute def-use chains from each definition.
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/beniget.egg-info/requires.txt new/beniget-0.3.0/beniget.egg-info/requires.txt
--- old/beniget-0.2.0/beniget.egg-info/requires.txt 2019-09-07 17:51:31.000000000 +0200
+++ new/beniget-0.3.0/beniget.egg-info/requires.txt 2020-08-07 23:52:39.000000000 +0200
@@ -1 +1 @@
-gast>=0.3.0
+gast~=0.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/requirements.txt new/beniget-0.3.0/requirements.txt
--- old/beniget-0.2.0/requirements.txt 2019-09-07 17:50:27.000000000 +0200
+++ new/beniget-0.3.0/requirements.txt 2020-08-07 23:52:10.000000000 +0200
@@ -1 +1 @@
-gast >= 0.3.0
+gast ~= 0.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/setup.py new/beniget-0.3.0/setup.py
--- old/beniget-0.2.0/setup.py 2019-09-07 17:51:00.000000000 +0200
+++ new/beniget-0.3.0/setup.py 2020-08-07 23:52:10.000000000 +0200
@@ -9,13 +9,14 @@
setup(
name="beniget", # gast, beniget!
- version="0.2.0",
+ version="0.3.0",
packages=["beniget"],
description="Extract semantic information about static Python code",
long_description="""
A static analyzer for Python2 and Python3 code.
-Beniget provides a static over-approximation of the global and local definitions inside Python Module/Class/Function.
+Beniget provides a static over-approximation of the global and
+local definitions inside Python Module/Class/Function.
It can also compute def-use chains from each definition.""",
author="serge-sans-paille",
author_email="serge.guelton(a)telecom-bretagne.eu",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/tests/chains.py new/beniget-0.3.0/tests/chains.py
--- old/beniget-0.2.0/tests/chains.py 2019-09-07 17:50:27.000000000 +0200
+++ new/beniget-0.3.0/tests/chains.py 2020-05-25 16:37:33.000000000 +0200
@@ -1,9 +1,25 @@
+from contextlib import contextmanager
from unittest import TestCase, skipIf
import gast as ast
import beniget
+import io
import sys
+@contextmanager
+def captured_output():
+ if sys.version_info.major >= 3:
+ new_out, new_err = io.StringIO(), io.StringIO()
+ else:
+ new_out, new_err = io.BytesIO(), io.BytesIO()
+ old_out, old_err = sys.stdout, sys.stderr
+ try:
+ sys.stdout, sys.stderr = new_out, new_err
+ yield sys.stdout, sys.stderr
+ finally:
+ sys.stdout, sys.stderr = old_out, old_err
+
+
class TestDefUseChains(TestCase):
def checkChains(self, code, ref):
class StrictDefUseChains(beniget.DefUseChains):
@@ -62,6 +78,18 @@
code, ["m -> (m -> (BinOp -> ()))", "i -> ()", "m -> (m -> (BinOp -> ()))"]
)
+ def test_continue_in_loop(self):
+ code = "for i in [1, 2]:\n if i: m = 1; continue\n m = 1\nm"
+ self.checkChains(
+ code, ['i -> (i -> ())', 'm -> (m -> ())', 'm -> (m -> ())']
+ )
+
+ def test_break_in_loop(self):
+ code = "for i in [1, 2]:\n if i: m = 1; continue\n m = 1\nm"
+ self.checkChains(
+ code, ['i -> (i -> ())', 'm -> (m -> ())', 'm -> (m -> ())']
+ )
+
def test_augassign(self):
code = "a = 1; a += 2; a"
self.checkChains(code, ['a -> (a -> (a -> ()))'])
@@ -146,10 +174,9 @@
code,
['I -> (I -> ())',
'J -> (J -> ())',
- 'J -> (J -> ())',
'i -> (i -> (Compare -> ()), i -> ())',
- 'I -> (I -> ())']
- ,
+ 'I -> (I -> ())',
+ 'J -> (J -> ())']
)
def test_simple_while(self):
@@ -171,6 +198,38 @@
['i -> (i -> ())',
'i -> ()'])
+ def test_while_cond_break(self):
+ code = "i = 8\nwhile 1:\n if i: i=1;break\ni"
+ self.checkChains(
+ code,
+ ['i -> (i -> (), i -> ())', 'i -> (i -> ())'])
+
+ def test_nested_while(self):
+ code = '''
+done = 1
+while done:
+
+ while done:
+ if 1:
+ done = 1
+ break
+
+ if 1:
+ break'''
+
+
+ self.checkChains(
+ code,
+ ['done -> (done -> (), done -> ())',
+ 'done -> (done -> (), done -> ())']
+ )
+
+ def test_while_cond_continue(self):
+ code = "i = 8\nwhile 1:\n if i: i=1;continue\ni"
+ self.checkChains(
+ code,
+ ['i -> (i -> (), i -> ())', 'i -> (i -> (), i -> ())'])
+
def test_complex_while_orelse(self):
code = "I = J = i = 0\nwhile i:\n if i < 3: I = i\nelse:\n if 1: J = I\nJ"
self.checkChains(
@@ -184,6 +243,14 @@
],
)
+ def test_while_orelse_break(self):
+ code = "I = 0\nwhile I:\n if 1: I = 1; break\nelse: I"
+ self.checkChains(
+ code,
+ ['I -> (I -> (), I -> ())',
+ 'I -> ()'],
+ )
+
def test_while_nested_break(self):
code = "i = 8\nwhile i:\n if i: break\n i = 3\ni"
self.checkChains(
@@ -278,10 +345,45 @@
self.checkChains(code, ["decorator -> (decorator -> (C -> ()))", "C -> ()"])
@skipIf(sys.version_info.major < 3, "Python 3 syntax")
+ def test_functiondef_returns(self):
+ code = "x = 1\ndef foo() -> x: pass"
+ self.checkChains(code, ['x -> (x -> ())', 'foo -> ()'])
+
+ @skipIf(sys.version_info.major < 3, "Python 3 syntax")
def test_class_annotation(self):
code = "type_ = int\ndef foo(bar: type_): pass"
self.checkChains(code, ["type_ -> (type_ -> ())", "foo -> ()"])
+ def check_unbound_identifier_message(self, code, expected_messages, filename=None):
+ node = ast.parse(code)
+ c = beniget.DefUseChains(filename)
+ with captured_output() as (out, err):
+ c.visit(node)
+ produced_messages = out.getvalue().strip().split("\n")
+
+ self.assertEqual(len(expected_messages), len(produced_messages))
+ for expected, produced in zip(expected_messages, produced_messages):
+ self.assertIn(expected, produced, "actual message contains expected message")
+
+ def test_unbound_identifier_message_format(self):
+ code = "foo(1)\nbar(2)"
+ self.check_unbound_identifier_message(code, ["<unknown>:1", "<unknown>:2"])
+ self.check_unbound_identifier_message(code, ["foo.py:1", "foo.py:2"], filename="foo.py")
+
+ def test_star_import_with_conditional_redef(self):
+ code = '''
+from math import *
+
+if 1:
+ def pop():
+ cos()
+cos = pop()'''
+ self.checkChains(code, [
+ '* -> (cos -> (Call -> ()))',
+ 'pop -> (pop -> (Call -> ()))',
+ 'cos -> (cos -> (Call -> ()))'
+ ])
+
class TestUseDefChains(TestCase):
def checkChains(self, code, ref):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/beniget-0.2.0/tests/definitions.py new/beniget-0.3.0/tests/definitions.py
--- old/beniget-0.2.0/tests/definitions.py 2019-06-28 16:02:48.000000000 +0200
+++ new/beniget-0.3.0/tests/definitions.py 2020-06-05 22:45:23.000000000 +0200
@@ -50,6 +50,10 @@
code = "class C:pass\ndel C"
self.checkGlobals(code, ["C"])
+ def testDelClassDefReDef(self):
+ code = "class C:pass\ndel C\nclass C:pass"
+ self.checkGlobals(code, ["C", "C"])
+
def testNestedClassDef(self):
code = "class C:\n class D: pass"
self.checkGlobals(code, ["C"])
@@ -218,6 +222,10 @@
code = "from foo import *"
self.checkGlobals(code, ["*"])
+ def testGlobalImportFromStarRedefine(self):
+ code = "from foo import *\nx+=1"
+ self.checkGlobals(code, ["*", "x"])
+
def testGlobalImportsFrom(self):
code = "from foo import bar, man"
self.checkGlobals(code, ["bar", "man"])
1
0
Hello community,
here is the log from the commit of package python-pre-commit for openSUSE:Factory checked in at 2020-08-31 16:50:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pre-commit (Old)
and /work/SRC/openSUSE:Factory/.python-pre-commit.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pre-commit"
Mon Aug 31 16:50:34 2020 rev:5 rq:830498 version:2.7.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pre-commit/python-pre-commit.changes 2020-07-20 21:01:20.801091420 +0200
+++ /work/SRC/openSUSE:Factory/.python-pre-commit.new.3399/python-pre-commit.changes 2020-08-31 16:50:59.324375905 +0200
@@ -1,0 +2,34 @@
+Sat Aug 29 05:38:23 UTC 2020 - Arun Persaud <arun(a)gmx.de
+
+- update to version 2.7.1:
+ * Fixes
+ + Improve performance of docker hooks by removing slow ps call
+ #1572 PR by @rkm.
+ #1569 issue by @asottile.
+ + Fix un-healthy() invalidation followed by install being reported
+ as un-healthy().
+ #1576 PR by @asottile.
+ #1575 issue by @jab.
+ + Fix rare file race condition on windows with os.replace()
+ #1577 PR by @asottile.
+
+- changes from version 2.7.0:
+ * Features
+ + Produce error message if an environment is immediately unhealthy
+ #1535 PR by @asottile.
+ + Add --no-allow-missing-config option to init-templatedir
+ #1539 PR by @singergr.
+ + Add warning for old list-style configuration
+ #1544 PR by @asottile.
+ + Allow pre-commit to succeed on a readonly store.
+ #1570 PR by @asottile.
+ #1536 issue by @asottile.
+ * Fixes
+ + Fix error messaging when the store directory is readonly
+ #1546 PR by @asottile.
+ #1536 issue by @asottile.
+ + Improve diff performance with many hooks
+ #1566 PR by @jhenkens.
+ #1564 issue by @jhenkens.
+
+-------------------------------------------------------------------
Old:
----
pre_commit-2.6.0.tar.gz
New:
----
pre_commit-2.7.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pre-commit.spec ++++++
--- /var/tmp/diff_new_pack.oyumQz/_old 2020-08-31 16:51:00.316376385 +0200
+++ /var/tmp/diff_new_pack.oyumQz/_new 2020-08-31 16:51:00.320376387 +0200
@@ -19,7 +19,7 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pre-commit
-Version: 2.6.0
+Version: 2.7.1
Release: 0
Summary: Multi-language pre-commit hooks
License: MIT
++++++ pre_commit-2.6.0.tar.gz -> pre_commit-2.7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/.pre-commit-config.yaml new/pre-commit-2.7.1/.pre-commit-config.yaml
--- old/pre-commit-2.6.0/.pre-commit-config.yaml 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/.pre-commit-config.yaml 2020-08-23 19:53:21.000000000 +0200
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v2.5.0
+ rev: v3.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -12,20 +12,20 @@
- id: requirements-txt-fixer
- id: double-quote-string-fixer
- repo: https://gitlab.com/pycqa/flake8
- rev: 3.8.0
+ rev: 3.8.3
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.6.0]
- repo: https://github.com/pre-commit/mirrors-autopep8
- rev: v1.5.2
+ rev: v1.5.3
hooks:
- id: autopep8
- repo: https://github.com/pre-commit/pre-commit
- rev: v2.4.0
+ rev: v2.6.0
hooks:
- id: validate_manifest
- repo: https://github.com/asottile/pyupgrade
- rev: v2.4.1
+ rev: v2.6.2
hooks:
- id: pyupgrade
args: [--py36-plus]
@@ -40,11 +40,11 @@
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/setup-cfg-fmt
- rev: v1.9.0
+ rev: v1.10.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v0.770
+ rev: v0.782
hooks:
- id: mypy
exclude: ^testing/resources/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/CHANGELOG.md new/pre-commit-2.7.1/CHANGELOG.md
--- old/pre-commit-2.6.0/CHANGELOG.md 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/CHANGELOG.md 2020-08-23 19:53:21.000000000 +0200
@@ -1,3 +1,40 @@
+2.7.1 - 2020-08-23
+==================
+
+### Fixes
+- Improve performance of docker hooks by removing slow `ps` call
+ - #1572 PR by @rkm.
+ - #1569 issue by @asottile.
+- Fix un-`healthy()` invalidation followed by install being reported as
+ un-`healthy()`.
+ - #1576 PR by @asottile.
+ - #1575 issue by @jab.
+- Fix rare file race condition on windows with `os.replace()`
+ - #1577 PR by @asottile.
+
+2.7.0 - 2020-08-22
+==================
+
+### Features
+- Produce error message if an environment is immediately unhealthy
+ - #1535 PR by @asottile.
+- Add --no-allow-missing-config option to init-templatedir
+ - #1539 PR by @singergr.
+- Add warning for old list-style configuration
+ - #1544 PR by @asottile.
+- Allow pre-commit to succeed on a readonly store.
+ - #1570 PR by @asottile.
+ - #1536 issue by @asottile.
+
+### Fixes
+- Fix error messaging when the store directory is readonly
+ - #1546 PR by @asottile.
+ - #1536 issue by @asottile.
+- Improve `diff` performance with many hooks
+ - #1566 PR by @jhenkens.
+ - #1564 issue by @jhenkens.
+
+
2.6.0 - 2020-07-01
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/clientlib.py new/pre-commit-2.7.1/pre_commit/clientlib.py
--- old/pre-commit-2.6.0/pre_commit/clientlib.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/clientlib.py 2020-08-23 19:53:21.000000000 +0200
@@ -12,8 +12,10 @@
from identify.identify import ALL_TAGS
import pre_commit.constants as C
+from pre_commit.color import add_color_option
from pre_commit.error_handler import FatalError
from pre_commit.languages.all import all_languages
+from pre_commit.logging_handler import logging_handler
from pre_commit.util import parse_version
from pre_commit.util import yaml_load
@@ -43,6 +45,7 @@
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help=filenames_help)
parser.add_argument('-V', '--version', action='version', version=C.VERSION)
+ add_color_option(parser)
return parser
@@ -92,14 +95,16 @@
def validate_manifest_main(argv: Optional[Sequence[str]] = None) -> int:
parser = _make_argparser('Manifest filenames.')
args = parser.parse_args(argv)
- ret = 0
- for filename in args.filenames:
- try:
- load_manifest(filename)
- except InvalidManifestError as e:
- print(e)
- ret = 1
- return ret
+
+ with logging_handler(args.color):
+ ret = 0
+ for filename in args.filenames:
+ try:
+ load_manifest(filename)
+ except InvalidManifestError as e:
+ print(e)
+ ret = 1
+ return ret
LOCAL = 'local'
@@ -290,7 +295,11 @@
def ordered_load_normalize_legacy_config(contents: str) -> Dict[str, Any]:
data = yaml_load(contents)
if isinstance(data, list):
- # TODO: Once happy, issue a deprecation warning and instructions
+ logger.warning(
+ 'normalizing pre-commit configuration to a top-level map. '
+ 'support for top level list will be removed in a future version. '
+ 'run: `pre-commit migrate-config` to automatically fix this.',
+ )
return {'repos': data}
else:
return data
@@ -307,11 +316,13 @@
def validate_config_main(argv: Optional[Sequence[str]] = None) -> int:
parser = _make_argparser('Config filenames.')
args = parser.parse_args(argv)
- ret = 0
- for filename in args.filenames:
- try:
- load_config(filename)
- except InvalidConfigError as e:
- print(e)
- ret = 1
- return ret
+
+ with logging_handler(args.color):
+ ret = 0
+ for filename in args.filenames:
+ try:
+ load_config(filename)
+ except InvalidConfigError as e:
+ print(e)
+ ret = 1
+ return ret
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/color.py new/pre-commit-2.7.1/pre_commit/color.py
--- old/pre-commit-2.6.0/pre_commit/color.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/color.py 2020-08-23 19:53:21.000000000 +0200
@@ -1,3 +1,4 @@
+import argparse
import os
import sys
@@ -95,3 +96,12 @@
os.getenv('TERM') != 'dumb'
)
)
+
+
+def add_color_option(parser: argparse.ArgumentParser) -> None:
+ parser.add_argument(
+ '--color', default=os.environ.get('PRE_COMMIT_COLOR', 'auto'),
+ type=use_color,
+ metavar='{' + ','.join(COLOR_CHOICES) + '}',
+ help='Whether to use color in output. Defaults to `%(default)s`.',
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/commands/init_templatedir.py new/pre-commit-2.7.1/pre_commit/commands/init_templatedir.py
--- old/pre-commit-2.6.0/pre_commit/commands/init_templatedir.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/commands/init_templatedir.py 2020-08-23 19:53:21.000000000 +0200
@@ -15,10 +15,15 @@
store: Store,
directory: str,
hook_types: Sequence[str],
+ skip_on_missing_config: bool = True,
) -> int:
install(
- config_file, store, hook_types=hook_types,
- overwrite=True, skip_on_missing_config=True, git_dir=directory,
+ config_file,
+ store,
+ hook_types=hook_types,
+ overwrite=True,
+ skip_on_missing_config=skip_on_missing_config,
+ git_dir=directory,
)
try:
_, out, _ = cmd_output('git', 'config', 'init.templateDir')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/commands/install_uninstall.py new/pre-commit-2.7.1/pre_commit/commands/install_uninstall.py
--- old/pre-commit-2.6.0/pre_commit/commands/install_uninstall.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/commands/install_uninstall.py 2020-08-23 19:53:21.000000000 +0200
@@ -165,7 +165,7 @@
output.write_line(f'{hook_type} uninstalled')
if os.path.exists(legacy_path):
- os.rename(legacy_path, hook_path)
+ os.replace(legacy_path, hook_path)
output.write_line(f'Restored previous hooks to {hook_path}')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/commands/run.py new/pre-commit-2.7.1/pre_commit/commands/run.py
--- old/pre-commit-2.6.0/pre_commit/commands/run.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/commands/run.py 2020-08-23 19:53:21.000000000 +0200
@@ -134,9 +134,10 @@
hook: Hook,
skips: Set[str],
cols: int,
+ diff_before: bytes,
verbose: bool,
use_color: bool,
-) -> bool:
+) -> Tuple[bool, bytes]:
filenames = classifier.filenames_for_hook(hook)
if hook.id in skips or hook.alias in skips:
@@ -151,6 +152,7 @@
)
duration = None
retcode = 0
+ diff_after = diff_before
files_modified = False
out = b''
elif not filenames and not hook.always_run:
@@ -166,21 +168,20 @@
)
duration = None
retcode = 0
+ diff_after = diff_before
files_modified = False
out = b''
else:
# print hook and dots first in case the hook takes a while to run
output.write(_start_msg(start=hook.name, end_len=6, cols=cols))
- diff_cmd = ('git', 'diff', '--no-ext-diff')
- diff_before = cmd_output_b(*diff_cmd, retcode=None)
if not hook.pass_filenames:
filenames = ()
time_before = time.time()
language = languages[hook.language]
retcode, out = language.run_hook(hook, filenames, use_color)
duration = round(time.time() - time_before, 2) or 0
- diff_after = cmd_output_b(*diff_cmd, retcode=None)
+ diff_after = _get_diff()
# if the hook makes changes, fail the commit
files_modified = diff_before != diff_after
@@ -212,7 +213,7 @@
output.write_line_b(out.strip(), logfile_name=hook.log_file)
output.write_line()
- return files_modified or bool(retcode)
+ return files_modified or bool(retcode), diff_after
def _compute_cols(hooks: Sequence[Hook]) -> int:
@@ -248,6 +249,11 @@
return git.get_staged_files()
+def _get_diff() -> bytes:
+ _, out, _ = cmd_output_b('git', 'diff', '--no-ext-diff', retcode=None)
+ return out
+
+
def _run_hooks(
config: Dict[str, Any],
hooks: Sequence[Hook],
@@ -261,14 +267,16 @@
_all_filenames(args), config['files'], config['exclude'],
)
retval = 0
+ prior_diff = _get_diff()
for hook in hooks:
- retval |= _run_single_hook(
- classifier, hook, skips, cols,
+ current_retval, prior_diff = _run_single_hook(
+ classifier, hook, skips, cols, prior_diff,
verbose=args.verbose, use_color=args.color,
)
+ retval |= current_retval
if retval and config['fail_fast']:
break
- if retval and args.show_diff_on_failure and git.has_diff():
+ if retval and args.show_diff_on_failure and prior_diff:
if args.all_files:
output.write_line(
'pre-commit hook(s) made changes.\n'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/error_handler.py new/pre-commit-2.7.1/pre_commit/error_handler.py
--- old/pre-commit-2.6.0/pre_commit/error_handler.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/error_handler.py 2020-08-23 19:53:21.000000000 +0200
@@ -18,10 +18,17 @@
def _log_and_exit(msg: str, exc: BaseException, formatted: str) -> None:
error_msg = f'{msg}: {type(exc).__name__}: '.encode() + force_bytes(exc)
output.write_line_b(error_msg)
- log_path = os.path.join(Store().directory, 'pre-commit.log')
- output.write_line(f'Check the log at {log_path}')
- with open(log_path, 'wb') as log:
+ storedir = Store().directory
+ log_path = os.path.join(storedir, 'pre-commit.log')
+ with contextlib.ExitStack() as ctx:
+ if os.access(storedir, os.W_OK):
+ output.write_line(f'Check the log at {log_path}')
+ log = ctx.enter_context(open(log_path, 'wb'))
+ else: # pragma: win32 no cover
+ output.write_line(f'Failed to write to log at {log_path}')
+ log = sys.stdout.buffer
+
_log_line = functools.partial(output.write_line, stream=log)
_log_line_b = functools.partial(output.write_line_b, stream=log)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/file_lock.py new/pre-commit-2.7.1/pre_commit/file_lock.py
--- old/pre-commit-2.6.0/pre_commit/file_lock.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/file_lock.py 2020-08-23 19:53:21.000000000 +0200
@@ -21,13 +21,13 @@
) -> Generator[None, None, None]:
try:
# TODO: https://github.com/python/typeshed/pull/3607
- msvcrt.locking(fileno, msvcrt.LK_NBLCK, _region) # type: ignore
+ msvcrt.locking(fileno, msvcrt.LK_NBLCK, _region)
except OSError:
blocked_cb()
while True:
try:
# TODO: https://github.com/python/typeshed/pull/3607
- msvcrt.locking(fileno, msvcrt.LK_LOCK, _region) # type: ignore # noqa: E501
+ msvcrt.locking(fileno, msvcrt.LK_LOCK, _region)
except OSError as e:
# Locking violation. Returned when the _LK_LOCK or _LK_RLCK
# flag is specified and the file cannot be locked after 10
@@ -46,7 +46,7 @@
# "Regions should be locked only briefly and should be unlocked
# before closing a file or exiting the program."
# TODO: https://github.com/python/typeshed/pull/3607
- msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region) # type: ignore
+ msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region)
else: # pragma: win32 no cover
import fcntl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/languages/docker.py new/pre-commit-2.7.1/pre_commit/languages/docker.py
--- old/pre-commit-2.6.0/pre_commit/languages/docker.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/languages/docker.py 2020-08-23 19:53:21.000000000 +0200
@@ -7,9 +7,7 @@
from pre_commit.hook import Hook
from pre_commit.languages import helpers
from pre_commit.prefix import Prefix
-from pre_commit.util import CalledProcessError
from pre_commit.util import clean_path_on_failure
-from pre_commit.util import cmd_output_b
ENVIRONMENT_DIR = 'docker'
PRE_COMMIT_LABEL = 'PRE_COMMIT'
@@ -26,21 +24,6 @@
return f'pre-commit-{md5sum}'
-def docker_is_running() -> bool: # pragma: win32 no cover
- try:
- cmd_output_b('docker', 'ps')
- except CalledProcessError:
- return False
- else:
- return True
-
-
-def assert_docker_available() -> None: # pragma: win32 no cover
- assert docker_is_running(), (
- 'Docker is either not running or not configured in this environment'
- )
-
-
def build_docker_image(
prefix: Prefix,
*,
@@ -63,7 +46,6 @@
) -> None: # pragma: win32 no cover
helpers.assert_version_default('docker', version)
helpers.assert_no_additional_deps('docker', additional_dependencies)
- assert_docker_available()
directory = prefix.path(
helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT),
@@ -101,7 +83,6 @@
file_args: Sequence[str],
color: bool,
) -> Tuple[int, bytes]: # pragma: win32 no cover
- assert_docker_available()
# Rebuild the docker image in case it has gone missing, as many people do
# automated cleanup of docker images.
build_docker_image(hook.prefix, pull=False)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/languages/docker_image.py new/pre-commit-2.7.1/pre_commit/languages/docker_image.py
--- old/pre-commit-2.6.0/pre_commit/languages/docker_image.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/languages/docker_image.py 2020-08-23 19:53:21.000000000 +0200
@@ -3,7 +3,6 @@
from pre_commit.hook import Hook
from pre_commit.languages import helpers
-from pre_commit.languages.docker import assert_docker_available
from pre_commit.languages.docker import docker_cmd
ENVIRONMENT_DIR = None
@@ -17,6 +16,5 @@
file_args: Sequence[str],
color: bool,
) -> Tuple[int, bytes]: # pragma: win32 no cover
- assert_docker_available()
cmd = docker_cmd() + hook.cmd
return helpers.run_xargs(hook, cmd, file_args, color=color)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/languages/python.py new/pre-commit-2.7.1/pre_commit/languages/python.py
--- old/pre-commit-2.6.0/pre_commit/languages/python.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/languages/python.py 2020-08-23 19:53:21.000000000 +0200
@@ -191,7 +191,8 @@
return (
'version_info' in cfg and
- _version_info(py_exe) == cfg['version_info'] and (
+ # always use uncached lookup here in case we replaced an unhealthy env
+ _version_info.__wrapped__(py_exe) == cfg['version_info'] and (
'base-executable' not in cfg or
_version_info(cfg['base-executable']) == cfg['version_info']
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/main.py new/pre-commit-2.7.1/pre_commit/main.py
--- old/pre-commit-2.6.0/pre_commit/main.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/main.py 2020-08-23 19:53:21.000000000 +0200
@@ -8,8 +8,8 @@
from typing import Union
import pre_commit.constants as C
-from pre_commit import color
from pre_commit import git
+from pre_commit.color import add_color_option
from pre_commit.commands.autoupdate import autoupdate
from pre_commit.commands.clean import clean
from pre_commit.commands.gc import gc
@@ -41,15 +41,6 @@
COMMANDS_NO_GIT = {'clean', 'gc', 'init-templatedir', 'sample-config'}
-def _add_color_option(parser: argparse.ArgumentParser) -> None:
- parser.add_argument(
- '--color', default=os.environ.get('PRE_COMMIT_COLOR', 'auto'),
- type=color.use_color,
- metavar='{' + ','.join(color.COLOR_CHOICES) + '}',
- help='Whether to use color in output. Defaults to `%(default)s`.',
- )
-
-
def _add_config_option(parser: argparse.ArgumentParser) -> None:
parser.add_argument(
'-c', '--config', default=C.CONFIG_FILE,
@@ -195,7 +186,7 @@
'autoupdate',
help="Auto-update pre-commit config to the latest repos' versions.",
)
- _add_color_option(autoupdate_parser)
+ add_color_option(autoupdate_parser)
_add_config_option(autoupdate_parser)
autoupdate_parser.add_argument(
'--bleeding-edge', action='store_true',
@@ -216,11 +207,11 @@
clean_parser = subparsers.add_parser(
'clean', help='Clean out pre-commit files.',
)
- _add_color_option(clean_parser)
+ add_color_option(clean_parser)
_add_config_option(clean_parser)
hook_impl_parser = subparsers.add_parser('hook-impl')
- _add_color_option(hook_impl_parser)
+ add_color_option(hook_impl_parser)
_add_config_option(hook_impl_parser)
hook_impl_parser.add_argument('--hook-type')
hook_impl_parser.add_argument('--hook-dir')
@@ -230,7 +221,7 @@
hook_impl_parser.add_argument(dest='rest', nargs=argparse.REMAINDER)
gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.')
- _add_color_option(gc_parser)
+ add_color_option(gc_parser)
_add_config_option(gc_parser)
init_templatedir_parser = subparsers.add_parser(
@@ -240,17 +231,23 @@
'`git config init.templateDir`.'
),
)
- _add_color_option(init_templatedir_parser)
+ add_color_option(init_templatedir_parser)
_add_config_option(init_templatedir_parser)
init_templatedir_parser.add_argument(
'directory', help='The directory in which to write the hook script.',
)
+ init_templatedir_parser.add_argument(
+ '--no-allow-missing-config',
+ action='store_false',
+ dest='allow_missing_config',
+ help='Assume cloned repos should have a `pre-commit` config.',
+ )
_add_hook_type_option(init_templatedir_parser)
install_parser = subparsers.add_parser(
'install', help='Install the pre-commit script.',
)
- _add_color_option(install_parser)
+ add_color_option(install_parser)
_add_config_option(install_parser)
install_parser.add_argument(
'-f', '--overwrite', action='store_true',
@@ -280,32 +277,32 @@
'useful.'
),
)
- _add_color_option(install_hooks_parser)
+ add_color_option(install_hooks_parser)
_add_config_option(install_hooks_parser)
migrate_config_parser = subparsers.add_parser(
'migrate-config',
help='Migrate list configuration to new map configuration.',
)
- _add_color_option(migrate_config_parser)
+ add_color_option(migrate_config_parser)
_add_config_option(migrate_config_parser)
run_parser = subparsers.add_parser('run', help='Run hooks.')
- _add_color_option(run_parser)
+ add_color_option(run_parser)
_add_config_option(run_parser)
_add_run_options(run_parser)
sample_config_parser = subparsers.add_parser(
'sample-config', help=f'Produce a sample {C.CONFIG_FILE} file',
)
- _add_color_option(sample_config_parser)
+ add_color_option(sample_config_parser)
_add_config_option(sample_config_parser)
try_repo_parser = subparsers.add_parser(
'try-repo',
help='Try the hooks in a repository, useful for developing new hooks.',
)
- _add_color_option(try_repo_parser)
+ add_color_option(try_repo_parser)
_add_config_option(try_repo_parser)
try_repo_parser.add_argument(
'repo', help='Repository to source hooks from.',
@@ -322,7 +319,7 @@
uninstall_parser = subparsers.add_parser(
'uninstall', help='Uninstall the pre-commit script.',
)
- _add_color_option(uninstall_parser)
+ add_color_option(uninstall_parser)
_add_config_option(uninstall_parser)
_add_hook_type_option(uninstall_parser)
@@ -383,6 +380,7 @@
return init_templatedir(
args.config, store, args.directory,
hook_types=args.hook_types,
+ skip_on_missing_config=args.allow_missing_config,
)
elif args.command == 'install-hooks':
return install_hooks(args.config, store)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/repository.py new/pre-commit-2.7.1/pre_commit/repository.py
--- old/pre-commit-2.6.0/pre_commit/repository.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/repository.py 2020-08-23 19:53:21.000000000 +0200
@@ -48,7 +48,7 @@
with open(staging, 'w') as state_file:
state_file.write(json.dumps(state))
# Move the file into place atomically to indicate we've installed
- os.rename(staging, state_filename)
+ os.replace(staging, state_filename)
def _hook_installed(hook: Hook) -> bool:
@@ -82,6 +82,12 @@
lang.install_environment(
hook.prefix, hook.language_version, hook.additional_dependencies,
)
+ if not lang.healthy(hook.prefix, hook.language_version):
+ raise AssertionError(
+ f'BUG: expected environment for {hook.language} to be healthy() '
+ f'immediately after install, please open an issue describing '
+ f'your environment',
+ )
# Write our state to indicate we're installed
_write_state(hook.prefix, venv, _state(hook.additional_dependencies))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/pre_commit/store.py new/pre-commit-2.7.1/pre_commit/store.py
--- old/pre-commit-2.6.0/pre_commit/store.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/pre_commit/store.py 2020-08-23 19:53:21.000000000 +0200
@@ -43,6 +43,10 @@
def __init__(self, directory: Optional[str] = None) -> None:
self.directory = directory or Store.get_default_directory()
self.db_path = os.path.join(self.directory, 'db.db')
+ self.readonly = (
+ os.path.exists(self.directory) and
+ not os.access(self.directory, os.W_OK)
+ )
if not os.path.exists(self.directory):
os.makedirs(self.directory, exist_ok=True)
@@ -75,7 +79,7 @@
self._create_config_table(db)
# Atomic file move
- os.rename(tmpfile, self.db_path)
+ os.replace(tmpfile, self.db_path)
@contextlib.contextmanager
def exclusive_lock(self) -> Generator[None, None, None]:
@@ -218,6 +222,8 @@
)
def mark_config_used(self, path: str) -> None:
+ if self.readonly: # pragma: win32 no cover
+ return
path = os.path.realpath(path)
# don't insert config files that do not exist
if not os.path.exists(path):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/setup.cfg new/pre-commit-2.7.1/setup.cfg
--- old/pre-commit-2.6.0/setup.cfg 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/setup.cfg 2020-08-23 19:53:21.000000000 +0200
@@ -1,6 +1,6 @@
[metadata]
name = pre_commit
-version = 2.6.0
+version = 2.7.1
description = A framework for managing and maintaining multi-language pre-commit hooks.
long_description = file: README.md
long_description_content_type = text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/testing/util.py new/pre-commit-2.7.1/testing/util.py
--- old/pre-commit-2.6.0/testing/util.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/testing/util.py 2020-08-23 19:53:21.000000000 +0200
@@ -5,14 +5,24 @@
import pytest
from pre_commit import parse_shebang
-from pre_commit.languages.docker import docker_is_running
+from pre_commit.util import CalledProcessError
from pre_commit.util import cmd_output
+from pre_commit.util import cmd_output_b
from testing.auto_namedtuple import auto_namedtuple
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
+def docker_is_running() -> bool: # pragma: win32 no cover
+ try:
+ cmd_output_b('docker', 'ps')
+ except CalledProcessError: # pragma: no cover
+ return False
+ else:
+ return True
+
+
def get_resource_path(path):
return os.path.join(TESTING_DIR, 'resources', path)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/clientlib_test.py new/pre-commit-2.7.1/tests/clientlib_test.py
--- old/pre-commit-2.6.0/tests/clientlib_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/clientlib_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -30,6 +30,10 @@
check_type_tag(value)
+def test_check_type_tag_success():
+ check_type_tag('file')
+
+
@pytest.mark.parametrize(
('config_obj', 'expected'), (
(
@@ -110,15 +114,18 @@
assert not validate_config_main(('.pre-commit-config.yaml',))
-def test_validate_config_old_list_format_ok(tmpdir):
+def test_validate_config_old_list_format_ok(tmpdir, cap_out):
f = tmpdir.join('cfg.yaml')
f.write('- {repo: meta, hooks: [{id: identity}]}')
assert not validate_config_main((f.strpath,))
+ start = '[WARNING] normalizing pre-commit configuration to a top-level map'
+ assert cap_out.get().startswith(start)
def test_validate_warn_on_unknown_keys_at_repo_level(tmpdir, caplog):
f = tmpdir.join('cfg.yaml')
f.write(
+ 'repos:\n'
'- repo: https://gitlab.com/pycqa/flake8\n'
' rev: 3.7.7\n'
' hooks:\n'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/commands/init_templatedir_test.py new/pre-commit-2.7.1/tests/commands/init_templatedir_test.py
--- old/pre-commit-2.6.0/tests/commands/init_templatedir_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/commands/init_templatedir_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -1,6 +1,8 @@
import os.path
from unittest import mock
+import pytest
+
import pre_commit.constants as C
from pre_commit.commands.init_templatedir import init_templatedir
from pre_commit.envcontext import envcontext
@@ -90,3 +92,49 @@
C.CONFIG_FILE, store, target, hook_types=['pre-commit'],
)
assert target.join('hooks/pre-commit').exists()
+
+
+(a)pytest.mark.parametrize(
+ ('skip', 'commit_retcode', 'commit_output_snippet'),
+ (
+ (True, 0, 'Skipping `pre-commit`.'),
+ (False, 1, f'No {C.CONFIG_FILE} file was found'),
+ ),
+)
+def test_init_templatedir_skip_on_missing_config(
+ tmpdir,
+ tempdir_factory,
+ store,
+ cap_out,
+ skip,
+ commit_retcode,
+ commit_output_snippet,
+):
+ target = str(tmpdir.join('tmpl'))
+ init_git_dir = git_dir(tempdir_factory)
+ with cwd(init_git_dir):
+ cmd_output('git', 'config', 'init.templateDir', target)
+ init_templatedir(
+ C.CONFIG_FILE,
+ store,
+ target,
+ hook_types=['pre-commit'],
+ skip_on_missing_config=skip,
+ )
+
+ lines = cap_out.get().splitlines()
+ assert len(lines) == 1
+ assert lines[0].startswith('pre-commit installed at')
+
+ with envcontext((('GIT_TEMPLATE_DIR', target),)):
+ verify_git_dir = git_dir(tempdir_factory)
+
+ with cwd(verify_git_dir):
+ retcode, output = git_commit(
+ fn=cmd_output_mocked_pre_commit_home,
+ tempdir_factory=tempdir_factory,
+ retcode=None,
+ )
+
+ assert retcode == commit_retcode
+ assert commit_output_snippet in output
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/error_handler_test.py new/pre-commit-2.7.1/tests/error_handler_test.py
--- old/pre-commit-2.6.0/tests/error_handler_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/error_handler_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -1,13 +1,16 @@
import os.path
import re
+import stat
import sys
from unittest import mock
import pytest
from pre_commit import error_handler
+from pre_commit.store import Store
from pre_commit.util import CalledProcessError
from testing.util import cmd_output_mocked_pre_commit_home
+from testing.util import xfailif_windows
@pytest.fixture
@@ -168,3 +171,29 @@
out_lines = out.splitlines()
assert out_lines[-2] == 'An unexpected error has occurred: ValueError: ☃'
assert out_lines[-1] == f'Check the log at {log_file}'
+
+
+@xfailif_windows # pragma: win32 no cover
+def test_error_handler_read_only_filesystem(mock_store_dir, cap_out, capsys):
+ # a better scenario would be if even the Store crash would be handled
+ # but realistically we're only targetting systems where the Store has
+ # already been set up
+ Store()
+
+ write = (stat.S_IWGRP | stat.S_IWOTH | stat.S_IWUSR)
+ os.chmod(mock_store_dir, os.stat(mock_store_dir).st_mode & ~write)
+
+ with pytest.raises(SystemExit):
+ with error_handler.error_handler():
+ raise ValueError('ohai')
+
+ output = cap_out.get()
+ assert output.startswith(
+ 'An unexpected error has occurred: ValueError: ohai\n'
+ 'Failed to write to log at ',
+ )
+
+ # our cap_out mock is imperfect so the rest of the output goes to capsys
+ out, _ = capsys.readouterr()
+ # the things that normally go to the log file will end up here
+ assert '### version information' in out
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/languages/docker_test.py new/pre-commit-2.7.1/tests/languages/docker_test.py
--- old/pre-commit-2.6.0/tests/languages/docker_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/languages/docker_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -1,15 +1,6 @@
from unittest import mock
from pre_commit.languages import docker
-from pre_commit.util import CalledProcessError
-
-
-def test_docker_is_running_process_error():
- with mock.patch(
- 'pre_commit.languages.docker.cmd_output_b',
- side_effect=CalledProcessError(1, (), 0, b'', None),
- ):
- assert docker.docker_is_running() is False
def test_docker_fallback_user():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/languages/python_test.py new/pre-commit-2.7.1/tests/languages/python_test.py
--- old/pre-commit-2.6.0/tests/languages/python_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/languages/python_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -8,6 +8,7 @@
from pre_commit.envcontext import envcontext
from pre_commit.languages import python
from pre_commit.prefix import Prefix
+from pre_commit.util import make_executable
def test_read_pyvenv_cfg(tmpdir):
@@ -141,3 +142,26 @@
os.remove(prefix.path('py_env-default/pyvenv.cfg'))
assert python.healthy(prefix, C.DEFAULT) is False
+
+
+def test_unhealthy_then_replaced(python_dir):
+ prefix, tmpdir = python_dir
+
+ python.install_environment(prefix, C.DEFAULT, ())
+
+ # simulate an exe which returns an old version
+ exe_name = 'python.exe' if sys.platform == 'win32' else 'python'
+ py_exe = prefix.path(python.bin_dir('py_env-default'), exe_name)
+ os.rename(py_exe, f'{py_exe}.tmp')
+
+ with open(py_exe, 'w') as f:
+ f.write('#!/usr/bin/env bash\necho 1.2.3\n')
+ make_executable(py_exe)
+
+ # should be unhealthy due to version mismatch
+ assert python.healthy(prefix, C.DEFAULT) is False
+
+ # now put the exe back and it should be healthy again
+ os.replace(f'{py_exe}.tmp', py_exe)
+
+ assert python.healthy(prefix, C.DEFAULT) is True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/main_test.py new/pre-commit-2.7.1/tests/main_test.py
--- old/pre-commit-2.6.0/tests/main_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/main_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -159,7 +159,28 @@
def test_init_templatedir(mock_store_dir):
with mock.patch.object(main, 'init_templatedir') as patch:
main.main(('init-templatedir', 'tdir'))
+
+ assert patch.call_count == 1
+ assert 'tdir' in patch.call_args[0]
+ assert patch.call_args[1]['hook_types'] == ['pre-commit']
+ assert patch.call_args[1]['skip_on_missing_config'] is True
+
+
+def test_init_templatedir_options(mock_store_dir):
+ args = (
+ 'init-templatedir',
+ 'tdir',
+ '--hook-type',
+ 'commit-msg',
+ '--no-allow-missing-config',
+ )
+ with mock.patch.object(main, 'init_templatedir') as patch:
+ main.main(args)
+
assert patch.call_count == 1
+ assert 'tdir' in patch.call_args[0]
+ assert patch.call_args[1]['hook_types'] == ['commit-msg']
+ assert patch.call_args[1]['skip_on_missing_config'] is False
def test_help_cmd_in_empty_directory(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pre-commit-2.6.0/tests/store_test.py new/pre-commit-2.7.1/tests/store_test.py
--- old/pre-commit-2.6.0/tests/store_test.py 2020-07-01 21:39:34.000000000 +0200
+++ new/pre-commit-2.7.1/tests/store_test.py 2020-08-23 19:53:21.000000000 +0200
@@ -1,5 +1,6 @@
import os.path
import sqlite3
+import stat
from unittest import mock
import pytest
@@ -12,6 +13,7 @@
from testing.fixtures import git_dir
from testing.util import cwd
from testing.util import git_commit
+from testing.util import xfailif_windows
def test_our_session_fixture_works():
@@ -217,3 +219,27 @@
def test_mark_config_as_used_roll_forward(store, tmpdir):
_simulate_pre_1_14_0(store)
test_mark_config_as_used(store, tmpdir)
+
+
+@xfailif_windows # pragma: win32 no cover
+def test_mark_config_as_used_readonly(tmpdir):
+ cfg = tmpdir.join('f').ensure()
+ store_dir = tmpdir.join('store')
+ # make a store, then we'll convert its directory to be readonly
+ assert not Store(str(store_dir)).readonly # directory didn't exist
+ assert not Store(str(store_dir)).readonly # directory did exist
+
+ def _chmod_minus_w(p):
+ st = os.stat(p)
+ os.chmod(p, st.st_mode & ~(stat.S_IWUSR | stat.S_IWOTH | stat.S_IWGRP))
+
+ _chmod_minus_w(store_dir)
+ for fname in os.listdir(store_dir):
+ assert not os.path.isdir(fname)
+ _chmod_minus_w(os.path.join(store_dir, fname))
+
+ store = Store(str(store_dir))
+ assert store.readonly
+ # should be skipped due to readonly
+ store.mark_config_used(str(cfg))
+ assert store.select_all_configs() == []
1
0
Hello community,
here is the log from the commit of package openSUSEway for openSUSE:Factory checked in at 2020-08-31 16:50:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openSUSEway (Old)
and /work/SRC/openSUSE:Factory/.openSUSEway.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openSUSEway"
Mon Aug 31 16:50:29 2020 rev:6 rq:830583 version:0.10
Changes:
--------
--- /work/SRC/openSUSE:Factory/openSUSEway/openSUSEway.changes 2020-08-05 20:30:04.615119841 +0200
+++ /work/SRC/openSUSE:Factory/.openSUSEway.new.3399/openSUSEway.changes 2020-08-31 16:50:55.400374002 +0200
@@ -1,0 +2,6 @@
+Sun Aug 30 09:13:29 UTC 2020 - Denis Kondratenko <denis.kondratenko(a)suse.com>
+
+- New in 0.10 release
+ * don't force qt theme, fixes #24
+
+-------------------------------------------------------------------
Old:
----
openSUSEway-0.9.tar.gz
New:
----
openSUSEway-0.10.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ openSUSEway.spec ++++++
--- /var/tmp/diff_new_pack.bszKCs/_old 2020-08-31 16:50:56.056374320 +0200
+++ /var/tmp/diff_new_pack.bszKCs/_new 2020-08-31 16:50:56.060374322 +0200
@@ -19,7 +19,7 @@
%define waybar_version %(rpm -q --queryformat "%%{version}" waybar)
Name: openSUSEway
-Version: 0.9
+Version: 0.10
Release: 0
Summary: The openSUSEway desktop environment meta package
Group: Metapackages
@@ -127,6 +127,8 @@
## openSUSEway package
install -D -p -m 644 openSUSEway.sh %{buildroot}%{_sysconfdir}/profile.d/openSUSEway.sh
install -D -p -m 644 .config/sway/env %{buildroot}%{_prefix}/lib/environment.d/50-openSUSEway.conf
+### qt5ct config to configure dark theme
+install -D -p -m 644 qt5ct.conf %{buildroot}/%{_sysconfdir}/xdg/qt5ct/qt5ct.conf
## openSUSEway pattern package
mkdir -p %{buildroot}/%{_defaultdocdir}/patterns/
@@ -154,6 +156,8 @@
%files
%config %{_sysconfdir}/profile.d/openSUSEway.sh
%config %{_prefix}/lib/environment.d/50-openSUSEway.conf
+%dir %{_sysconfdir}/xdg/qt5ct/
+%config(noreplace) %{_sysconfdir}/xdg/qt5ct/qt5ct.conf
%files -n patterns-openSUSEway
%dir %{_defaultdocdir}/patterns
++++++ openSUSEway-0.9.tar.gz -> openSUSEway-0.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openSUSEway-0.9/.config/sway/env new/openSUSEway-0.10/.config/sway/env
--- old/openSUSEway-0.9/.config/sway/env 2020-08-04 12:24:04.000000000 +0200
+++ new/openSUSEway-0.10/.config/sway/env 2020-08-30 11:24:51.000000000 +0200
@@ -11,7 +11,7 @@
_JAVA_AWT_WM_NONREPARENTING=1
NO_AT_BRIDGE=1
-# these vars enforce qt theme for openSUSEway
+# QT theme for openSUSEway
# needs qt5ct and adwaita-qt5 packages
-QT_STYLE_OVERRIDE=adwaita-dark
+# default config is /etc/xdg/qt5ct/qt5ct.conf
QT_QPA_PLATFORMTHEME=qt5ct
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openSUSEway-0.9/qt5ct.conf new/openSUSEway-0.10/qt5ct.conf
--- old/openSUSEway-0.9/qt5ct.conf 1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSEway-0.10/qt5ct.conf 2020-08-30 11:24:51.000000000 +0200
@@ -0,0 +1,6 @@
+[Appearance]
+color_scheme_path=/usr/share/qt5ct/colors/darker.conf
+custom_palette=true
+standard_dialogs=gtk2
+style=Adwaita-Dark
+
1
0
Hello community,
here is the log from the commit of package xosview for openSUSE:Factory checked in at 2020-08-31 16:50:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xosview (Old)
and /work/SRC/openSUSE:Factory/.xosview.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xosview"
Mon Aug 31 16:50:18 2020 rev:48 rq:830689 version:1.22
Changes:
--------
--- /work/SRC/openSUSE:Factory/xosview/xosview.changes 2020-04-09 23:17:19.822309554 +0200
+++ /work/SRC/openSUSE:Factory/.xosview.new.3399/xosview.changes 2020-08-31 16:50:51.144371938 +0200
@@ -1,0 +2,9 @@
+Wed Aug 26 08:40:53 UTC 2020 - Dirk Mueller <dmueller(a)suse.com>
+
+- update to 1.22:
+ * Fix build on arm by not including sys/io.h
+ * Add conditional code for v_cache_count
+- update xosview-1.19.dif: remove armv7l conditional as this
+ went upstream
+
+-------------------------------------------------------------------
Old:
----
xosview-1.21.tar.gz
New:
----
xosview-1.22.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xosview.spec ++++++
--- /var/tmp/diff_new_pack.jJDjSj/_old 2020-08-31 16:50:52.252372476 +0200
+++ /var/tmp/diff_new_pack.jJDjSj/_new 2020-08-31 16:50:52.252372476 +0200
@@ -18,17 +18,7 @@
%define _appdefdir %{_datadir}/X11/app-defaults
Name: xosview
-BuildRequires: autoconf
-BuildRequires: gcc-c++
-BuildRequires: pkgconfig
-BuildRequires: pkgconfig(x11)
-BuildRequires: pkgconfig(xpm)
-# NOTE: We don't want this dependency and desktop-data-SuSE is in all
-# desktop selections.
-#Requires: desktop-data-SuSE
-# /usr/bin/xrdb
-Requires: xrdb
-Version: 1.21
+Version: 1.22
Release: 0
Summary: System Load Information
License: GPL-2.0-or-later
@@ -45,13 +35,21 @@
Patch11: xosview-1.16-diskstat.patch
# PATCH-FIX-SUSE: allow more than one maybe not exsting lmstemp resource entry
Patch12: xosview-1.21-lmstemp.patch
+BuildRequires: autoconf
+BuildRequires: gcc-c++
+BuildRequires: pkgconfig
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xpm)
+# NOTE: We don't want this dependency and desktop-data-SuSE is in all
+# desktop selections.
+#Requires: desktop-data-SuSE
+# /usr/bin/xrdb
# NOTE: We don't want this dependency and desktop-data-SuSE is in all
# desktop selections.
#Requires: desktop-data-SuSE
# /usr/bin/xrdb
Requires: xrdb
Requires(post): sed
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A small program which is mostly configurable using resources via
@@ -75,8 +73,8 @@
OPTFLAGS="$OPTFLAGS -fno-const-strings"
fi
esac
-make %{?_smp_mflags} clean
-make %{?_smp_mflags} PLATFORM=linux OPTFLAGS="$OPTFLAGS" PREFIX=%{_prefix} USE_SYSCALLS=1
+%make_build clean
+%make_build PLATFORM=linux OPTFLAGS="$OPTFLAGS" PREFIX=%{_prefix} USE_SYSCALLS=1
%install
mkdir -p %{buildroot}%{_bindir}
@@ -112,7 +110,6 @@
done
%files
-%defattr(-,root,root)
%{_datadir}/pixmaps/xosview.png
%dir %{_datadir}/icons/hicolor/
%dir %{_datadir}/icons/hicolor/32x32/
@@ -123,7 +120,7 @@
%{_bindir}/xosview.bin
%dir %{_appdefdir}
%config %verify(not md5 size mtime) %{_appdefdir}/XOsview
-%{_mandir}/man1/xosview.1%{ext_man}
+%{_mandir}/man1/xosview.1%{?ext_man}
%dir %{_docdir}/xosview/
%doc %{_docdir}/xosview/README
%doc %{_docdir}/xosview/README.linux
++++++ xosview-1.19.dif ++++++
--- /var/tmp/diff_new_pack.jJDjSj/_old 2020-08-31 16:50:52.284372491 +0200
+++ /var/tmp/diff_new_pack.jJDjSj/_new 2020-08-31 16:50:52.284372491 +0200
@@ -798,21 +798,6 @@
}
void DiskMeter::getdiskinfo( void )
---- linux/serialmeter.cc
-+++ linux/serialmeter.cc 2020-04-02 06:18:43.246446896 +0000
-@@ -30,10 +30,10 @@ typedef unsigned long long u64;
- #endif
-
- #if defined(GNULIBC) || defined(__GLIBC__)
--#if !defined(__powerpc__) && !defined(__hppa__) && !defined(__mips__) && !defined(__sparc__) && !defined(__sh__) && !defined(__s390__) && !defined(__s390x__) && !defined(__m68k__) && !defined(__aarch64__)
-+#if !defined(__powerpc__) && !defined(__hppa__) && !defined(__mips__) && !defined(__sparc__) && !defined(__sh__) && !defined(__s390__) && !defined(__s390x__) && !defined(__m68k__) && !defined(__aarch64__) && !defined(__arm__)
- #include <sys/io.h>
- #endif
--#if !defined(__alpha__) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__mips__) && !defined(__sh__) && !defined(__s390__) && !defined (__s390x__) && !defined(__m68k__) && !defined(__aarch64__)
-+#if !defined(__alpha__) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__mips__) && !defined(__sh__) && !defined(__s390__) && !defined (__s390x__) && !defined(__m68k__) && !defined(__aarch64__) && !defined(__arm__)
- #include <sys/perm.h>
- #define HAVE_IOPERM
- #endif
--- llist.cc
+++ llist.cc 2020-04-02 06:19:40.181330816 +0000
@@ -232,24 +232,32 @@ void *LList::findc( int which ){
++++++ xosview-1.21.tar.gz -> xosview-1.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xosview-1.21/bsd/kernel.cc new/xosview-1.22/bsd/kernel.cc
--- old/xosview-1.21/bsd/kernel.cc 2018-09-12 15:52:23.000000000 +0200
+++ new/xosview-1.22/bsd/kernel.cc 2020-02-22 20:33:08.000000000 +0100
@@ -93,6 +93,9 @@
static int mib_uvm[2] = { CTL_VM, VM_UVMEXP };
#endif
#else
+#if defined(XOSVIEW_FREEBSD)
+#define _WANT_VMMETER
+#endif
#include <sys/vmmeter.h>
#endif
@@ -339,7 +342,9 @@
GET_VM_STATS(v_active_count);
GET_VM_STATS(v_inactive_count);
GET_VM_STATS(v_wire_count);
+#if __FreeBSD_version < 1200017
GET_VM_STATS(v_cache_count);
+#endif
GET_VM_STATS(v_free_count);
GET_VM_STATS(v_page_size);
GET_VM_STATS(v_vnodepgsin);
@@ -361,7 +366,9 @@
meminfo[0] = (uint64_t)vm.v_active_count * vm.v_page_size;
meminfo[1] = (uint64_t)vm.v_inactive_count * vm.v_page_size;
meminfo[2] = (uint64_t)vm.v_wire_count * vm.v_page_size;
+#if __FreeBSD_version < 1200017
meminfo[3] = (uint64_t)vm.v_cache_count * vm.v_page_size;
+#endif
meminfo[4] = (uint64_t)vm.v_free_count * vm.v_page_size;
#else /* XOSVIEW_DFBSD */
meminfo[0] = (uint64_t)vms.v_active_count * vms.v_page_size;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xosview-1.21/linux/serialmeter.cc new/xosview-1.22/linux/serialmeter.cc
--- old/xosview-1.21/linux/serialmeter.cc 2018-09-12 15:52:23.000000000 +0200
+++ new/xosview-1.22/linux/serialmeter.cc 2020-02-22 20:33:08.000000000 +0100
@@ -30,7 +30,7 @@
#endif
#if defined(GNULIBC) || defined(__GLIBC__)
-#if !defined(__powerpc__) && !defined(__hppa__) && !defined(__mips__) && !defined(__sparc__) && !defined(__sh__) && !defined(__s390__) && !defined(__s390x__) && !defined(__m68k__) && !defined(__aarch64__)
+#if !defined(__powerpc__) && !defined(__hppa__) && !defined(__mips__) && !defined(__sparc__) && !defined(__sh__) && !defined(__s390__) && !defined(__s390x__) && !defined(__m68k__) && !defined(__aarch64__) && !defined(__arm__)
#include <sys/io.h>
#endif
#if !defined(__alpha__) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__mips__) && !defined(__sh__) && !defined(__s390__) && !defined (__s390x__) && !defined(__m68k__) && !defined(__aarch64__)
1
0