openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 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
September 2022
- 1 participants
- 2392 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-macholib for openSUSE:Factory checked in at 2022-09-30 17:57:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-macholib (Old)
and /work/SRC/openSUSE:Factory/.python-macholib.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-macholib"
Fri Sep 30 17:57:50 2022 rev:6 rq:1007068 version:1.16
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-macholib/python-macholib.changes 2020-05-26 17:23:24.600502332 +0200
+++ /work/SRC/openSUSE:Factory/.python-macholib.new.2275/python-macholib.changes 2022-09-30 17:58:08.309292738 +0200
@@ -1,0 +2,6 @@
+Thu Sep 29 15:42:05 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- version update to 1.16
+ * Add allow_unknown_load_commands option to MachO and ```macholib.MachOHeader``.
+
+-------------------------------------------------------------------
Old:
----
macholib-1.14.tar.gz
New:
----
macholib-1.16.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-macholib.spec ++++++
--- /var/tmp/diff_new_pack.LT11la/_old 2022-09-30 17:58:08.769293721 +0200
+++ /var/tmp/diff_new_pack.LT11la/_new 2022-09-30 17:58:08.773293729 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-macholib
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-macholib
-Version: 1.14
+Version: 1.16
Release: 0
Summary: Mach-O header analysis and editing
License: MIT
@@ -31,7 +31,7 @@
Requires: python-altgraph >= 0.15
Requires: python-setuptools
Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module altgraph >= 0.15}
++++++ macholib-1.14.tar.gz -> macholib-1.16.tar.gz ++++++
++++ 2310 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-main-wrapper for openSUSE:Factory checked in at 2022-09-30 17:57:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-main-wrapper (Old)
and /work/SRC/openSUSE:Factory/.python-main-wrapper.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-main-wrapper"
Fri Sep 30 17:57:50 2022 rev:2 rq:1007067 version:0.1.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-main-wrapper/python-main-wrapper.changes 2020-08-18 15:04:17.255872829 +0200
+++ /work/SRC/openSUSE:Factory/.python-main-wrapper.new.2275/python-main-wrapper.changes 2022-09-30 17:58:07.605291233 +0200
@@ -1,0 +2,6 @@
+Thu Sep 29 15:44:36 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to version 0.1.1
+ Merge branch 'integration/cli/ci/github-actions' into develop
+
+-------------------------------------------------------------------
Old:
----
main-wrapper-0.1.0.tar.gz
New:
----
main-wrapper-0.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-main-wrapper.spec ++++++
--- /var/tmp/diff_new_pack.SAlRXL/_old 2022-09-30 17:58:08.033292147 +0200
+++ /var/tmp/diff_new_pack.SAlRXL/_new 2022-09-30 17:58:08.037292156 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-main-wrapper
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-main-wrapper
-Version: 0.1.0
+Version: 0.1.1
Release: 0
Summary: Preconfigure Python global environment to run scripts within
License: MIT
@@ -34,7 +34,7 @@
Requires: python-base >= 3.6.6
Requires: python-six
Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module six}
++++++ main-wrapper-0.1.0.tar.gz -> main-wrapper-0.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/.github/workflows/ci-cd.yml new/main-wrapper-0.1.1/.github/workflows/ci-cd.yml
--- old/main-wrapper-0.1.0/.github/workflows/ci-cd.yml 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/.github/workflows/ci-cd.yml 2021-09-21 20:48:32.000000000 +0200
@@ -15,7 +15,7 @@
- name: Add user installs to PATH
run: |
- echo "::add-path::$HOME/.local/bin"
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/Makefile new/main-wrapper-0.1.1/Makefile
--- old/main-wrapper-0.1.0/Makefile 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/Makefile 2021-09-21 20:48:32.000000000 +0200
@@ -20,6 +20,10 @@
test: all format
tox
+.PHONY: test-debug
+test-debug: var/log/tox-recreate.log
+ ./.tox/py3/bin/pytest --pdb
+
.PHONY: upgrade
upgrade: var/log/tox-recreate.log
make -j $(words $(VENVS:%=upgrade-%)) $(VENVS:%=upgrade-%)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/PKG-INFO new/main-wrapper-0.1.1/PKG-INFO
--- old/main-wrapper-0.1.0/PKG-INFO 2020-04-27 14:08:45.000000000 +0200
+++ new/main-wrapper-0.1.1/PKG-INFO 2021-09-21 20:49:11.000000000 +0200
@@ -1,97 +1,11 @@
Metadata-Version: 2.1
Name: main-wrapper
-Version: 0.1.0
+Version: 0.1.1
Summary: Set up global environment and run another script within, ala pdb, profile, etc..
Home-page: https://github.com/rpatterson/python-main-wrapper
Author: Ross Patterson
Author-email: me(a)rpatterson.net
License: MIT
-Description: ==============================================================================
- python-main-wrapper
- ==============================================================================
- Set up global environment and run another script within, ala pdb, profile, etc
- ------------------------------------------------------------------------------
-
- .. image:: https://github.com/rpatterson/python-main-wrapper/workflows/Run%20linter,%2…
-
- Use ``main-wrapper`` either as a command-line script or as a library to make `Python`_
- scripts that set up or change some global Python environment and then run another script
- within that environment. It seeks to combine into one library all the gloss and polish
- of other Python software that does this, such as using ``python -m`` with ``pdb`` and
- ``profile`` in the standard library or the ``coverage`` package's command-line ``run``
- command.
-
-
- Installation
- ============
-
- Install using any tool for installing standard Python 3 distributions such as `pip`_::
-
- $ sudo pip3 install main-wrapper
-
-
- Usage
- =====
-
- You may use this package either as a library in your code that needs to wrap another
- script or as a command-line script.
-
- To use as a library, use the provided decorator to wrap your function that sets up the
- global environment you need the script to be run in::
-
- import logging
- import argparse
-
- import mainwrapper
-
- parser = argparse.ArgumentParser()
- parser.add_argument(
- "--level",
- default="INFO",
- help="The level of messages to log at or above",
- )
-
- @mainwrapper.wrap_main(parser)
- def main(level=parser.get_default("level")):
- """
- As an example, this function will set up logging at level INFO.
- """
- logging.basicConfig(level=getattr(logging, level))
-
- The changes to Python's global execution environment that support running the wrapper
- function and the final script are also cleaned up upon completion, so it should be
- possible to use this library to execute multiple scripts in the same process as if they
- were run independently.
-
- See the command-line help for details the options and arguments for using this package
- as a command-line script::
-
- $ usage: python-main-wrapper [-h] wrapper script
-
- Set up global environment and run another script within, ala pdb, profile, etc.. Both
- script arguments may either be a path to a Python script, a Python module or package
- to be run in the same manner as Python's `-m` option, or a setuptools
- `path.to.import:callable` entry-point.
-
- positional arguments:
- wrapper A Python script that sets up the environment
- script The Python script to run within the wrapper's environment
-
- optional arguments:
- -h, --help show this help message and exit
-
-
- Motivation
- ==========
-
- I found myself writing such wrapper scripts repeatedly over the years and kept
- struggling to remember how I did it last time. I made this package to capture all that
- knowledge and to have one place to put improvements as I discover them.
-
-
- .. _Python: https://docs.python.org/3/library/logging.html
- .. _pip: https://pip.pypa.io/en/stable/installing/
-
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
@@ -105,3 +19,112 @@
Requires-Python: >=2.7
Description-Content-Type: text/x-rst
Provides-Extra: dev
+License-File: LICENSE
+
+==============================================================================
+python-main-wrapper
+==============================================================================
+Set up global environment and run another script within, ala pdb, profile, etc
+------------------------------------------------------------------------------
+
+.. image:: https://github.com/rpatterson/python-main-wrapper/workflows/Run%20linter,%2…
+
+Use ``main-wrapper`` either as a command-line script or as a library to make `Python`_
+scripts that set up or change some global Python environment and then run another script
+within that environment. It seeks to combine into one library all the gloss and polish
+of other Python software that does this, such as using ``python -m`` with ``pdb`` and
+``profile`` in the standard library or the ``coverage`` package's command-line ``run``
+command.
+
+
+Installation
+============
+
+Install using any tool for installing standard Python 3 distributions such as `pip`_::
+
+ $ sudo pip3 install main-wrapper
+
+
+Usage
+=====
+
+You may use this package either as a library in your code that needs to wrap another
+script or as a command-line script.
+
+To use as a library, use the provided decorator to wrap your function that sets up the
+global environment you need the script to be run in::
+
+ import logging
+ import argparse
+
+ import mainwrapper
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--level",
+ default="INFO",
+ help="The level of messages to log at or above",
+ )
+
+ @mainwrapper.wrap_main(parser)
+ def main(level=parser.get_default("level")):
+ """
+ As an example, this function will set up logging at level INFO.
+ """
+ logging.basicConfig(level=getattr(logging, level))
+
+The changes to Python's global execution environment that support running the wrapper
+function and the final script are also cleaned up upon completion, so it should be
+possible to use this library to execute multiple scripts in the same process as if they
+were run independently.
+
+See the command-line help for details the options and arguments for using this package
+as a command-line script::
+
+ $ usage: python-main-wrapper [-h] wrapper script
+
+ Set up global environment and run another script within, ala pdb, profile, etc.. Both
+ script arguments may either be a path to a Python script, a Python module or package
+ to be run in the same manner as Python's `-m` option, or a setuptools
+ `path.to.import:callable` entry-point.
+
+ positional arguments:
+ wrapper A Python script that sets up the environment
+ script The Python script to run within the wrapper's environment
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+Note that this package uses `argparse.ArgumentParser.parse_known_args`_ under the hood
+and as such be sure to use it's support for the ``--`` convention to separate arguments
+and options to be passed to the wrapped script::
+
+ $ python-main-wrapper site site:_script --help
+ ...
+ site.py [--user-base] [--user-site]
+
+ Without arguments print some useful information
+ With arguments print the value of USER_BASE and/or USER_SITE separated
+ by ':'.
+
+ Exit codes with --user-base or --user-site:
+ 0 - user site directory is enabled
+ 1 - user site directory is disabled by user
+ 2 - user site directory is disabled by super user
+ or for security reasons
+ >2 - unknown error
+
+
+Motivation
+==========
+
+I found myself writing such wrapper scripts repeatedly over the years and kept
+struggling to remember how I did it last time. I made this package to capture all that
+knowledge and to have one place to put improvements as I discover them.
+
+
+.. _Python: https://docs.python.org/3/library/logging.html
+.. _pip: https://pip.pypa.io/en/stable/installing/
+.. _argparse.ArgumentParser.parse_known_args: https://docs.python.org/dev/library/argparse.html#argparse.ArgumentParser.p…
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/README.rst new/main-wrapper-0.1.1/README.rst
--- old/main-wrapper-0.1.0/README.rst 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/README.rst 2021-09-21 20:48:32.000000000 +0200
@@ -72,6 +72,25 @@
optional arguments:
-h, --help show this help message and exit
+Note that this package uses `argparse.ArgumentParser.parse_known_args`_ under the hood
+and as such be sure to use it's support for the ``--`` convention to separate arguments
+and options to be passed to the wrapped script::
+
+ $ python-main-wrapper site site:_script --help
+ ...
+ site.py [--user-base] [--user-site]
+
+ Without arguments print some useful information
+ With arguments print the value of USER_BASE and/or USER_SITE separated
+ by ':'.
+
+ Exit codes with --user-base or --user-site:
+ 0 - user site directory is enabled
+ 1 - user site directory is disabled by user
+ 2 - user site directory is disabled by super user
+ or for security reasons
+ >2 - unknown error
+
Motivation
==========
@@ -83,3 +102,4 @@
.. _Python: https://docs.python.org/3/library/logging.html
.. _pip: https://pip.pypa.io/en/stable/installing/
+.. _argparse.ArgumentParser.parse_known_args: https://docs.python.org/dev/library/argparse.html#argparse.ArgumentParser.p…
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/setup.py new/main-wrapper-0.1.1/setup.py
--- old/main-wrapper-0.1.0/setup.py 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/setup.py 2021-09-21 20:48:32.000000000 +0200
@@ -36,10 +36,15 @@
packages=setuptools.find_packages("src"),
package_dir={"": "src"},
use_scm_version=dict(
- write_to="src/mainwrapper/version.py", local_scheme="no-local-version",
+ write_to="src/mainwrapper/version.py",
+ local_scheme="no-local-version",
),
- setup_requires=["setuptools_scm"],
- install_requires=['pathlib2;python_version<"3"'],
+ setup_requires=[
+ 'setuptools_scm;python_version>="3"',
+ # BBB: Python 2.7 compatibility
+ 'setuptools_scm<6;python_version<"3"',
+ ],
+ install_requires=["six", 'pathlib2;python_version<"3"'],
tests_require=tests_require,
extras_require=dict(
dev=tests_require
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/src/main_wrapper.egg-info/PKG-INFO new/main-wrapper-0.1.1/src/main_wrapper.egg-info/PKG-INFO
--- old/main-wrapper-0.1.0/src/main_wrapper.egg-info/PKG-INFO 2020-04-27 14:08:45.000000000 +0200
+++ new/main-wrapper-0.1.1/src/main_wrapper.egg-info/PKG-INFO 2021-09-21 20:49:11.000000000 +0200
@@ -1,97 +1,11 @@
Metadata-Version: 2.1
Name: main-wrapper
-Version: 0.1.0
+Version: 0.1.1
Summary: Set up global environment and run another script within, ala pdb, profile, etc..
Home-page: https://github.com/rpatterson/python-main-wrapper
Author: Ross Patterson
Author-email: me(a)rpatterson.net
License: MIT
-Description: ==============================================================================
- python-main-wrapper
- ==============================================================================
- Set up global environment and run another script within, ala pdb, profile, etc
- ------------------------------------------------------------------------------
-
- .. image:: https://github.com/rpatterson/python-main-wrapper/workflows/Run%20linter,%2…
-
- Use ``main-wrapper`` either as a command-line script or as a library to make `Python`_
- scripts that set up or change some global Python environment and then run another script
- within that environment. It seeks to combine into one library all the gloss and polish
- of other Python software that does this, such as using ``python -m`` with ``pdb`` and
- ``profile`` in the standard library or the ``coverage`` package's command-line ``run``
- command.
-
-
- Installation
- ============
-
- Install using any tool for installing standard Python 3 distributions such as `pip`_::
-
- $ sudo pip3 install main-wrapper
-
-
- Usage
- =====
-
- You may use this package either as a library in your code that needs to wrap another
- script or as a command-line script.
-
- To use as a library, use the provided decorator to wrap your function that sets up the
- global environment you need the script to be run in::
-
- import logging
- import argparse
-
- import mainwrapper
-
- parser = argparse.ArgumentParser()
- parser.add_argument(
- "--level",
- default="INFO",
- help="The level of messages to log at or above",
- )
-
- @mainwrapper.wrap_main(parser)
- def main(level=parser.get_default("level")):
- """
- As an example, this function will set up logging at level INFO.
- """
- logging.basicConfig(level=getattr(logging, level))
-
- The changes to Python's global execution environment that support running the wrapper
- function and the final script are also cleaned up upon completion, so it should be
- possible to use this library to execute multiple scripts in the same process as if they
- were run independently.
-
- See the command-line help for details the options and arguments for using this package
- as a command-line script::
-
- $ usage: python-main-wrapper [-h] wrapper script
-
- Set up global environment and run another script within, ala pdb, profile, etc.. Both
- script arguments may either be a path to a Python script, a Python module or package
- to be run in the same manner as Python's `-m` option, or a setuptools
- `path.to.import:callable` entry-point.
-
- positional arguments:
- wrapper A Python script that sets up the environment
- script The Python script to run within the wrapper's environment
-
- optional arguments:
- -h, --help show this help message and exit
-
-
- Motivation
- ==========
-
- I found myself writing such wrapper scripts repeatedly over the years and kept
- struggling to remember how I did it last time. I made this package to capture all that
- knowledge and to have one place to put improvements as I discover them.
-
-
- .. _Python: https://docs.python.org/3/library/logging.html
- .. _pip: https://pip.pypa.io/en/stable/installing/
-
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
@@ -105,3 +19,112 @@
Requires-Python: >=2.7
Description-Content-Type: text/x-rst
Provides-Extra: dev
+License-File: LICENSE
+
+==============================================================================
+python-main-wrapper
+==============================================================================
+Set up global environment and run another script within, ala pdb, profile, etc
+------------------------------------------------------------------------------
+
+.. image:: https://github.com/rpatterson/python-main-wrapper/workflows/Run%20linter,%2…
+
+Use ``main-wrapper`` either as a command-line script or as a library to make `Python`_
+scripts that set up or change some global Python environment and then run another script
+within that environment. It seeks to combine into one library all the gloss and polish
+of other Python software that does this, such as using ``python -m`` with ``pdb`` and
+``profile`` in the standard library or the ``coverage`` package's command-line ``run``
+command.
+
+
+Installation
+============
+
+Install using any tool for installing standard Python 3 distributions such as `pip`_::
+
+ $ sudo pip3 install main-wrapper
+
+
+Usage
+=====
+
+You may use this package either as a library in your code that needs to wrap another
+script or as a command-line script.
+
+To use as a library, use the provided decorator to wrap your function that sets up the
+global environment you need the script to be run in::
+
+ import logging
+ import argparse
+
+ import mainwrapper
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--level",
+ default="INFO",
+ help="The level of messages to log at or above",
+ )
+
+ @mainwrapper.wrap_main(parser)
+ def main(level=parser.get_default("level")):
+ """
+ As an example, this function will set up logging at level INFO.
+ """
+ logging.basicConfig(level=getattr(logging, level))
+
+The changes to Python's global execution environment that support running the wrapper
+function and the final script are also cleaned up upon completion, so it should be
+possible to use this library to execute multiple scripts in the same process as if they
+were run independently.
+
+See the command-line help for details the options and arguments for using this package
+as a command-line script::
+
+ $ usage: python-main-wrapper [-h] wrapper script
+
+ Set up global environment and run another script within, ala pdb, profile, etc.. Both
+ script arguments may either be a path to a Python script, a Python module or package
+ to be run in the same manner as Python's `-m` option, or a setuptools
+ `path.to.import:callable` entry-point.
+
+ positional arguments:
+ wrapper A Python script that sets up the environment
+ script The Python script to run within the wrapper's environment
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+Note that this package uses `argparse.ArgumentParser.parse_known_args`_ under the hood
+and as such be sure to use it's support for the ``--`` convention to separate arguments
+and options to be passed to the wrapped script::
+
+ $ python-main-wrapper site site:_script --help
+ ...
+ site.py [--user-base] [--user-site]
+
+ Without arguments print some useful information
+ With arguments print the value of USER_BASE and/or USER_SITE separated
+ by ':'.
+
+ Exit codes with --user-base or --user-site:
+ 0 - user site directory is enabled
+ 1 - user site directory is disabled by user
+ 2 - user site directory is disabled by super user
+ or for security reasons
+ >2 - unknown error
+
+
+Motivation
+==========
+
+I found myself writing such wrapper scripts repeatedly over the years and kept
+struggling to remember how I did it last time. I made this package to capture all that
+knowledge and to have one place to put improvements as I discover them.
+
+
+.. _Python: https://docs.python.org/3/library/logging.html
+.. _pip: https://pip.pypa.io/en/stable/installing/
+.. _argparse.ArgumentParser.parse_known_args: https://docs.python.org/dev/library/argparse.html#argparse.ArgumentParser.p…
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/src/main_wrapper.egg-info/requires.txt new/main-wrapper-0.1.1/src/main_wrapper.egg-info/requires.txt
--- old/main-wrapper-0.1.0/src/main_wrapper.egg-info/requires.txt 2020-04-27 14:08:45.000000000 +0200
+++ new/main-wrapper-0.1.1/src/main_wrapper.egg-info/requires.txt 2021-09-21 20:49:11.000000000 +0200
@@ -1,3 +1,4 @@
+six
[:python_version < "3"]
pathlib2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/src/mainwrapper/__init__.py new/main-wrapper-0.1.1/src/mainwrapper/__init__.py
--- old/main-wrapper-0.1.0/src/mainwrapper/__init__.py 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/src/mainwrapper/__init__.py 2021-09-21 20:48:32.000000000 +0200
@@ -88,17 +88,22 @@
# Define command line options and arguments
script_parser = argparse.ArgumentParser(
- description=__doc__.strip(), formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description=__doc__.strip(),
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
script_arg_kwargs = dict(
- type=main_type, help="The Python script to run within the wrapper's environment",
+ type=main_type,
+ help="The Python script to run within the wrapper's environment",
)
script_parser.add_argument("script", **script_arg_kwargs)
cli_parser = argparse.ArgumentParser(
- description=__doc__.strip(), formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description=__doc__.strip(),
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
cli_parser.add_argument(
- "wrapper", type=main_type, help="A Python script that sets up the environment",
+ "wrapper",
+ type=main_type,
+ help="A Python script that sets up the environment",
)
cli_parser.add_argument("script", **script_arg_kwargs)
@@ -141,10 +146,10 @@
sys.argv[0] = code_path.name
sys.argv[1:] = args
- if isinstance(code, types.FunctionType):
+ if isinstance(code, types.FunctionType): # pragma: no cover
return code()
else:
- return six.exec_(code, globals_, globals_)
+ return six.exec_(code, globals_, globals_) # pragma: no cover
finally:
sys.argv[:] = orig_argv
@@ -187,7 +192,12 @@
args, remaining = cli_parser.parse_known_args(args)
wrapper_module_spec, wrapper_code = args.wrapper
- exec_main(wrapper_module_spec, wrapper_code)
+ try:
+ exec_main(wrapper_module_spec, wrapper_code)
+ except SystemExit:
+ # Tolerate the wrapper script using the common `sys.exit(main())` pattern.
+ # Note that wrapper scripts should *not* do this.
+ pass
module_spec, code = args.script # pragma: no cover
return exec_main(module_spec, code, *remaining) # pragma: no cover
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/src/mainwrapper/tests/test_mainwrapper.py new/main-wrapper-0.1.1/src/mainwrapper/tests/test_mainwrapper.py
--- old/main-wrapper-0.1.0/src/mainwrapper/tests/test_mainwrapper.py 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/src/mainwrapper/tests/test_mainwrapper.py 2021-09-21 20:48:32.000000000 +0200
@@ -43,7 +43,18 @@
self.assertIn(
mainwrapper.__doc__.strip().split("\n")[0][:55],
stdout,
- "The console script name missing from --help output",
+ "The console script docstring missing from --help output",
+ )
+
+ wrapped_out_file = six.StringIO()
+ with self.assertRaises(SystemExit):
+ with contextlib.redirect_stdout(wrapped_out_file):
+ mainwrapper.main(args=["site", "site:_script", "--", "--help"])
+ wrapped_out = wrapped_out_file.getvalue()
+ self.assertNotIn(
+ mainwrapper.__doc__.strip().split("\n")[0][:55],
+ wrapped_out,
+ "The console script docstring included in wrapped --help output",
)
def test_cli_options(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/src/mainwrapper/version.py new/main-wrapper-0.1.1/src/mainwrapper/version.py
--- old/main-wrapper-0.1.0/src/mainwrapper/version.py 2020-04-27 14:08:45.000000000 +0200
+++ new/main-wrapper-0.1.1/src/mainwrapper/version.py 2021-09-21 20:49:11.000000000 +0200
@@ -1,4 +1,5 @@
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
-version = '0.1.0'
+version = '0.1.1'
+version_tuple = (0, 1, 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/main-wrapper-0.1.0/tox.ini new/main-wrapper-0.1.1/tox.ini
--- old/main-wrapper-0.1.0/tox.ini 2020-04-27 14:08:00.000000000 +0200
+++ new/main-wrapper-0.1.1/tox.ini 2021-09-21 20:48:32.000000000 +0200
@@ -2,6 +2,7 @@
envlist = lint, py3, py2
[testenv]
+usedevelop = true
extras = dev
commands =
coverage run -m pytest -s
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-makefun for openSUSE:Factory checked in at 2022-09-30 17:57:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-makefun (Old)
and /work/SRC/openSUSE:Factory/.python-makefun.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-makefun"
Fri Sep 30 17:57:49 2022 rev:3 rq:1007066 version:1.14.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-makefun/python-makefun.changes 2021-12-16 21:20:55.398558020 +0100
+++ /work/SRC/openSUSE:Factory/.python-makefun.new.2275/python-makefun.changes 2022-09-30 17:58:06.945289822 +0200
@@ -1,0 +2,21 @@
+Thu Sep 29 15:46:07 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to Version 1.15.0
+ More PEP-compliant `wraps` Latest
+ wraps now always sets the __wrapped__ attribute, and also sets the __signature__ attribute when the signature changes,
+ as specified by PEP 362. PR by #86 by lucaswiman.
+
+- Update to Version 1.14.0
+ Support for lambda functions
+ create_wrapper, create_function, wraps and with_signature now support lambda functions. They also accept a new parameter
+ co_name to define the name to be used in the compiled code. PR #80 by andrewcleveland.
+
+- Update to Version 1.13.1
+ - Fixed regression with generators in python 3.5
+ - Fixed an issue where using partial on a generator function in python 3.5 was raising a SyntaxError. Fixed #79
+
+- Update to Version 1.13.0
+ - Support for async generator functions
+ async generator functions are now supported (See PEP525). Fixed #77. PR#78 by broglep-work.
+
+-------------------------------------------------------------------
Old:
----
makefun-1.12.1.tar.gz
New:
----
makefun-1.14.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-makefun.spec ++++++
--- /var/tmp/diff_new_pack.XQ6H6C/_old 2022-09-30 17:58:07.365290720 +0200
+++ /var/tmp/diff_new_pack.XQ6H6C/_new 2022-09-30 17:58:07.373290737 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-makefun
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-makefun
-Version: 1.12.1
+Version: 1.14.0
Release: 0
License: BSD-3-Clause
Summary: Small library to dynamically create python functions
++++++ makefun-1.12.1.tar.gz -> makefun-1.14.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/LICENSE new/makefun-1.14.0/LICENSE
--- old/makefun-1.12.1/LICENSE 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/LICENSE 2022-06-21 23:26:54.000000000 +0200
@@ -1,6 +1,6 @@
BSD 3-Clause License
-Copyright (c) 2019-2020, Sylvain Mari��, Schneider Electric Industries
+Copyright (c) 2019-2022, Sylvain Mari��, Schneider Electric Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/PKG-INFO new/makefun-1.14.0/PKG-INFO
--- old/makefun-1.12.1/PKG-INFO 2021-10-08 12:13:06.000000000 +0200
+++ new/makefun-1.14.0/PKG-INFO 2022-06-21 23:27:52.000000000 +0200
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: makefun
-Version: 1.12.1
+Version: 1.14.0
Summary: Small library to dynamically create python functions.
Home-page: https://github.com/smarie/python-makefun
+Download-URL: https://github.com/smarie/python-makefun/tarball/1.14.0
Author: Sylvain MARIE <sylvain.marie(a)se.com>
Maintainer: Sylvain MARIE <sylvain.marie(a)se.com>
License: BSD 3-Clause
-Download-URL: https://github.com/smarie/python-makefun/tarball/1.12.1
Keywords: decorate decorator compile make dynamic function generate generation define definition signature args wrapper wraps
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/ci_tools/flake8-requirements.txt new/makefun-1.14.0/ci_tools/flake8-requirements.txt
--- old/makefun-1.12.1/ci_tools/flake8-requirements.txt 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/ci_tools/flake8-requirements.txt 2022-06-21 23:26:54.000000000 +0200
@@ -2,6 +2,7 @@
flake8>=3.6,<4
flake8-html>=0.4,<1
flake8-bandit>=2.1.1,<3
+bandit<1.7.3 # temporary until this is fixed https://github.com/tylerwince/flake8-bandit/issues/21
flake8-bugbear>=20.1.0,<21.0.0
flake8-docstrings>=1.5,<2
flake8-print>=3.1.1,<4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/docs/api_reference.md new/makefun-1.14.0/docs/api_reference.md
--- old/makefun-1.12.1/docs/api_reference.md 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/docs/api_reference.md 2022-06-21 23:26:54.000000000 +0200
@@ -15,6 +15,7 @@
add_impl: bool = True,
doc: str = None,
qualname: str = None,
+ co_name: str = None,
module_name: str = None,
**attrs):
```
@@ -34,12 +35,18 @@
- `__annotations__` attribute is created to match the annotations in the signature.
- `__doc__` attribute is copied from `func_impl.__doc__` except if overridden using `doc`
- `__module__` attribute is copied from `func_impl.__module__` except if overridden using `module_name`
+ - `__code__.co_name` (see above) defaults to the same value as the above `__name__` attribute, except when that value is not a valid Python identifier, in which case it will be `<lambda>`. It can be overridden by providing a `co_name` that is either a valid Python identifier or `<lambda>`.
Finally two new attributes are optionally created
- `__source__` attribute: set if `add_source` is `True` (default), this attribute contains the source code of the generated function
- `__func_impl__` attribute: set if `add_impl` is `True` (default), this attribute contains a pointer to `func_impl`
+A lambda function will be created in the following cases:
+
+- when `func_signature` is a `Signature` object and `func_impl` is itself a lambda function,
+- when the function name, either derived from a `func_signature` string, or given explicitly with `func_name`, is not a valid Python identifier, or
+- when the provided `co_name` is `<lambda>`.
**Parameters:**
@@ -58,7 +65,9 @@
* `doc`: a string representing the docstring that will be used to set the __doc__ attribute on the generated function. If None (default), the doc of func_impl will be used.
* `qualname`: a string representing the qualified name to be used. If None (default), the `__qualname__` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
-
+
+ * `co_name`: a string representing the name to be used in the compiled code of the function. If None (default), the `__code__.co_name` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
+
* `module_name`: the name of the module to be set on the function (under __module__ ). If None (default), `func_impl.__module__` will be used.
* `attrs`: other keyword attributes that should be set on the function. Note that `func_impl.__dict__` is not automatically copied.
@@ -73,6 +82,7 @@
add_impl: bool = True,
doc: str = None,
qualname: str = None,
+ co_name: str = None,
module_name: str = None,
**attrs
):
@@ -104,7 +114,9 @@
* `doc`: a string representing the docstring that will be used to set the __doc__ attribute on the generated function. If None (default), the doc of the decorated function will be used.
* `qualname`: a string representing the qualified name to be used. If None (default), the `__qualname__` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
-
+
+ * `co_name`: a string representing the name to be used in the compiled code of the function. If None (default), the `__code__.co_name` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
+
* `module_name`: the name of the module to be set on the function (under __module__ ). If None (default), the `__module__` attribute of the decorated function will be used.
* `attrs`: other keyword attributes that should be set on the function. Note that the full `__dict__` of the decorated function is not automatically copied.
@@ -124,6 +136,7 @@
add_impl: bool = True,
doc: str = None,
qualname: str = None,
+ co_name: str = None,
module_name: str = None,
**attrs
):
@@ -180,7 +193,9 @@
- `doc`: a string representing the docstring that will be used to set the __doc__ attribute on the generated function. If None (default), the doc of `wrapped_fun` will be used. If `wrapped_fun` is an instance of `functools.partial`, a special enhanced doc will be generated.
- `qualname`: a string representing the qualified name to be used. If None (default), the `__qualname__` will default to the one of `wrapped_fun`, or the one in `new_sig` if `new_sig` is provided as a string with a non-empty function name.
-
+
+ - `co_name`: a string representing the name to be used in the compiled code of the function. If None (default), the `__code__.co_name` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
+
- `module_name`: the name of the module to be set on the function (under __module__ ). If None (default), the `__module__` attribute of `wrapped_fun` will be used.
- `attrs`: other keyword attributes that should be set on the function. Note that the full `__dict__` of `wrapped_fun` is automatically copied.
@@ -201,6 +216,7 @@
add_impl: bool = True,
doc: str = None,
qualname: str = None,
+ co_name: str = None,
module_name: str = None,
**attrs
):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/docs/changelog.md new/makefun-1.14.0/docs/changelog.md
--- old/makefun-1.12.1/docs/changelog.md 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/docs/changelog.md 2022-06-21 23:26:54.000000000 +0200
@@ -1,5 +1,17 @@
# Changelog
+### 1.14.0 - Support for lambda functions
+
+ - `create_wrapper`, `create_function`, `wraps` and `with_signature` now support lambda functions. They also accept a new parameter `co_name` to define the name to be used in the compiled code. PR [#80](https://github.com/smarie/python-makefun/pull/80) by [andrewcleveland](https://github.com/andrewcleveland).
+
+### 1.13.1 - Fixed regression with generators in python 3.5
+
+ - Fixed an issue where using `partial` on a generator function in python 3.5 was raising a `SyntaxError`. Fixed [#79](https://github.com/smarie/python-makefun/issues/79)
+
+### 1.13.0 - Support for async generator functions
+
+ - async generator functions are now supported (See [PEP525](https://www.python.org/dev/peps/pep-0525/)) Fixed [#77](https://github.com/smarie/python-makefun/issues/77). [PR#78](https://github.com/smarie/python-makefun/pull/78) by [broglep-work](https://github.com/broglep-work).
+
### 1.12.1 - Bugfix
- Fixed `TypeError` when a `func` attribute is present on the function provided to `create_function`. Fixed [#76](https://github.com/smarie/python-makefun/issues/76)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/noxfile.py new/makefun-1.14.0/noxfile.py
--- old/makefun-1.12.1/noxfile.py 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/noxfile.py 2022-06-21 23:26:54.000000000 +0200
@@ -103,19 +103,22 @@
# Fail if the assumed python version is not the actual one
session.run2("python ci_tools/check_python_version.py %s" % session.python)
- # install self so that it is recognized by pytest
- session.run2("pip install -e . --no-deps")
- # session.install("-e", ".", "--no-deps")
-
# check that it can be imported even from a different folder
# Important: do not surround the command into double quotes as in the shell !
- session.run('python', '-c', 'import os; os.chdir(\'./docs/\'); import %s' % pkg_name)
+ # session.run('python', '-c', 'import os; os.chdir(\'./docs/\'); import %s' % pkg_name)
# finally run all tests
if not coverage:
+ # install self so that it is recognized by pytest
+ session.run2("pip install . --no-deps")
+ # session.install(".", "--no-deps")
+
# simple: pytest only
session.run2("python -m pytest --cache-clear -v tests/")
else:
+ # install self in "develop" mode so that coverage can be measured
+ session.run2("pip install -e . --no-deps")
+
# coverage + junit html reports + badge generation
session.install_reqs(phase="coverage",
phase_reqs=["coverage", "pytest-html", "genbadge[tests,coverage]"],
@@ -144,7 +147,7 @@
session.install("-r", str(Folders.ci_tools / "flake8-requirements.txt"))
session.install("genbadge[flake8]")
- session.run2("pip install -e .[flake8]")
+ session.run2("pip install .")
rm_folder(Folders.flake8_reports)
Folders.flake8_reports.mkdir(parents=True, exist_ok=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun/_main_latest_py.py new/makefun-1.14.0/src/makefun/_main_latest_py.py
--- old/makefun-1.12.1/src/makefun/_main_latest_py.py 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/src/makefun/_main_latest_py.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,24 +0,0 @@
-# Authors: Sylvain MARIE <sylvain.marie(a)se.com>
-# + All contributors to <https://github.com/smarie/python-makefun>
-#
-# License: 3-clause BSD, <https://github.com/smarie/python-makefun/blob/master/LICENSE>
-from itertools import chain
-
-from makefun.main import wraps
-
-
-def make_partial_using_yield_from(new_sig, f, *preset_pos_args, **preset_kwargs):
- """
- Makes a 'partial' when f is a generator and python is new enough to support `yield from`
-
- :param new_sig:
- :param f:
- :param presets:
- :return:
- """
- @wraps(f, new_sig)
- def partial_f(*args, **kwargs):
- # since the signature does the checking for us, no need to check for redundancy.
- kwargs.update(preset_kwargs) # for python 3.4: explicit dict update
- yield from f(*chain(preset_pos_args, args), **kwargs)
- return partial_f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun/_main_py35_and_higher.py new/makefun-1.14.0/src/makefun/_main_py35_and_higher.py
--- old/makefun-1.12.1/src/makefun/_main_py35_and_higher.py 1970-01-01 01:00:00.000000000 +0100
+++ new/makefun-1.14.0/src/makefun/_main_py35_and_higher.py 2022-06-21 23:26:54.000000000 +0200
@@ -0,0 +1,24 @@
+# Authors: Sylvain MARIE <sylvain.marie(a)se.com>
+# + All contributors to <https://github.com/smarie/python-makefun>
+#
+# License: 3-clause BSD, <https://github.com/smarie/python-makefun/blob/master/LICENSE>
+from itertools import chain
+
+from makefun.main import wraps
+
+
+def make_partial_using_yield_from(new_sig, f, *preset_pos_args, **preset_kwargs):
+ """
+ Makes a 'partial' when f is a generator and python is new enough to support `yield from`
+
+ :param new_sig:
+ :param f:
+ :param presets:
+ :return:
+ """
+ @wraps(f, new_sig)
+ def partial_f(*args, **kwargs):
+ # since the signature does the checking for us, no need to check for redundancy.
+ kwargs.update(preset_kwargs) # for python 3.4: explicit dict update
+ yield from f(*chain(preset_pos_args, args), **kwargs)
+ return partial_f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun/_main_py36_and_higher.py new/makefun-1.14.0/src/makefun/_main_py36_and_higher.py
--- old/makefun-1.12.1/src/makefun/_main_py36_and_higher.py 1970-01-01 01:00:00.000000000 +0100
+++ new/makefun-1.14.0/src/makefun/_main_py36_and_higher.py 2022-06-21 23:26:54.000000000 +0200
@@ -0,0 +1,26 @@
+# Authors: Sylvain MARIE <sylvain.marie(a)se.com>
+# + All contributors to <https://github.com/smarie/python-makefun>
+#
+# License: 3-clause BSD, <https://github.com/smarie/python-makefun/blob/master/LICENSE>
+from itertools import chain
+
+from makefun.main import wraps
+
+
+def make_partial_using_async_for_in_yield(new_sig, f, *preset_pos_args, **preset_kwargs):
+ """
+ Makes a 'partial' when f is a async generator and python is new enough to support `async for v in f(): yield v`
+
+ :param new_sig:
+ :param f:
+ :param presets:
+ :return:
+ """
+
+ @wraps(f, new_sig=new_sig)
+ async def partial_f(*args, **kwargs):
+ kwargs.update(preset_kwargs)
+ async for v in f(*chain(preset_pos_args, args), **kwargs):
+ yield v
+
+ return partial_f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun/_version.py new/makefun-1.14.0/src/makefun/_version.py
--- old/makefun-1.12.1/src/makefun/_version.py 2021-10-08 12:13:06.000000000 +0200
+++ new/makefun-1.14.0/src/makefun/_version.py 2022-06-21 23:27:51.000000000 +0200
@@ -1,5 +1,5 @@
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
-version = '1.12.1'
-version_tuple = (1, 12, 1)
+__version__ = version = '1.14.0'
+__version_tuple__ = version_tuple = (1, 14, 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun/main.py new/makefun-1.14.0/src/makefun/main.py
--- old/makefun-1.12.1/src/makefun/main.py 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/src/makefun/main.py 2022-06-21 23:26:54.000000000 +0200
@@ -11,9 +11,24 @@
from collections import OrderedDict
from copy import copy
from inspect import getsource
+from keyword import iskeyword
from textwrap import dedent
from types import FunctionType
+
+if sys.version_info >= (3, 0):
+ is_identifier = str.isidentifier
+else:
+ def is_identifier(string):
+ """
+ Replacement for `str.isidentifier` when it is not available (e.g. on Python 2).
+ :param string:
+ :return:
+ """
+ if len(string) == 0 or string[0].isdigit():
+ return False
+ return all([s.isalnum() for s in string.split("_")])
+
try: # python 3.3+
from inspect import signature, Signature, Parameter
except ImportError:
@@ -33,6 +48,13 @@
def isgeneratorfunction(f):
return False
+try:
+ from inspect import isasyncgenfunction
+except ImportError:
+ # assume no generator function in old Python versions
+ def isasyncgenfunction(f):
+ return False
+
try: # python 3.5+
from typing import Callable, Any, Union, Iterable, Dict, Tuple, Mapping
except ImportError:
@@ -66,6 +88,7 @@
add_impl=True, # type: bool
doc=None, # type: str
qualname=None, # type: str
+ co_name=None, # type: str
module_name=None, # type: str
**attrs
):
@@ -77,7 +100,8 @@
"""
return wraps(wrapped, new_sig=new_sig, prepend_args=prepend_args, append_args=append_args, remove_args=remove_args,
func_name=func_name, inject_as_first_arg=inject_as_first_arg, add_source=add_source,
- add_impl=add_impl, doc=doc, qualname=qualname, module_name=module_name, **attrs)(wrapper)
+ add_impl=add_impl, doc=doc, qualname=qualname, module_name=module_name, co_name=co_name,
+ **attrs)(wrapper)
def getattr_partial_aware(obj, att_name, *att_default):
@@ -99,6 +123,7 @@
add_impl=True, # type: bool
doc=None, # type: str
qualname=None, # type: str
+ co_name=None, # type: str
module_name=None, # type: str
**attrs):
"""
@@ -123,6 +148,9 @@
- `__annotations__` attribute is created to match the annotations in the signature.
- `__doc__` attribute is copied from `func_impl.__doc__` except if overridden using `doc`
- `__module__` attribute is copied from `func_impl.__module__` except if overridden using `module_name`
+ - `__code__.co_name` (see above) defaults to the same value as the above `__name__` attribute, except when that
+ value is not a valid Python identifier, in which case it will be `<lambda>`. It can be overridden by providing
+ a `co_name` that is either a valid Python identifier or `<lambda>`.
Finally two new attributes are optionally created
@@ -131,6 +159,13 @@
- `__func_impl__` attribute: set if `add_impl` is `True` (default), this attribute contains a pointer to
`func_impl`
+ A lambda function will be created in the following cases:
+
+ - when `func_signature` is a `Signature` object and `func_impl` is itself a lambda function,
+ - when the function name, either derived from a `func_signature` string, or given explicitly with `func_name`,
+ is not a valid Python identifier, or
+ - when the provided `co_name` is `<lambda>`.
+
:param func_signature: either a string without 'def' such as "foo(a, b: int, *args, **kwargs)" or "(a, b: int)",
or a `Signature` object, for example from the output of `inspect.signature` or from the `funcsigs.signature`
backport. Note that these objects can be created manually too. If the signature is provided as a string and
@@ -152,6 +187,9 @@
:param qualname: a string representing the qualified name to be used. If None (default), the `__qualname__` will
default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in
`func_signature` if `func_signature` is a `str` and contains a non-empty name.
+ :param co_name: a string representing the name to be used in the compiled code of the function. If None (default),
+ the `__code__.co_name` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the
+ name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
:param module_name: the name of the module to be set on the function (under __module__ ). If None (default),
`func_impl.__module__` will be used.
:param attrs: other keyword attributes that should be set on the function. Note that `func_impl.__dict__` is not
@@ -170,10 +208,24 @@
# name defaults
user_provided_name = True
if func_name is None:
- # allow None for now, we'll raise a ValueError later if needed
+ # allow None, this will result in a lambda function being created
func_name = getattr_partial_aware(func_impl, '__name__', None)
user_provided_name = False
+ # co_name default
+ user_provided_co_name = co_name is not None
+ if not user_provided_co_name:
+ if func_name is None:
+ co_name = '<lambda>'
+ else:
+ co_name = func_name
+ else:
+ if not (_is_valid_func_def_name(co_name)
+ or _is_lambda_func_name(co_name)):
+ raise ValueError("Invalid co_name %r for created function. "
+ "It is not possible to declare a function "
+ "with the provided co_name." % co_name)
+
# qname default
user_provided_qname = True
if qualname is None:
@@ -201,25 +253,28 @@
func_name = func_name_from_str
if not user_provided_qname:
qualname = func_name
+ if not user_provided_co_name:
+ co_name = func_name
+
+ create_lambda = not _is_valid_func_def_name(co_name)
+ # if lambda, strip the name, parentheses and colon from the signature
+ if create_lambda:
+ name_len = len(func_name_from_str) if func_name_from_str else 0
+ func_signature_str = func_signature_str[name_len + 1: -2]
# fix the signature if needed
- if func_name_from_str is None:
- if func_name is None:
- raise ValueError("Invalid signature for created function: `None` function name. This "
- "probably happened because the decorated function %s has no __name__. You may "
- "wish to pass an explicit `func_name` or to complete the signature string"
- "with the name before the parenthesis." % func_impl)
- func_signature_str = func_name + func_signature_str
+ elif func_name_from_str is None:
+ func_signature_str = co_name + func_signature_str
elif isinstance(func_signature, Signature):
# create the signature string
- if func_name is None:
- raise ValueError("Invalid signature for created function: `None` function name. This "
- "probably happened because the decorated function %s has no __name__. You may "
- "wish to pass an explicit `func_name` or to provide the new signature as a "
- "string containing the name" % func_impl)
- func_signature_str = get_signature_string(func_name, func_signature, evaldict)
+ create_lambda = not _is_valid_func_def_name(co_name)
+ if create_lambda:
+ # create signature string (or argument string in the case of a lambda function
+ func_signature_str = get_lambda_argument_string(func_signature, evaldict)
+ else:
+ func_signature_str = get_signature_string(co_name, func_signature, evaldict)
else:
raise TypeError("Invalid type for `func_signature`: %s" % type(func_signature))
@@ -246,6 +301,13 @@
else:
from makefun._main_legacy_py import get_legacy_py_generator_body_template
body = get_legacy_py_generator_body_template() % (func_signature_str, params_str)
+ elif isasyncgenfunction(func_impl):
+ body = "async def %s\n async for y in _func_impl_(%s):\n yield y\n" % (func_signature_str, params_str)
+ elif create_lambda:
+ if func_signature_str:
+ body = "lambda_ = lambda %s: _func_impl_(%s)\n" % (func_signature_str, params_str)
+ else:
+ body = "lambda_ = lambda: _func_impl_(%s)\n" % (params_str)
else:
body = "def %s\n return _func_impl_(%s)\n" % (func_signature_str, params_str)
@@ -255,7 +317,10 @@
# create the function by compiling code, mapping the `_func_impl_` symbol to `func_impl`
protect_eval_dict(evaldict, func_name, params_names)
evaldict['_func_impl_'] = func_impl
- f = _make(func_name, params_names, body, evaldict)
+ if create_lambda:
+ f = _make("lambda_", params_names, body, evaldict)
+ else:
+ f = _make(co_name, params_names, body, evaldict)
# add the source annotation if needed
if add_source:
@@ -288,6 +353,24 @@
return isgeneratorfunction(func_impl)
+def _is_lambda_func_name(func_name):
+ """
+ Return True if func_name is the name of a lambda
+ :param func_name:
+ :return:
+ """
+ return func_name == (lambda: None).__code__.co_name
+
+
+def _is_valid_func_def_name(func_name):
+ """
+ Return True if func_name is valid in a function definition.
+ :param func_name:
+ :return:
+ """
+ return is_identifier(func_name) and not iskeyword(func_name)
+
+
class _SymbolRef:
"""
A class used to protect signature default values and type hints when the local context would not be able
@@ -357,6 +440,17 @@
return "%s%s:" % (func_name, s)
+def get_lambda_argument_string(func_signature, evaldict):
+ """
+ Returns the string to be used as arguments in a lambda function definition.
+ If there is a non-native symbol in the defaults, it is created as a variable in the evaldict
+ :param func_name:
+ :param func_signature:
+ :return:
+ """
+ return get_signature_string('', func_signature, evaldict)[1:-2]
+
+
TYPES_WITH_SAFE_REPR = (int, str, bytes, bool)
# IMPORTANT note: float is not in the above list because not all floats have a repr that is valid for the
# compiler: float('nan'), float('-inf') and float('inf') or float('+inf') have an invalid repr.
@@ -685,6 +779,7 @@
append_args=None, # type: Union[str, Parameter, Iterable[Union[str, Parameter]]]
remove_args=None, # type: Union[str, Iterable[str]]
func_name=None, # type: str
+ co_name=None, # type: str
inject_as_first_arg=False, # type: bool
add_source=True, # type: bool
add_impl=True, # type: bool
@@ -765,17 +860,22 @@
:param qualname: a string representing the qualified name to be used. If None (default), the `__qualname__` will
default to the one of `wrapped_fun`, or the one in `new_sig` if `new_sig` is provided as a string with a
non-empty function name.
+ :param co_name: a string representing the name to be used in the compiled code of the function. If None (default),
+ the `__code__.co_name` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the
+ name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
:param module_name: the name of the module to be set on the function (under __module__ ). If None (default), the
`__module__` attribute of `wrapped_fun` will be used.
:param attrs: other keyword attributes that should be set on the function. Note that the full `__dict__` of
`wrapped_fun` is automatically copied.
:return: a decorator
"""
- func_name, func_sig, doc, qualname, module_name, all_attrs = _get_args_for_wrapping(wrapped_fun, new_sig,
- remove_args,
- prepend_args, append_args,
- func_name, doc,
- qualname, module_name, attrs)
+ func_name, func_sig, doc, qualname, co_name, module_name, all_attrs = _get_args_for_wrapping(wrapped_fun, new_sig,
+ remove_args,
+ prepend_args,
+ append_args,
+ func_name, doc,
+ qualname, co_name,
+ module_name, attrs)
return with_signature(func_sig,
func_name=func_name,
@@ -783,12 +883,13 @@
add_source=add_source, add_impl=add_impl,
doc=doc,
qualname=qualname,
+ co_name=co_name,
module_name=module_name,
**all_attrs)
def _get_args_for_wrapping(wrapped, new_sig, remove_args, prepend_args, append_args,
- func_name, doc, qualname, module_name, attrs):
+ func_name, doc, qualname, co_name, module_name, attrs):
"""
Internal method used by @wraps and create_wrapper
@@ -800,6 +901,7 @@
:param func_name:
:param doc:
:param qualname:
+ :param co_name:
:param module_name:
:param attrs:
:return:
@@ -851,6 +953,10 @@
qualname = getattr_partial_aware(wrapped, '__qualname__', None)
if module_name is None:
module_name = getattr_partial_aware(wrapped, '__module__', None)
+ if co_name is None:
+ code = getattr_partial_aware(wrapped, '__code__', None)
+ if code is not None:
+ co_name = code.co_name
# attributes: start from the wrapped dict, add '__wrapped__' if needed, and override with all attrs.
all_attrs = copy(getattr_partial_aware(wrapped, '__dict__'))
@@ -865,7 +971,7 @@
all_attrs['__wrapped__'] = wrapped
all_attrs.update(attrs)
- return func_name, func_sig, doc, qualname, module_name, all_attrs
+ return func_name, func_sig, doc, qualname, co_name, module_name, all_attrs
def with_signature(func_signature, # type: Union[str, Signature]
@@ -875,6 +981,7 @@
add_impl=True, # type: bool
doc=None, # type: str
qualname=None, # type: str
+ co_name=None, # type: str
module_name=None, # type: str
**attrs
):
@@ -916,12 +1023,15 @@
:param qualname: a string representing the qualified name to be used. If None (default), the `__qualname__` will
default to the one of `func_impl` if `func_signature` is a `Signature`, or to the name defined in
`func_signature` if `func_signature` is a `str` and contains a non-empty name.
+ :param co_name: a string representing the name to be used in the compiled code of the function. If None (default),
+ the `__code__.co_name` will default to the one of `func_impl` if `func_signature` is a `Signature`, or to the
+ name defined in `func_signature` if `func_signature` is a `str` and contains a non-empty name.
:param module_name: the name of the module to be set on the function (under __module__ ). If None (default), the
`__module__` attribute of the decorated function will be used.
:param attrs: other keyword attributes that should be set on the function. Note that the full `__dict__` of the
decorated function is not automatically copied.
"""
- if func_signature is None:
+ if func_signature is None and co_name is None:
# make sure that user does not provide non-default other args
if inject_as_first_arg or not add_source or not add_impl:
raise ValueError("If `func_signature=None` no new signature will be generated so only `func_name`, "
@@ -950,6 +1060,7 @@
add_impl=add_impl,
doc=doc,
qualname=qualname,
+ co_name=co_name,
module_name=module_name,
_with_sig_=True, # special trick to tell create_function that we're @with_signature
**attrs
@@ -1118,11 +1229,14 @@
if _is_generator_func(f):
if sys.version_info >= (3, 3):
- from makefun._main_latest_py import make_partial_using_yield_from
+ from makefun._main_py35_and_higher import make_partial_using_yield_from
partial_f = make_partial_using_yield_from(new_sig, f, *preset_pos_args, **preset_kwargs)
else:
from makefun._main_legacy_py import make_partial_using_yield
partial_f = make_partial_using_yield(new_sig, f, *preset_pos_args, **preset_kwargs)
+ elif isasyncgenfunction(f) and sys.version_info >= (3, 6):
+ from makefun._main_py36_and_higher import make_partial_using_async_for_in_yield
+ partial_f = make_partial_using_async_for_in_yield(new_sig, f, *preset_pos_args, **preset_kwargs)
else:
@wraps(f, new_sig=new_sig)
def partial_f(*args, **kwargs):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun.egg-info/PKG-INFO new/makefun-1.14.0/src/makefun.egg-info/PKG-INFO
--- old/makefun-1.12.1/src/makefun.egg-info/PKG-INFO 2021-10-08 12:13:06.000000000 +0200
+++ new/makefun-1.14.0/src/makefun.egg-info/PKG-INFO 2022-06-21 23:27:52.000000000 +0200
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: makefun
-Version: 1.12.1
+Version: 1.14.0
Summary: Small library to dynamically create python functions.
Home-page: https://github.com/smarie/python-makefun
+Download-URL: https://github.com/smarie/python-makefun/tarball/1.14.0
Author: Sylvain MARIE <sylvain.marie(a)se.com>
Maintainer: Sylvain MARIE <sylvain.marie(a)se.com>
License: BSD 3-Clause
-Download-URL: https://github.com/smarie/python-makefun/tarball/1.12.1
Keywords: decorate decorator compile make dynamic function generate generation define definition signature args wrapper wraps
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/src/makefun.egg-info/SOURCES.txt new/makefun-1.14.0/src/makefun.egg-info/SOURCES.txt
--- old/makefun-1.12.1/src/makefun.egg-info/SOURCES.txt 2021-10-08 12:13:06.000000000 +0200
+++ new/makefun-1.14.0/src/makefun.egg-info/SOURCES.txt 2022-06-21 23:27:52.000000000 +0200
@@ -18,8 +18,9 @@
docs/index.md
docs/long_description.md
src/makefun/__init__.py
-src/makefun/_main_latest_py.py
src/makefun/_main_legacy_py.py
+src/makefun/_main_py35_and_higher.py
+src/makefun/_main_py36_and_higher.py
src/makefun/_version.py
src/makefun/main.py
src/makefun/py.typed
@@ -31,6 +32,7 @@
src/makefun.egg-info/top_level.txt
tests/__init__.py
tests/_test_py35.py
+tests/_test_py36.py
tests/_test_py38.py
tests/test_advanced.py
tests/test_compile_deco.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/tests/_test_py36.py new/makefun-1.14.0/tests/_test_py36.py
--- old/makefun-1.12.1/tests/_test_py36.py 1970-01-01 01:00:00.000000000 +0100
+++ new/makefun-1.14.0/tests/_test_py36.py 2022-06-21 23:26:54.000000000 +0200
@@ -0,0 +1,17 @@
+def make_async_generator():
+ """Returns a new async generator function to use in tests."""
+
+ async def f(v):
+ yield v
+
+ return f
+
+
+def make_async_generator_wrapper(async_gen_f):
+ """Returns a new async generator function wrapping `f`, to use in tests."""
+
+ async def wrapper(*args, **kwargs):
+ async for v in async_gen_f(*args, **kwargs):
+ yield v
+
+ return wrapper
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/tests/test_advanced.py new/makefun-1.14.0/tests/test_advanced.py
--- old/makefun-1.12.1/tests/test_advanced.py 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/tests/test_advanced.py 2022-06-21 23:26:54.000000000 +0200
@@ -5,7 +5,7 @@
from makefun.main import get_signature_from_string, with_signature
-from makefun import wraps
+from makefun import create_wrapper, wraps
try: # python 3.3+
from inspect import signature, Signature, Parameter
@@ -108,6 +108,96 @@
assert goo('hello') == 'hello'
+def tests_wraps_lambda():
+ """ Tests that `@wraps` can duplicate the signature of a lambda """
+ foo = lambda a: a
+
+ @wraps(foo)
+ def goo(*args, **kwargs):
+ return foo(*args, **kwargs)
+
+ assert goo.__name__ == (lambda: None).__name__
+ assert str(signature(goo)) == '(a)'
+ assert goo('hello') == 'hello'
+
+
+def tests_wraps_renamed_lambda():
+ """ Tests that `@wraps` can duplicate the signature of a lambda that has been renamed """
+ foo = lambda a: a
+ foo.__name__ = 'bar'
+
+ @wraps(foo)
+ def goo(*args, **kwargs):
+ return foo(*args, **kwargs)
+
+ assert goo.__name__ == 'bar'
+ assert str(signature(goo)) == '(a)'
+ assert goo('hello') == 'hello'
+
+
+def test_lambda_signature_str():
+ """ Tests that `@with_signature` can create a lambda from a signature string """
+ new_sig = '(a, b=5)'
+
+ @with_signature(new_sig, func_name='<lambda>')
+ def foo(a, b):
+ return a + b
+
+ assert foo.__name__ == '<lambda>'
+ assert foo.__code__.co_name == '<lambda>'
+ assert str(signature(foo)) == new_sig
+ assert foo(a=4) == 9
+
+
+def test_co_name():
+ """ Tests that `@with_signature` can be used to change the __code__.co_name """
+ @with_signature('()', co_name='bar')
+ def foo():
+ return 'hello'
+
+ assert foo.__name__ == 'foo'
+ assert foo.__code__.co_name == 'bar'
+ assert foo() == 'hello'
+
+
+def test_with_signature_lambda():
+ """ Tests that `@with_signature` can be used to change the __code__.co_name to `'<lambda>'` """
+ @with_signature('()', co_name='<lambda>')
+ def foo():
+ return 'hello'
+
+ assert foo.__code__.co_name == '<lambda>'
+ assert foo() == 'hello'
+
+
+def test_create_wrapper_lambda():
+ """ Tests that `create_wrapper` returns a lambda function when given a lambda function to wrap"""
+ def foo():
+ return 'hello'
+ bar = create_wrapper(lambda: None, foo)
+
+ assert bar.__name__ == '<lambda>'
+ assert bar() == 'hello'
+
+
+def test_invalid_co_name():
+ """ Tests that `@with_signature` raises a `ValueError` when given an `co_name` that cannot be duplicated. """
+ with pytest.raises(ValueError):
+ @with_signature('()', co_name='<invalid>')
+ def foo():
+ return 'hello'
+
+
+def test_invalid_func_name():
+ """ Tests that `@with_signature` can duplicate a func_name that is invalid in a function definition. """
+ @with_signature('()', func_name='<invalid>')
+ def foo():
+ return 'hello'
+
+ assert foo.__name__ == '<invalid>'
+ assert foo() == 'hello'
+
+
@pytest.mark.skipif(sys.version_info < (3, 0), reason="requires python3 or higher")
def test_qualname_when_nested():
""" Tests that qualname is correctly set when `@with_signature` is applied on nested functions """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/tests/test_issues.py new/makefun-1.14.0/tests/test_issues.py
--- old/makefun-1.12.1/tests/test_issues.py 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/tests/test_issues.py 2022-06-21 23:26:54.000000000 +0200
@@ -1,3 +1,4 @@
+import inspect
import sys
import pytest
@@ -224,3 +225,31 @@
f2 = create_function("zoo(a)", f, func=f)
assert f2(3) == 4
+
+
+(a)pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python 3.6 or higher (async generator)")
+def test_issue_77_async_generator_wraps():
+ import asyncio
+ from ._test_py36 import make_async_generator, make_async_generator_wrapper
+
+ f = make_async_generator()
+ wrapper = wraps(f)(make_async_generator_wrapper(f))
+
+ assert inspect.isasyncgenfunction(f)
+ assert inspect.isasyncgenfunction(wrapper)
+
+ assert asyncio.get_event_loop().run_until_complete(asyncio.ensure_future(wrapper(1).__anext__())) == 1
+
+
+(a)pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python 3.6 or higher (async generator)")
+def test_issue_77_async_generator_partial():
+ import asyncio
+ from ._test_py36 import make_async_generator
+
+ f = make_async_generator()
+ f_partial = partial(f, v=1)
+
+ assert inspect.isasyncgenfunction(f)
+ assert inspect.isasyncgenfunction(f_partial)
+
+ assert asyncio.get_event_loop().run_until_complete(asyncio.ensure_future(f_partial().__anext__())) == 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.12.1/tests/test_partial_and_macros.py new/makefun-1.14.0/tests/test_partial_and_macros.py
--- old/makefun-1.12.1/tests/test_partial_and_macros.py 2021-10-08 12:12:08.000000000 +0200
+++ new/makefun-1.14.0/tests/test_partial_and_macros.py 2022-06-21 23:26:54.000000000 +0200
@@ -174,10 +174,19 @@
# assert str(signature(fp_ref)) == str(signature(fp))
-def test_simple_partial_copy():
- """Test that when not providing any argument to partial, it is equivalent to wraps with new sig = None"""
- def f1(a):
- return a + 1
+(a)pytest.mark.parametrize("is_generator", [False, True])
+def test_simple_partial_copy(is_generator):
+ """Test that when not providing any argument to partial, it is equivalent to wraps with new sig = None
+
+ This test was extended to cover issue 79.
+ """
+
+ if is_generator:
+ def f1(a):
+ yield a + 1
+ else:
+ def f1(a):
+ return a + 1
f2 = makefun.partial(f1)
@@ -188,7 +197,10 @@
f3 = makefun.wraps(f1)(f1)
assert f3.__wrapped__ == f1
- assert f2(1) == f3(1) == 2
+ if is_generator:
+ assert next(f2(1)) == next(f3(1)) == 2
+ else:
+ assert f2(1) == f3(1) == 2
# the func attribute is there too
f4 = functools.partial(f1)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-markdown2 for openSUSE:Factory checked in at 2022-09-30 17:57:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-markdown2 (Old)
and /work/SRC/openSUSE:Factory/.python-markdown2.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-markdown2"
Fri Sep 30 17:57:47 2022 rev:10 rq:1007065 version:2.4.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-markdown2/python-markdown2.changes 2022-03-26 22:32:29.666070984 +0100
+++ /work/SRC/openSUSE:Factory/.python-markdown2.new.2275/python-markdown2.changes 2022-09-30 17:58:06.157288137 +0200
@@ -1,0 +2,44 @@
+Thu Sep 29 15:51:26 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- python-markdown2 2.4.5
+ [pull #466] Add optional dependencies to setup.py
+- python-markdown2 2.4.4
+ [pull #439] Fix TypeError if html-classes extra is None
+ [pull #441] Remove Python2 support
+ [pull #445] Replace <strike> with <s> in strike extra
+ [pull #446] Fix link patterns extra applying within links
+ [pull #443] create proper entry point
+ [pull #449] Codespans inside link text issue344
+ [pull #451] Underline and HTML comments
+ [pull #453] Links with brackets
+ [pull #454] Fix emacs local variable one-liners
+ [pull #457] Example of the current mixed-paragraph mode behavior in lists
+ [pull #455] Fix code block indentation in lists
+ [pull #434] Fix filter bypass leading to XSS (#362)
+ [pull #464] Fix html-classes extra not applying to code spans
+ [pull #462] Fix pygments block matching
+ [pull #462] Fix pyshell blocks in blockquotes
+ [pull #463] Fix multilevel lists
+ [pull #468] Remove _uniform_outdent_limit function
+ [pull #470] Add support for ordered lists that don't start at 1. (#469)
+ [pull #472] Fix AssertionError with lazy numbered lists (issue #471)
+ [pull #475] Add <ul> and <ol> tags to html-classes extra (#352)
+ [pull #473] XSS test and fix
+- python-markdown2 2.4.3
+ [pull #413] Fix meta indentation
+ [pull #414] Fix code surrounded by blank lines inside blockquote fenced code blocks
+ [pull #417] Fix inline code pipe symbol within tables (issue #399)
+ [pull #418] Fix code block parsing error (issue #327)
+ [pull #419] Fix hr block created when not supposed to (issue #400)
+ [pull #421] Fix backslashes removed by adjacent code blocks (issues #369 and #412)
+ [pull #420] Fix md5-* in resulting HTML when several code blocks follow one by one (issue #355)
+ [pull #422] Fix excessive <br> tags in lists using break-on-newline extra (issue #394)
+ [pull #424] Standardize key and value definitions for metadata extra (issue #423)
+ [pull #427] Fix fenced code blocks breaking lists (issue #426)
+ [pull #429] Fix catastrophic backtracking (Regex DoS) in pyshell blocks.
+ [pull #431] Fix incorrect indentation of fenced code blocks within lists
+ [pull #436] RST admonitions
+ [pull #430] Improve error message if link_patterns forgotten
+ [pull #437] fix compatibility with pygments 2.12
+
+-------------------------------------------------------------------
Old:
----
markdown2-2.4.2.tar.gz
New:
----
markdown2-2.4.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-markdown2.spec ++++++
--- /var/tmp/diff_new_pack.oPBE18/_old 2022-09-30 17:58:06.605289095 +0200
+++ /var/tmp/diff_new_pack.oPBE18/_new 2022-09-30 17:58:06.609289104 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-markdown2
-Version: 2.4.2
+Version: 2.4.3
Release: 0
Summary: A Python implementation of Markdown
License: MIT
++++++ markdown2-2.4.2.tar.gz -> markdown2-2.4.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/CHANGES.md new/markdown2-2.4.3/CHANGES.md
--- old/markdown2-2.4.2/CHANGES.md 2021-12-02 04:50:38.000000000 +0100
+++ new/markdown2-2.4.3/CHANGES.md 2022-04-28 01:21:58.000000000 +0200
@@ -1,5 +1,24 @@
# python-markdown2 Changelog
+## python-markdown2 2.4.3
+
+- [pull #413] Fix meta indentation
+- [pull #414] Fix code surrounded by blank lines inside blockquote fenced code blocks
+- [pull #417] Fix inline code pipe symbol within tables (issue #399)
+- [pull #418] Fix code block parsing error (issue #327)
+- [pull #419] Fix hr block created when not supposed to (issue #400)
+- [pull #421] Fix backslashes removed by adjacent code blocks (issues #369 and #412)
+- [pull #420] Fix md5-* in resulting HTML when several code blocks follow one by one (issue #355)
+- [pull #422] Fix excessive <br> tags in lists using break-on-newline extra (issue #394)
+- [pull #424] Standardize key and value definitions for metadata extra (issue #423)
+- [pull #427] Fix fenced code blocks breaking lists (issue #426)
+- [pull #429] Fix catastrophic backtracking (Regex DoS) in pyshell blocks.
+- [pull #431] Fix incorrect indentation of fenced code blocks within lists
+- [pull #436] RST admonitions
+- [pull #430] Improve error message if link_patterns forgotten
+- [pull #437] fix compatibility with pygments 2.12
+
+
## python-markdown2 2.4.2
- [pull #408] Fix for fenced code blocks issue #396
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/CONTRIBUTORS.txt new/markdown2-2.4.3/CONTRIBUTORS.txt
--- old/markdown2-2.4.2/CONTRIBUTORS.txt 2021-12-02 04:45:53.000000000 +0100
+++ new/markdown2-2.4.3/CONTRIBUTORS.txt 2022-03-14 02:21:58.000000000 +0100
@@ -50,3 +50,5 @@
Denis Kasak (github.com/dkasak)
Maximilian Hils (github.com/mhils)
BarkeH (github.com/BarkeH)
+cav71 (github.com/cav71)
+Crozzers (github.com/Crozzers)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/PKG-INFO new/markdown2-2.4.3/PKG-INFO
--- old/markdown2-2.4.2/PKG-INFO 2021-12-02 04:50:50.984773400 +0100
+++ new/markdown2-2.4.3/PKG-INFO 2022-04-28 01:22:04.044128400 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: markdown2
-Version: 2.4.2
+Version: 2.4.3
Summary: A fast and complete Python implementation of Markdown
Home-page: https://github.com/trentm/python-markdown2
Author: Trent Mick
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/README.md new/markdown2-2.4.3/README.md
--- old/markdown2-2.4.2/README.md 2021-12-02 04:45:53.000000000 +0100
+++ new/markdown2-2.4.3/README.md 2022-04-08 21:19:05.000000000 +0200
@@ -13,7 +13,7 @@
Markdown.pl. Markdown2 also comes with a number of extensions (called
"extras") for things like syntax coloring, tables, header-ids. See the
"Extra Syntax" section below. "markdown2" supports all Python versions
-2.6+ or 3.3+ (and pypy and jython, though I don't frequently test those).
+3.5+ (and pypy and jython, though I don't frequently test those).
There is another [Python
markdown.py](https://python-markdown.github.io/). However, at
@@ -48,14 +48,14 @@
```python
>>> import markdown2
>>> markdown2.markdown("*boo!*") # or use `html = markdown_path(PATH)`
-u'<p><em>boo!</em></p>\n'
+'<p><em>boo!</em></p>\n'
>>> from markdown2 import Markdown
>>> markdowner = Markdown()
>>> markdowner.convert("*boo!*")
-u'<p><em>boo!</em></p>\n'
+'<p><em>boo!</em></p>\n'
>>> markdowner.convert("**boom!**")
-u'<p><strong>boom!</strong></p>\n'
+'<p><strong>boom!</strong></p>\n'
```
As a script (CLI):
```shell
@@ -88,7 +88,7 @@
```shell
>>> import markdown2
>>> markdown2.markdown("*boo!*", extras=["footnotes"])
-u'<p><em>boo!</em></p>\n'
+'<p><em>boo!</em></p>\n'
```
There are a number of currently implemented extras for tables, footnotes,
syntax coloring of `<pre>`-blocks, auto-linking patterns, table of contents,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/lib/markdown2.egg-info/PKG-INFO new/markdown2-2.4.3/lib/markdown2.egg-info/PKG-INFO
--- old/markdown2-2.4.2/lib/markdown2.egg-info/PKG-INFO 2021-12-02 04:50:50.000000000 +0100
+++ new/markdown2-2.4.3/lib/markdown2.egg-info/PKG-INFO 2022-04-28 01:22:03.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: markdown2
-Version: 2.4.2
+Version: 2.4.3
Summary: A fast and complete Python implementation of Markdown
Home-page: https://github.com/trentm/python-markdown2
Author: Trent Mick
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/lib/markdown2.egg-info/SOURCES.txt new/markdown2-2.4.3/lib/markdown2.egg-info/SOURCES.txt
--- old/markdown2-2.4.2/lib/markdown2.egg-info/SOURCES.txt 2021-12-02 04:50:50.000000000 +0100
+++ new/markdown2-2.4.3/lib/markdown2.egg-info/SOURCES.txt 2022-04-28 01:22:03.000000000 +0200
@@ -21,6 +21,13 @@
test/tm-cases/CVE-2018-5773.html
test/tm-cases/CVE-2018-5773.opts
test/tm-cases/CVE-2018-5773.text
+test/tm-cases/admonitions.html
+test/tm-cases/admonitions.opts
+test/tm-cases/admonitions.text
+test/tm-cases/admonitions_with_fenced_code_blocks.html
+test/tm-cases/admonitions_with_fenced_code_blocks.opts
+test/tm-cases/admonitions_with_fenced_code_blocks.tags
+test/tm-cases/admonitions_with_fenced_code_blocks.text
test/tm-cases/ampersands.html
test/tm-cases/ampersands.tags
test/tm-cases/ampersands.text
@@ -33,6 +40,8 @@
test/tm-cases/auto_link_safe_mode.opts
test/tm-cases/auto_link_safe_mode.tags
test/tm-cases/auto_link_safe_mode.text
+test/tm-cases/backslash_removed_by_adjacent_backtick.html
+test/tm-cases/backslash_removed_by_adjacent_backtick.text
test/tm-cases/basic_safe_mode.html
test/tm-cases/basic_safe_mode.opts
test/tm-cases/basic_safe_mode.tags
@@ -52,6 +61,9 @@
test/tm-cases/break_on_newline.html
test/tm-cases/break_on_newline.opts
test/tm-cases/break_on_newline.text
+test/tm-cases/break_on_newline_excessive_br_tags_in_ul.html
+test/tm-cases/break_on_newline_excessive_br_tags_in_ul.opts
+test/tm-cases/break_on_newline_excessive_br_tags_in_ul.text
test/tm-cases/code_block_with_tabs.html
test/tm-cases/code_block_with_tabs.tags
test/tm-cases/code_block_with_tabs.text
@@ -111,9 +123,21 @@
test/tm-cases/fenced_code_blocks_issue161.opts
test/tm-cases/fenced_code_blocks_issue161.tags
test/tm-cases/fenced_code_blocks_issue161.text
+test/tm-cases/fenced_code_blocks_issue327.html
+test/tm-cases/fenced_code_blocks_issue327.opts
+test/tm-cases/fenced_code_blocks_issue327.tags
+test/tm-cases/fenced_code_blocks_issue327.text
+test/tm-cases/fenced_code_blocks_issue355.html
+test/tm-cases/fenced_code_blocks_issue355.opts
+test/tm-cases/fenced_code_blocks_issue355.tags
+test/tm-cases/fenced_code_blocks_issue355.text
test/tm-cases/fenced_code_blocks_issue396.html
test/tm-cases/fenced_code_blocks_issue396.opts
test/tm-cases/fenced_code_blocks_issue396.text
+test/tm-cases/fenced_code_blocks_issue426.html
+test/tm-cases/fenced_code_blocks_issue426.opts
+test/tm-cases/fenced_code_blocks_issue426.tags
+test/tm-cases/fenced_code_blocks_issue426.text
test/tm-cases/fenced_code_blocks_issue86.html
test/tm-cases/fenced_code_blocks_issue86.opts
test/tm-cases/fenced_code_blocks_issue86.tags
@@ -209,6 +233,8 @@
test/tm-cases/hr_length.text
test/tm-cases/hr_spaces.html
test/tm-cases/hr_spaces.text
+test/tm-cases/hr_uniform_characters.html
+test/tm-cases/hr_uniform_characters.text
test/tm-cases/html5_block_tags.html
test/tm-cases/html5_block_tags.tags
test/tm-cases/html5_block_tags.text
@@ -221,6 +247,10 @@
test/tm-cases/incorrect_list_parse.html
test/tm-cases/incorrect_list_parse.tags
test/tm-cases/incorrect_list_parse.text
+test/tm-cases/inline_code_pipe_within_table.html
+test/tm-cases/inline_code_pipe_within_table.opts
+test/tm-cases/inline_code_pipe_within_table.tags
+test/tm-cases/inline_code_pipe_within_table.text
test/tm-cases/inline_links.html
test/tm-cases/inline_links.text
test/tm-cases/issue21_gt_escaping.html
@@ -305,6 +335,9 @@
test/tm-cases/metadata2.opts
test/tm-cases/metadata2.tags
test/tm-cases/metadata2.text
+test/tm-cases/metadata3.html
+test/tm-cases/metadata3.opts
+test/tm-cases/metadata3.text
test/tm-cases/mismatched_footnotes.html
test/tm-cases/mismatched_footnotes.opts
test/tm-cases/mismatched_footnotes.text
@@ -335,6 +368,10 @@
test/tm-cases/pyshell_and_fenced_code_blocks.opts
test/tm-cases/pyshell_and_fenced_code_blocks.tags
test/tm-cases/pyshell_and_fenced_code_blocks.text
+test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.html
+test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.opts
+test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.tags
+test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.text
test/tm-cases/raw_html.html
test/tm-cases/raw_html.text
test/tm-cases/ref_links.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/lib/markdown2.py new/markdown2-2.4.3/lib/markdown2.py
--- old/markdown2-2.4.2/lib/markdown2.py 2021-12-02 04:45:53.000000000 +0100
+++ new/markdown2-2.4.3/lib/markdown2.py 2022-04-28 01:14:34.000000000 +0200
@@ -40,6 +40,7 @@
Supported extra syntax options (see -x|--extras option below and
see <https://github.com/trentm/python-markdown2/wiki/Extras> for details):
+* admonitions: Enable parsing of RST admonitions.
* break-on-newline: Replace single new line characters with <br> when True
* code-friendly: Disable _ and __ for em and strong.
* cuddled-lists: Allow lists to be cuddled to the preceding paragraph.
@@ -97,7 +98,7 @@
# not yet sure if there implications with this. Compare 'pydoc sre'
# and 'perldoc perlre'.
-__version_info__ = (2, 4, 2)
+__version_info__ = (2, 4, 3)
__version__ = '.'.join(map(str, __version_info__))
__author__ = "Trent Mick"
@@ -248,6 +249,12 @@
self._toc_depth = self.extras["toc"].get("depth", 6)
self._instance_extras = self.extras.copy()
+ if 'link-patterns' in self.extras:
+ if link_patterns is None:
+ # if you have specified that the link-patterns extra SHOULD
+ # be used (via self.extras) but you haven't provided anything
+ # via the link_patterns argument then an error is raised
+ raise MarkdownError("If the 'link-patterns' extra is used, an argument for 'link_patterns' is required")
self.link_patterns = link_patterns
self.footnote_title = footnote_title
self.footnote_return_symbol = footnote_return_symbol
@@ -256,6 +263,7 @@
self.cli = cli
self._escape_table = g_escape_table.copy()
+ self._code_table = {}
if "smarty-pants" in self.extras:
self._escape_table['"'] = _hash_text('"')
self._escape_table["'"] = _hash_text("'")
@@ -361,6 +369,9 @@
if "fenced-code-blocks" in self.extras and self.safe_mode:
text = self._do_fenced_code_blocks(text)
+ if 'admonitions' in self.extras:
+ text = self._do_admonitions(text)
+
# Because numbering references aren't links (yet?) then we can do everything associated with counters
# before we get started
if "numbering" in self.extras:
@@ -443,14 +454,20 @@
# another-var: blah blah
#
# # header
- _meta_data_pattern = re.compile(r'^(?:---[\ \t]*\n)?((?:[\S\w]+\s*:(?:\n+[ \t]+.*)+)|(?:.*:\s+>\n\s+[\S\s]+?)(?=\n\w+\s*:\s*\w+\n|\Z)|(?:\s*[\S\w]+\s*:(?! >)[ \t]*.*\n?))(?:---[\ \t]*\n)?', re.MULTILINE)
- _key_val_pat = re.compile(r"[\S\w]+\s*:(?! >)[ \t]*.*\n?", re.MULTILINE)
- # this allows key: >
- # value
- # conutiues over multiple lines
- _key_val_block_pat = re.compile(
- r"(.*:\s+>\n\s+[\S\s]+?)(?=\n\w+\s*:\s*\w+\n|\Z)", re.MULTILINE
+ _meta_data_pattern = re.compile(r'''
+ ^(?:---[\ \t]*\n)?( # optional opening fence
+ (?:
+ [\S \t]*\w[\S \t]*\s*:(?:\n+[ \t]+.*)+ # indented lists
+ )|(?:
+ (?:[\S \t]*\w[\S \t]*\s*:\s+>(?:\n\s+.*)+?) # multiline long descriptions
+ (?=\n[\S \t]*\w[\S \t]*\s*:\s*.*\n|\s*\Z) # match up until the start of the next key:value definition or the end of the input text
+ )|(?:
+ [\S \t]*\w[\S \t]*\s*:(?! >).*\n? # simple key:value pair, leading spaces allowed
+ )
+ )(?:---[\ \t]*\n)? # optional closing fence
+ ''', re.MULTILINE | re.VERBOSE
)
+
_key_val_list_pat = re.compile(
r"^-(?:[ \t]*([^\n]*)(?:[ \t]*[:-][ \t]*(\S+))?)(?:\n((?:[ \t]+[^\n]+\n?)+))?",
re.MULTILINE,
@@ -516,7 +533,7 @@
# Multiline value
if v[:3] == " >\n":
- self.metadata[k.strip()] = v[3:].strip()
+ self.metadata[k.strip()] = _dedent(v[3:]).strip()
# Empty value
elif v == "\n":
@@ -986,12 +1003,15 @@
re.X | re.M)
return footnote_def_re.sub(self._extract_footnote_def_sub, text)
- _hr_re = re.compile(r'^[ ]{0,3}([-_*][ ]{0,2}){3,}$', re.M)
+ _hr_re = re.compile(r'^[ ]{0,3}([-_*])[ ]{0,2}(\1[ ]{0,2}){2,}$', re.M)
def _run_block_gamut(self, text):
# These are all the transformations that form block-level
# tags like paragraphs, headers, and list items.
+ if 'admonitions' in self.extras:
+ text = self._do_admonitions(text)
+
if "fenced-code-blocks" in self.extras:
text = self._do_fenced_code_blocks(text)
@@ -1049,8 +1069,8 @@
less_than_tab = self.tab_width - 1
_pyshell_block_re = re.compile(r"""
- ^([ ]{0,%d})>>>[ ].*\n # first line
- ^(\1.*\S+.*\n)* # any number of subsequent lines
+ ^([ ]{0,%d})>>>[ ].*\n # first line
+ ^(\1[^\S\n]*\S.*\n)* # any number of subsequent lines with at least one character
^\n # ends with a blank line
""" % less_than_tab, re.M | re.X)
@@ -1059,7 +1079,7 @@
def _table_sub(self, match):
trim_space_re = '^[ \t\n]+|[ \t\n]+$'
trim_bar_re = r'^\||\|$'
- split_bar_re = r'^\||(?<!\\)\|'
+ split_bar_re = r'^\||(?<![\`\\])\|'
escape_bar_re = r'\\\|'
head, underline, body = match.groups()
@@ -1219,7 +1239,7 @@
# Do hard breaks:
if "break-on-newline" in self.extras:
- text = re.sub(r" *\n", "<br%s\n" % self.empty_element_suffix, text)
+ text = re.sub(r" *\n(?!\<(?:\/?(ul|ol|li))\>)", "<br%s\n" % self.empty_element_suffix, text)
else:
text = re.sub(r" {2,}\n", " <br%s\n" % self.empty_element_suffix, text)
@@ -1833,9 +1853,14 @@
yield tup
yield 0, "</code>"
- def wrap(self, source, outfile):
+ def wrap(self, source, outfile=None):
"""Return the source with a code, pre, and div."""
- return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
+ if outfile is None:
+ # pygments >= 2.12
+ return self._wrap_pre(self._wrap_code(source))
+ else:
+ # pygments < 2.12
+ return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
formatter_opts.setdefault("cssclass", "codehilite")
formatter = HtmlCodeFormatter(**formatter_opts)
@@ -1844,10 +1869,10 @@
def _code_block_sub(self, match, is_fenced_code_block=False):
lexer_name = None
if is_fenced_code_block:
- lexer_name = match.group(1)
+ lexer_name = match.group(2)
if lexer_name:
formatter_opts = self.extras['fenced-code-blocks'] or {}
- codeblock = match.group(2)
+ codeblock = match.group(3)
codeblock = codeblock[:-1] # drop one trailing newline
else:
codeblock = match.group(1)
@@ -1878,10 +1903,15 @@
return codeblock
lexer = self._get_pygments_lexer(lexer_name)
if lexer:
+ # remove leading indent from code block
+ leading_indent, codeblock = self._uniform_outdent(codeblock)
+
codeblock = unhash_code( codeblock )
colored = self._color_with_pygments(codeblock, lexer,
**formatter_opts)
- return "\n\n%s\n\n" % colored
+
+ # add back the indent to all lines
+ return "\n%s\n" % self._uniform_indent(colored, leading_indent, True)
codeblock = self._encode_code(codeblock)
pre_class_str = self._html_class_str_from_tag("pre")
@@ -1891,7 +1921,7 @@
else:
code_class_str = self._html_class_str_from_tag("code")
- return "\n\n<pre%s><code%s>%s\n</code></pre>\n\n" % (
+ return "\n<pre%s><code%s>%s\n</code></pre>\n" % (
pre_class_str, code_class_str, codeblock)
def _html_class_str_from_tag(self, tag):
@@ -1922,16 +1952,16 @@
((?=^[ ]{0,%d}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
# Lookahead to make sure this block isn't already in a code block.
# Needed when syntax highlighting is being used.
- (?![^<]*\</code\>)
+ (?!([^<]|<(/?)span)*\</code\>)
''' % (self.tab_width, self.tab_width),
re.M | re.X)
return code_block_re.sub(self._code_block_sub, text)
_fenced_code_block_re = re.compile(r'''
- (?:\n+|\A\n?)
- ^```\s{0,99}?([\w+-]+)?\s{0,99}?\n # opening fence, $1 = optional lang
- (.*?) # $2 = code block content
- ^```[ \t]*\n # closing fence
+ (?:\n+|\A\n?|(?<=\n))
+ (^[ \t]*`{3,})\s{0,99}?([\w+-]+)?\s{0,99}?\n # $1 = opening fence (captured for back-referencing), $2 = optional lang
+ (.*?) # $3 = code block content
+ \1[ \t]*\n # closing fence
''', re.M | re.X | re.S)
def _fenced_code_block_sub(self, match):
@@ -2005,9 +2035,47 @@
for before, after in replacements:
text = text.replace(before, after)
hashed = _hash_text(text)
- self._escape_table[text] = hashed
+ self._code_table[text] = hashed
return hashed
+ _admonitions = r'admonition|attention|caution|danger|error|hint|important|note|tip|warning'
+ _admonitions_re = re.compile(r'''
+ ^(\ *)\.\.\ (%s)::\ * # $1 leading indent, $2 the admonition
+ (.*)? # $3 admonition title
+ ((?:\s*\n\1\ {3,}.*)+?) # $4 admonition body (required)
+ (?=\s*(?:\Z|\n{4,}|\n\1?\ {0,2}\S)) # until EOF, 3 blank lines or something less indented
+ ''' % _admonitions,
+ re.IGNORECASE | re.MULTILINE | re.VERBOSE
+ )
+
+ def _do_admonitions_sub(self, match):
+ lead_indent, admonition_name, title, body = match.groups()
+
+ admonition_type = '<strong>%s</strong>' % admonition_name
+
+ # figure out the class names to assign the block
+ if admonition_name.lower() == 'admonition':
+ admonition_class = 'admonition'
+ else:
+ admonition_class = 'admonition %s' % admonition_name.lower()
+
+ # titles are generally optional
+ if title:
+ title = '<em>%s</em>' % title
+
+ # process the admonition body like regular markdown
+ body = self._run_block_gamut("\n%s\n" % self._uniform_outdent(body)[1])
+
+ # indent the body before placing inside the aside block
+ admonition = self._uniform_indent('%s\n%s\n\n%s\n' % (admonition_type, title, body), self.tab, False)
+ # wrap it in an aside
+ admonition = '<aside class="%s">\n%s</aside>' % (admonition_class, admonition)
+ # now indent the whole admonition back to where it started
+ return self._uniform_indent(admonition, lead_indent, False)
+
+ def _do_admonitions(self, text):
+ return self._admonitions_re.sub(self._do_admonitions_sub, text)
+
_strike_re = re.compile(r"~~(?=\S)(.+?)(?<=\S)~~", re.S)
def _do_strike(self, text):
text = self._strike_re.sub(r"<strike>\1</strike>", text)
@@ -2335,7 +2403,7 @@
def _unescape_special_chars(self, text):
# Swap back in all the special characters we've hidden.
- for ch, hash in list(self._escape_table.items()):
+ for ch, hash in list(self._escape_table.items()) + list(self._code_table.items()):
text = text.replace(hash, ch)
return text
@@ -2343,6 +2411,26 @@
# Remove one level of line-leading tabs or spaces
return self._outdent_re.sub('', text)
+ def _uniform_outdent(self, text):
+ # Removes the smallest common leading indentation from each line
+ # of `text` and returns said indent along with the outdented text.
+
+ # Find leading indentation of each line
+ ws = re.findall(r'(^[ \t]*)(?:[^ \t\n])', text, re.MULTILINE)
+ # Get smallest common leading indent
+ ws = sorted(ws)[0]
+ # Dedent every line by smallest common indent
+ return ws, ''.join(
+ (line.replace(ws, '', 1) if line.startswith(ws) else line)
+ for line in text.splitlines(True)
+ )
+
+ def _uniform_indent(self, text, indent, include_empty_lines=False):
+ return ''.join(
+ (indent + line if line.strip() or include_empty_lines else '')
+ for line in text.splitlines(True)
+ )
+
class MarkdownWithExtras(Markdown):
"""A markdowner class that enables most extras:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/testall.py new/markdown2-2.4.3/test/testall.py
--- old/markdown2-2.4.2/test/testall.py 2021-12-02 04:45:53.000000000 +0100
+++ new/markdown2-2.4.3/test/testall.py 2022-04-08 21:19:05.000000000 +0200
@@ -26,7 +26,8 @@
def _gen_python_names():
yield "python"
- for ver in [(2,6), (2,7), (3,3), (3,4), (3,5), (3,6), (3,7)]:
+ # generate version numbers from python 3.5 to 3.20
+ for ver in [(3, i) for i in range(5, 20)]:
yield "python%d.%d" % ver
if sys.platform == "win32":
yield "python%d%d" % ver
@@ -43,8 +44,8 @@
def testall():
for ver, python in _gen_pythons():
- if ver < (2,6) or ver in ((3,0), (3,1), (3,2)):
- # Don't support Python < 2.6, 3.0/3.1/3.2.
+ if ver < (3, 5):
+ # Don't support Python < 3.5
continue
ver_str = "%s.%s" % ver
print("-- test with Python %s (%s)" % (ver_str, python))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions.html new/markdown2-2.4.3/test/tm-cases/admonitions.html
--- old/markdown2-2.4.2/test/tm-cases/admonitions.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions.html 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1,53 @@
+<aside class="admonition note">
+ <strong>NOTE</strong>
+ <em>Admonitions</em>
+ <p>They contain 3 main parts, the admonition type, title and body. </p>
+ <p>The admonition type is case insensitive, title is optional and the body
+ should be able to contain pretty much anything. For example:</p>
+ <ul>
+ <li>Lists</li>
+ <li>With multiple levels
+ <ul>
+ <li>Of indentation</li>
+ </ul></li>
+ </ul>
+ <p>And code blocks:</p>
+ <pre><code>print('indented code blocks')
+ </code></pre>
+</aside>
+
+<aside class="admonition warning">
+ <strong>warning</strong>
+ <p>The admonition's body must be indented by a tab or 3 or more spaces
+ from where the admonition was declared</p>
+</aside>
+
+<p>Otherwise the text is no longer part of the admonition.</p>
+
+<aside class="admonition important">
+ <strong>IMPORTANT</strong>
+ <p>You can also use 3 or more empty lines after an admonition <br />
+ to end it</p>
+</aside>
+
+<pre><code>print('In case you wanted something like')
+print('an indented code block right after')
+</code></pre>
+
+<aside class="admonition">
+ <strong>admonition</strong>
+ <em>Generic admonitions</em>
+ <p>These should be given a title but this is not enforced</p>
+ <aside class="admonition note">
+ <strong>note</strong>
+ <em>Nested admonitions</em>
+ <p>Nested admonitions should also work</p>
+ <ul>
+ <li>Even inside
+ <aside class="admonition tip">
+ <strong>tip</strong>
+ <p>of a list</p>
+ </aside></li>
+ </ul>
+ </aside>
+</aside>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions.opts new/markdown2-2.4.3/test/tm-cases/admonitions.opts
--- old/markdown2-2.4.2/test/tm-cases/admonitions.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions.opts 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1 @@
+{"extras": ["admonitions"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions.text new/markdown2-2.4.3/test/tm-cases/admonitions.text
--- old/markdown2-2.4.2/test/tm-cases/admonitions.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions.text 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1,38 @@
+.. NOTE:: Admonitions
+ They contain 3 main parts, the admonition type, title and body.
+
+ The admonition type is case insensitive, title is optional and the body
+ should be able to contain pretty much anything. For example:
+
+ - Lists
+ - With multiple levels
+ - Of indentation
+
+ And code blocks:
+
+ print('indented code blocks')
+
+.. warning::
+ The admonition's body must be indented by a tab or 3 or more spaces
+ from where the admonition was declared
+ Otherwise the text is no longer part of the admonition.
+
+.. IMPORTANT::
+ You can also use 3 or more empty lines after an admonition
+ to end it
+
+
+
+ print('In case you wanted something like')
+ print('an indented code block right after')
+
+.. admonition:: Generic admonitions
+
+ These should be given a title but this is not enforced
+
+ .. note:: Nested admonitions
+ Nested admonitions should also work
+
+ - Even inside
+ .. tip::
+ of a list
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.html new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.html
--- old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.html 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1,25 @@
+<aside class="admonition note">
+ <strong>note</strong>
+ <p>Admonitions are able to contain fenced code blocks</p>
+ <div class="codehilite"><pre><span></span><code><span class="nb">print</span><span class="p">(</span><span class="s1">'like so'</span><span class="p">)</span>
+ </code></pre></div>
+</aside>
+
+<aside class="admonition warning">
+ <strong>warning</strong>
+ <div class="codehilite"><pre><span></span><code><span class="nb">print</span><span class="p">(</span><span class="s1">'Consecutive blocks should also be fine'</span><span class="p">)</span>
+ </code></pre></div>
+ <div class="codehilite"><pre><span></span><code><span class="nb">print</span><span class="p">(</span><span class="s1">'Even though fenced code blocks wrap themselves in newlines'</span><span class="p">)</span>
+ </code></pre></div>
+ <aside class="admonition hint">
+ <strong>hint</strong>
+ <em>It should also work nested</em>
+ <div class="codehilite"><pre><span></span><code><span class="nb">print</span><span class="p">(</span><span class="s1">'ok'</span><span class="p">)</span>
+ </code></pre></div>
+ </aside>
+</aside>
+
+<div class="codehilite"><pre><span></span><code><span class="c1"># admonitions WITHIN fenced code blocks should NOT be rendered</span>
+<span class="o">..</span> <span class="n">attention</span><span class="p">::</span> <span class="n">title</span>
+ <span class="n">body</span>
+</code></pre></div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.opts new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.opts
--- old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.opts 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1 @@
+{"extras": ["admonitions", "fenced-code-blocks", "pygments"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.tags new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.tags
--- old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.tags 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.tags 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1 @@
+extra admonitions fenced-code-blocks pygments
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.text new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.text
--- old/markdown2-2.4.2/test/tm-cases/admonitions_with_fenced_code_blocks.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/admonitions_with_fenced_code_blocks.text 2022-04-20 06:01:34.000000000 +0200
@@ -0,0 +1,23 @@
+.. note::
+ Admonitions are able to contain fenced code blocks
+ ```python
+ print('like so')
+ ```
+
+.. warning::
+ ```python
+ print('Consecutive blocks should also be fine')
+ ```
+ ```python
+ print('Even though fenced code blocks wrap themselves in newlines')
+ ```
+ .. hint:: It should also work nested
+ ```python
+ print('ok')
+ ```
+
+```python
+# admonitions WITHIN fenced code blocks should NOT be rendered
+.. attention:: title
+ body
+```
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/backslash_removed_by_adjacent_backtick.html new/markdown2-2.4.3/test/tm-cases/backslash_removed_by_adjacent_backtick.html
--- old/markdown2-2.4.2/test/tm-cases/backslash_removed_by_adjacent_backtick.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/backslash_removed_by_adjacent_backtick.html 2022-03-22 19:33:18.000000000 +0100
@@ -0,0 +1,7 @@
+<p>hello \world</p>
+
+<p>hello \world my favourite letter is <code>w</code></p>
+
+<p>hello \world my favourite code is <code>import pickle</code></p>
+
+<p>hello \world my favourite letter is <code>x</code></p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/backslash_removed_by_adjacent_backtick.text new/markdown2-2.4.3/test/tm-cases/backslash_removed_by_adjacent_backtick.text
--- old/markdown2-2.4.2/test/tm-cases/backslash_removed_by_adjacent_backtick.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/backslash_removed_by_adjacent_backtick.text 2022-03-22 19:33:18.000000000 +0100
@@ -0,0 +1,7 @@
+hello \world
+
+hello \world my favourite letter is `w`
+
+hello \world my favourite code is `import pickle`
+
+hello \world my favourite letter is `x`
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.html new/markdown2-2.4.3/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.html
--- old/markdown2-2.4.2/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.html 2022-03-25 03:20:28.000000000 +0100
@@ -0,0 +1,54 @@
+<h2>Conte��do</h2>
+
+<ul>
+<li>O que �� estrutura Co-locada (on premises), o que �� estrutura h��brida e o que �� estrutura em-nuvem?
+<ul>
+<li>Em Nuvem (cloud based)</li>
+<li>Uma estrutura em-nuvem tem todos os seus principais recursos providos por um provedor de servi��os em nuvem.
+<ul>
+<li>Uma defini����o formal de servi��o em nuvem pode ser:</li>
+<li>Entrega via internet de um servi��o de Tecnologia da Informa����o, sob demanda, em um modelo de pague-pelo-que-consome.
+<ul>
+<li>Brown Field �� quando voc�� migra um servi��o existente</li>
+<li>Green field �� quando voc�� come��a do zero na nuvem, alguns tamb��m chamam isto de Cloud </li>
+</ul></li>
+</ul></li>
+</ul></li>
+</ul>
+
+<h2>Ordered List</h2>
+
+<ol>
+<li>A
+<ol>
+<li>B
+<ol>
+<li>C
+<ol>
+<li>D</li>
+<li>E</li>
+</ol></li>
+</ol></li>
+</ol></li>
+</ol>
+
+<h2>Mixed List</h2>
+
+<ol>
+<li>A
+<ul>
+<li>B
+<ol>
+<li>C
+<ul>
+<li>D</li>
+<li>E</li>
+</ul></li>
+<li>F
+<ol>
+<li>G</li>
+<li>H</li>
+</ol></li>
+</ol></li>
+</ul></li>
+</ol>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.opts new/markdown2-2.4.3/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.opts
--- old/markdown2-2.4.2/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.opts 2022-03-25 03:20:28.000000000 +0100
@@ -0,0 +1 @@
+{"extras": ["break-on-newline"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.text new/markdown2-2.4.3/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.text
--- old/markdown2-2.4.2/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/break_on_newline_excessive_br_tags_in_ul.text 2022-03-25 03:20:28.000000000 +0100
@@ -0,0 +1,25 @@
+## Conte��do
+- O que �� estrutura Co-locada (on premises), o que �� estrutura h��brida e o que �� estrutura em-nuvem?
+ - Em Nuvem (cloud based)
+ - Uma estrutura em-nuvem tem todos os seus principais recursos providos por um provedor de servi��os em nuvem.
+ - Uma defini����o formal de servi��o em nuvem pode ser:
+ - Entrega via internet de um servi��o de Tecnologia da Informa����o, sob demanda, em um modelo de pague-pelo-que-consome.
+ - Brown Field �� quando voc�� migra um servi��o existente
+ - Green field �� quando voc�� come��a do zero na nuvem, alguns tamb��m chamam isto de Cloud
+
+## Ordered List
+1. A
+ 1. B
+ 1. C
+ 1. D
+ 2. E
+
+## Mixed List
+1. A
+ - B
+ 1. C
+ - D
+ - E
+ 2. F
+ 1. G
+ 2. H
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.html new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.html
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.html 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1,22 @@
+<p>Inner code blocks should not render as code blocks</p>
+
+<pre><code>```cpp
+int x = 10;
+```
+</code></pre>
+
+<p>Without language specifier</p>
+
+<pre><code>```
+int x = 10;
+```
+</code></pre>
+
+<p>Double nesting</p>
+
+<pre><code>````
+```cpp
+int x = 10;
+```
+````
+</code></pre>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.opts new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.opts
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.opts 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1 @@
+{"extras": ["fenced-code-blocks"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.tags new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.tags
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.tags 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.tags 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1 @@
+extra fenced-code-blocks
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.text new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.text
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue327.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue327.text 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1,23 @@
+Inner code blocks should not render as code blocks
+
+````
+```cpp
+int x = 10;
+```
+````
+
+Without language specifier
+````
+```
+int x = 10;
+```
+````
+
+Double nesting
+`````
+````
+```cpp
+int x = 10;
+```
+````
+`````
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.html new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.html
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.html 2022-03-22 19:33:18.000000000 +0100
@@ -0,0 +1,10 @@
+<div class="codehilite"><pre><span></span><code><span class="n">some</span> <span class="n">code</span> <span class="n">block</span>
+</code></pre></div>
+
+<pre><code>yet another code block
+</code></pre>
+
+<p>new line:</p>
+
+<pre><code>code everywhere
+</code></pre>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.opts new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.opts
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.opts 2022-03-22 19:33:18.000000000 +0100
@@ -0,0 +1 @@
+{"extras": ["fenced-code-blocks"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.tags new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.tags
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.tags 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.tags 2022-03-22 19:33:18.000000000 +0100
@@ -0,0 +1 @@
+extra fenced-code-blocks pygments
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.text new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.text
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue355.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue355.text 2022-03-22 19:33:18.000000000 +0100
@@ -0,0 +1,10 @@
+```python
+some code block
+```
+```
+yet another code block
+```
+new line:
+```
+code everywhere
+```
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.html new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.html
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.html 2022-04-10 23:59:51.000000000 +0200
@@ -0,0 +1,31 @@
+<h1>Django Templates</h1>
+
+<h2>NOTES</h2>
+
+<ul>
+<li>The name should map to the URL.</li>
+<li>No distro or app name prefix, they are namespaced by their dirs already</li>
+<li>Since templates are made in python, the are <code>named_with_underscores.html</code> (not web style dashes).</li>
+</ul>
+
+<h2>URL PARAMETERS IN THE TEMPLATE</h2>
+
+<ul>
+<li>All views (except <code>generic.View</code>) from <code>django.forms.generic</code> inherit from <code>ContextMixin</code></li>
+<li><p><code>ContextMixin</code> defines the method <code>get_context_data</code>:</p>
+
+<div class="codehilite"><pre><span></span><code><span class="k">def</span> <span class="nf">get_context_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+ <span class="n">kwargs</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="s1">'view'</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">extra_context</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
+ <span class="n">kwargs</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">extra_context</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">kwargs</span>
+</code></pre></div>
+
+<p>So when overriding one must be careful to extends <code>super</code>'s <code>kwargs</code>:</p>
+
+<div class="codehilite"><pre><span></span><code><span class="k">def</span> <span class="nf">get_context_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+ <span class="n">kwargs</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">get_context_data</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+ <span class="n">kwargs</span><span class="p">[</span><span class="s1">'page_title'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"Documentation"</span>
+ <span class="k">return</span> <span class="n">kwargs</span>
+</code></pre></div></li>
+</ul>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.opts new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.opts
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.opts 2022-04-08 21:19:05.000000000 +0200
@@ -0,0 +1 @@
+{"extras": ["fenced-code-blocks", "pygments"]}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.tags new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.tags
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.tags 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.tags 2022-04-08 21:19:05.000000000 +0200
@@ -0,0 +1 @@
+extra fenced-code-blocks pygments
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.text new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.text
--- old/markdown2-2.4.2/test/tm-cases/fenced_code_blocks_issue426.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/fenced_code_blocks_issue426.text 2022-04-08 21:19:05.000000000 +0200
@@ -0,0 +1,26 @@
+# Django Templates
+
+## NOTES
+
+- The name should map to the URL.
+- No distro or app name prefix, they are namespaced by their dirs already
+- Since templates are made in python, the are `named_with_underscores.html` (not web style dashes).
+
+## URL PARAMETERS IN THE TEMPLATE
+
+- All views (except `generic.View`) from `django.forms.generic` inherit from `ContextMixin`
+- `ContextMixin` defines the method `get_context_data`:
+ ```python
+ def get_context_data(self, **kwargs):
+ kwargs.setdefault('view', self)
+ if self.extra_context is not None:
+ kwargs.update(self.extra_context)
+ return kwargs
+ ```
+ So when overriding one must be careful to extends `super`'s `kwargs`:
+ ```py
+ def get_context_data(self, **kwargs):
+ kwargs = super().get_context_data(**kwargs)
+ kwargs['page_title'] = "Documentation"
+ return kwargs
+ ```
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/hr_uniform_characters.html new/markdown2-2.4.3/test/tm-cases/hr_uniform_characters.html
--- old/markdown2-2.4.2/test/tm-cases/hr_uniform_characters.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/hr_uniform_characters.html 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1,48 @@
+<p>Horizontal rules should probably consist of all of the same characters
+EG:</p>
+
+<hr />
+
+<p>Or</p>
+
+<hr />
+
+<p>Or</p>
+
+<hr />
+
+<p>But not any of:</p>
+
+<p>--*</p>
+
+<p>-*-</p>
+
+<p>-**</p>
+
+<p>*--</p>
+
+<p><em>-</em></p>
+
+<p>**-</p>
+
+<p>**_</p>
+
+<p><em>_</em></p>
+
+<p>*__</p>
+
+<p>_**</p>
+
+<p><em>*</em></p>
+
+<p>__-</p>
+
+<p><em>-</em></p>
+
+<p>_--</p>
+
+<p>-__</p>
+
+<p>-_-</p>
+
+<p>--_</p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/hr_uniform_characters.text new/markdown2-2.4.3/test/tm-cases/hr_uniform_characters.text
--- old/markdown2-2.4.2/test/tm-cases/hr_uniform_characters.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/hr_uniform_characters.text 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1,49 @@
+Horizontal rules should probably consist of all of the same characters
+EG:
+
+***
+
+Or
+
+---
+
+Or
+
+___
+
+
+But not any of:
+
+--*
+
+-*-
+
+-**
+
+*--
+
+*-*
+
+**-
+
+**_
+
+*_*
+
+*__
+
+_**
+
+_*_
+
+__-
+
+_-_
+
+_--
+
+-__
+
+-_-
+
+--_
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.html new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.html
--- old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.html 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1,21 @@
+<table>
+<thead>
+<tr>
+ <th>Sign</th>
+ <th>Operator name</th>
+ <th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+ <td><code>&</code></td>
+ <td>Bitwise and</td>
+ <td>Bitwise and between two integer values</td>
+</tr>
+<tr>
+ <td><code>|</code></td>
+ <td>Bitwise or</td>
+ <td>Bitwise or between two integer values</td>
+</tr>
+</tbody>
+</table>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.opts new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.opts
--- old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.opts 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1 @@
+{"extras": ["tables"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.tags new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.tags
--- old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.tags 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.tags 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1 @@
+extra tables
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.text new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.text
--- old/markdown2-2.4.2/test/tm-cases/inline_code_pipe_within_table.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/inline_code_pipe_within_table.text 2022-03-14 02:18:37.000000000 +0100
@@ -0,0 +1,4 @@
+| Sign | Operator name | Description |
+|---|---|---|
+| `&` | Bitwise and | Bitwise and between two integer values |
+| `|` | Bitwise or | Bitwise or between two integer values |
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/metadata.text new/markdown2-2.4.3/test/tm-cases/metadata.text
--- old/markdown2-2.4.2/test/tm-cases/metadata.text 2021-12-02 04:45:53.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/metadata.text 2022-02-05 21:00:10.000000000 +0100
@@ -6,6 +6,7 @@
empty :
and some: >
long value
+ with complex indentation
that goes multiline
another: example
alist:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/metadata2.text new/markdown2-2.4.3/test/tm-cases/metadata2.text
--- old/markdown2-2.4.2/test/tm-cases/metadata2.text 2021-12-02 04:45:53.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/metadata2.text 2022-02-05 21:00:10.000000000 +0100
@@ -5,6 +5,7 @@
empty :
another long: >
long value
+ with complex indentation
that goes multiline
another: example
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/metadata3.html new/markdown2-2.4.3/test/tm-cases/metadata3.html
--- old/markdown2-2.4.2/test/tm-cases/metadata3.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/metadata3.html 2022-04-08 21:19:05.000000000 +0200
@@ -0,0 +1 @@
+<p>This tests various metadata key:value configurations to make sure they will work well consecutively</p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/metadata3.opts new/markdown2-2.4.3/test/tm-cases/metadata3.opts
--- old/markdown2-2.4.2/test/tm-cases/metadata3.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/metadata3.opts 2022-04-08 21:19:05.000000000 +0200
@@ -0,0 +1 @@
+{"extras": ["metadata"]}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/metadata3.text new/markdown2-2.4.3/test/tm-cases/metadata3.text
--- old/markdown2-2.4.2/test/tm-cases/metadata3.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/metadata3.text 2022-04-08 21:19:05.000000000 +0200
@@ -0,0 +1,33 @@
+---
+ : empty key should be ignored
+basic: value
+basic2: test consecutive basic keys
+empty:
+empty2 :
+long-desc: >
+ long multiline
+ description
+ with varying levels of
+ indentation
+long-desc2: >
+ test consecutive long descriptions
+nested:
+ - list item
+ - following a long description
+nested2:
+ - consecutive nested
+nested3:
+ -
+ subkey: with subkeys
+long-desc3: >
+ long description following a nested
+empty-following-long-desc:
+key with spaces: will also be recognized
+-key_start_with_hyphen: allowed
+ tab indented key: allowed
+finish-with : >
+ a nice long description
+ over a couple lines
+---
+
+This tests various metadata key:value configurations to make sure they will work well consecutively
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.html new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.html
--- old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.html 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.html 2022-02-15 02:34:01.000000000 +0100
@@ -0,0 +1,13 @@
+<h3>Example:</h3>
+
+<blockquote>
+ <div class="codehilite"><pre><span></span><code><span class="k">if</span> <span class="kc">True</span><span class="p">:</span>
+ <span class="nb">print</span><span class="p">()</span>
+
+ <span class="nb">print</span><span class="p">()</span>
+
+ <span class="nb">print</span><span class="p">()</span>
+
+ <span class="nb">print</span><span class="p">()</span>
+</code></pre></div>
+</blockquote>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.opts new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.opts
--- old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.opts 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.opts 2022-02-15 02:34:01.000000000 +0100
@@ -0,0 +1 @@
+{"extras": ["fenced-code-blocks"]}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.tags new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.tags
--- old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.tags 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.tags 2022-02-15 02:34:01.000000000 +0100
@@ -0,0 +1 @@
+extra fenced-code-blocks pygments
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.text new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.text
--- old/markdown2-2.4.2/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.text 1970-01-01 01:00:00.000000000 +0100
+++ new/markdown2-2.4.3/test/tm-cases/quoted_fenced_code_blocks_whitespace_around_indented_lines.text 2022-02-15 02:34:01.000000000 +0100
@@ -0,0 +1,12 @@
+### Example:
+
+> ```python
+> if True:
+> print()
+>
+> print()
+>
+> print()
+>
+> print()
+> ```
\ No newline at end of file
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-marshmallow for openSUSE:Factory checked in at 2022-09-30 17:57:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-marshmallow (Old)
and /work/SRC/openSUSE:Factory/.python-marshmallow.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-marshmallow"
Fri Sep 30 17:57:47 2022 rev:17 rq:1007064 version:3.17.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-marshmallow/python-marshmallow.changes 2022-05-30 12:44:48.596459168 +0200
+++ /work/SRC/openSUSE:Factory/.python-marshmallow.new.2275/python-marshmallow.changes 2022-09-30 17:58:05.401286521 +0200
@@ -1,0 +2,34 @@
+Thu Sep 29 15:53:34 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to 3.18.0 (2022-09-15)��
+ Features:
+ Add Enum field (#2017) and (#2044).
+ Bug fixes:
+ Fix typing in Field._serialize signature (#2046).
+
+- Update to 3.17.1 (2022-08-22)
+ Bug fixes:
+ Add return type to fields.Email.__init__ (#2018). Thanks @kkirsche for the PR.
+ Add missing type hint to IPInterface __init__ (#2036).
+
+- Update to 3.17.0 (2022-06-26)
+ Features:
+ Support serialization as float in TimeDelta field (#1998). Thanks @marcosatti for the PR.
+ Add messages_dict property to ValidationError to facilitate type checking (#1976). Thanks @sirosen for the PR.
+
+- Update to 3.16.0 (2022-05-29)
+ Features:
+ Raise ValueError if an invalid value is passed to the unknown argument (#1721, #1732). Thanks @sirosen for the PR.
+ Other changes:
+ Set lower bound for packaging requirement (#1957). Thanks @MatthewNicolTR for reporting and thanks @sirosen for the PR.
+ Improve warning messages by passing stacklevel (#1986). Thanks @tirkarthi for the PR.
+
+- Update to 3.15.0 (2022-03-12)
+ Features:
+ Allow passing a dict to fields.Nested (#1935). Thanks @sirosen for the PR.
+ Other changes:
+ distutils deprecation warning in Python 3.10 (#1903). Thanks @kkirsche for the PR.
+ Add py310 to black target-version (#1921).
+ Drop support for Python 3.6 (#1923).
+
+-------------------------------------------------------------------
Old:
----
marshmallow-3.14.1.tar.gz
New:
----
marshmallow-3.17.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-marshmallow.spec ++++++
--- /var/tmp/diff_new_pack.VQ0pFA/_old 2022-09-30 17:58:05.861287504 +0200
+++ /var/tmp/diff_new_pack.VQ0pFA/_new 2022-09-30 17:58:05.865287513 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-marshmallow
-Version: 3.14.1
+Version: 3.17.1
Release: 0
Summary: ORM/ODM/framework-agnostic library to convert datatypes from/to Python types
License: BSD-3-Clause AND MIT
++++++ marshmallow-3.14.1.tar.gz -> marshmallow-3.17.1.tar.gz ++++++
++++ 2260 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-mbstrdecoder for openSUSE:Factory checked in at 2022-09-30 17:57:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mbstrdecoder (Old)
and /work/SRC/openSUSE:Factory/.python-mbstrdecoder.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mbstrdecoder"
Fri Sep 30 17:57:46 2022 rev:10 rq:1007063 version:1.1.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mbstrdecoder/python-mbstrdecoder.changes 2021-12-09 19:46:03.433146193 +0100
+++ /work/SRC/openSUSE:Factory/.python-mbstrdecoder.new.2275/python-mbstrdecoder.changes 2022-09-30 17:58:04.805285247 +0200
@@ -1,0 +2,8 @@
+Thu Sep 29 15:56:43 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to 1.1.1:
+ Remove chardet<5 requirement by @karolinku in #6
+ Add support for Python 3.11
+ Remove code that for support Python 2
+
+-------------------------------------------------------------------
Old:
----
mbstrdecoder-1.1.0.tar.gz
New:
----
mbstrdecoder-1.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-mbstrdecoder.spec ++++++
--- /var/tmp/diff_new_pack.cIlqKn/_old 2022-09-30 17:58:05.177286042 +0200
+++ /var/tmp/diff_new_pack.cIlqKn/_new 2022-09-30 17:58:05.181286051 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-mbstrdecoder
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-mbstrdecoder
-Version: 1.1.0
+Version: 1.1.1
Release: 0
Summary: Multi-byte character string decoder
License: MIT
++++++ mbstrdecoder-1.1.0.tar.gz -> mbstrdecoder-1.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/PKG-INFO new/mbstrdecoder-1.1.1/PKG-INFO
--- old/mbstrdecoder-1.1.0/PKG-INFO 2021-09-20 12:23:46.480000000 +0200
+++ new/mbstrdecoder-1.1.1/PKG-INFO 2022-08-11 16:40:57.938940000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: mbstrdecoder
-Version: 1.1.0
+Version: 1.1.1
Summary: multi-byte character string decoder
Home-page: https://github.com/thombashi/mbstrdecoder
Author: Tsuyoshi Hombashi
@@ -9,7 +9,6 @@
Project-URL: Source, https://github.com/thombashi/mbstrdecoder
Project-URL: Tracker, https://github.com/thombashi/mbstrdecoder/issues
Keywords: multi-byte character,unicode,decoder
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
@@ -21,6 +20,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
@@ -111,5 +111,3 @@
============
- Python 3.6+
- `Python package dependencies (automatically installed) <https://github.com/thombashi/mbstrdecoder/network/dependencies>`__
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/mbstrdecoder/__version__.py new/mbstrdecoder-1.1.1/mbstrdecoder/__version__.py
--- old/mbstrdecoder-1.1.0/mbstrdecoder/__version__.py 2021-09-20 12:19:46.000000000 +0200
+++ new/mbstrdecoder-1.1.1/mbstrdecoder/__version__.py 2022-08-11 16:39:34.000000000 +0200
@@ -1,6 +1,6 @@
__author__ = "Tsuyoshi Hombashi"
__copyright__ = f"Copyright 2016, {__author__}"
__license__ = "MIT License"
-__version__ = "1.1.0"
+__version__ = "1.1.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi(a)gmail.com"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/mbstrdecoder/_mbstrdecoder.py new/mbstrdecoder-1.1.1/mbstrdecoder/_mbstrdecoder.py
--- old/mbstrdecoder-1.1.0/mbstrdecoder/_mbstrdecoder.py 2021-09-20 12:08:59.000000000 +0200
+++ new/mbstrdecoder-1.1.1/mbstrdecoder/_mbstrdecoder.py 2022-08-11 15:51:23.000000000 +0200
@@ -188,7 +188,7 @@
try:
detect = chardet.detect(encoded_str)
except TypeError:
- detect = {}
+ detect = {} # type: ignore
detect_encoding = detect.get("encoding")
confidence = detect.get("confidence")
@@ -237,10 +237,6 @@
except UnicodeDecodeError:
self.__codec = None
continue
- except UnicodeEncodeError:
- # already a unicode string (python 2)
- self.__codec = "unicode"
- return encoded_str
except AttributeError:
if isinstance(encoded_str, str):
# already a unicode string (python 3)
@@ -249,14 +245,6 @@
if not encoded_str:
return encoded_str
- try:
- # python 2 compatibility
- encoded_str.encode("ascii")
- self.__codec = "ascii"
- return encoded_str
- except UnicodeEncodeError:
- pass
-
return encoded_str
self.__codec = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/mbstrdecoder.egg-info/PKG-INFO new/mbstrdecoder-1.1.1/mbstrdecoder.egg-info/PKG-INFO
--- old/mbstrdecoder-1.1.0/mbstrdecoder.egg-info/PKG-INFO 2021-09-20 12:23:46.000000000 +0200
+++ new/mbstrdecoder-1.1.1/mbstrdecoder.egg-info/PKG-INFO 2022-08-11 16:40:57.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: mbstrdecoder
-Version: 1.1.0
+Version: 1.1.1
Summary: multi-byte character string decoder
Home-page: https://github.com/thombashi/mbstrdecoder
Author: Tsuyoshi Hombashi
@@ -9,7 +9,6 @@
Project-URL: Source, https://github.com/thombashi/mbstrdecoder
Project-URL: Tracker, https://github.com/thombashi/mbstrdecoder/issues
Keywords: multi-byte character,unicode,decoder
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
@@ -21,6 +20,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
@@ -111,5 +111,3 @@
============
- Python 3.6+
- `Python package dependencies (automatically installed) <https://github.com/thombashi/mbstrdecoder/network/dependencies>`__
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/mbstrdecoder.egg-info/requires.txt new/mbstrdecoder-1.1.1/mbstrdecoder.egg-info/requires.txt
--- old/mbstrdecoder-1.1.0/mbstrdecoder.egg-info/requires.txt 2021-09-20 12:23:46.000000000 +0200
+++ new/mbstrdecoder-1.1.1/mbstrdecoder.egg-info/requires.txt 2022-08-11 16:40:57.000000000 +0200
@@ -1,4 +1,4 @@
-chardet<5,>=3.0.4
+chardet<6,>=3.0.4
[test]
Faker>=1.0.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/pyproject.toml new/mbstrdecoder-1.1.1/pyproject.toml
--- old/mbstrdecoder-1.1.0/pyproject.toml 2021-09-20 12:07:14.000000000 +0200
+++ new/mbstrdecoder-1.1.1/pyproject.toml 2022-08-11 15:51:11.000000000 +0200
@@ -18,6 +18,7 @@
)/
| docs/conf.py
'''
+target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311']
[tool.isort]
known_third_party = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/requirements/requirements.txt new/mbstrdecoder-1.1.1/requirements/requirements.txt
--- old/mbstrdecoder-1.1.0/requirements/requirements.txt 2021-03-20 05:14:04.000000000 +0100
+++ new/mbstrdecoder-1.1.1/requirements/requirements.txt 2022-08-11 11:39:50.000000000 +0200
@@ -1 +1 @@
-chardet>=3.0.4,<5
+chardet>=3.0.4,<6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/setup.py new/mbstrdecoder-1.1.1/setup.py
--- old/mbstrdecoder-1.1.0/setup.py 2021-09-20 12:16:52.000000000 +0200
+++ new/mbstrdecoder-1.1.1/setup.py 2022-08-11 15:51:11.000000000 +0200
@@ -68,6 +68,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mbstrdecoder-1.1.0/tox.ini new/mbstrdecoder-1.1.1/tox.ini
--- old/mbstrdecoder-1.1.0/tox.ini 2021-09-20 12:16:08.000000000 +0200
+++ new/mbstrdecoder-1.1.1/tox.ini 2022-08-11 15:51:11.000000000 +0200
@@ -1,6 +1,6 @@
[tox]
envlist =
- py{36,37,38,39,310}
+ py{36,37,38,39,310,311}
pypy3
clean
cov
@@ -8,8 +8,8 @@
lint
[testenv]
-deps =
- .[test]
+extras =
+ test
commands =
pytest {posargs:-vv}
@@ -31,19 +31,19 @@
cleanpy --all --exclude-envs .
[testenv:cov]
+extras =
+ test
deps =
- .[test]
coverage[toml]>=5
commands =
coverage run -m pytest {posargs:-vv}
coverage report -m
[testenv:fmt]
-basepython = python3.8
skip_install = true
deps =
- autoflake
- black
+ autoflake>=1.4
+ black>=22.6
isort>=5
commands =
autoflake --in-place --recursive --remove-all-unused-imports --ignore-init-module-imports .
@@ -51,12 +51,11 @@
black setup.py test mbstrdecoder
[testenv:lint]
-basepython = python3.8
skip_install = true
deps =
codespell
- mypy>=0.902
- pylama
+ mypy>=0.971
+ pylama>=8.4.1
types-chardet
commands =
python setup.py check
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-mdurl for openSUSE:Factory checked in at 2022-09-30 17:57:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mdurl (Old)
and /work/SRC/openSUSE:Factory/.python-mdurl.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mdurl"
Fri Sep 30 17:57:45 2022 rev:2 rq:1007062 version:0.1.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mdurl/python-mdurl.changes 2022-04-28 23:08:30.280719331 +0200
+++ /work/SRC/openSUSE:Factory/.python-mdurl.new.2275/python-mdurl.changes 2022-09-30 17:58:04.157283862 +0200
@@ -1,0 +2,9 @@
+Thu Sep 29 15:58:15 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to 0.1.2
+ Add a decode test with invalid utf8
+ * Bump version: 0.1.1 ��� 0.1.2
+ * Fix decode returning utf-16 code units (#9)
+ * [pre-commit.ci] pre-commit autoupdate (#8)
+
+-------------------------------------------------------------------
Old:
----
python-mdurl-0.1.1.tar.gz
New:
----
python-mdurl-0.1.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-mdurl.spec ++++++
--- /var/tmp/diff_new_pack.e0U6H5/_old 2022-09-30 17:58:04.613284836 +0200
+++ /var/tmp/diff_new_pack.e0U6H5/_new 2022-09-30 17:58:04.613284836 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-mdurl
-Version: 0.1.1
+Version: 0.1.2
Release: 0
Summary: Markdown URL utilities
License: MIT
@@ -26,10 +26,10 @@
Source: https://github.com/executablebooks/mdurl/archive/refs/tags/%{version}.tar.g…
#Source: https://files.pythonhosted.org/packages/source/m/mdurl/mdurl-%%{version}.ta…
BuildRequires: python-rpm-macros
-BuildRequires: %{python_module setuptools}
-BuildRequires: %{python_module pip}
BuildRequires: %{python_module flit}
+BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildArch: noarch
%python_subpackages
++++++ python-mdurl-0.1.1.tar.gz -> python-mdurl-0.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdurl-0.1.1/.bumpversion.cfg new/mdurl-0.1.2/.bumpversion.cfg
--- old/mdurl-0.1.1/.bumpversion.cfg 2022-04-12 22:15:42.000000000 +0200
+++ new/mdurl-0.1.2/.bumpversion.cfg 2022-08-14 14:35:21.000000000 +0200
@@ -2,7 +2,7 @@
commit = True
tag = True
tag_name = {new_version}
-current_version = 0.1.1
+current_version = 0.1.2
[bumpversion:file:pyproject.toml]
search = version = "{current_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdurl-0.1.1/.pre-commit-config.yaml new/mdurl-0.1.2/.pre-commit-config.yaml
--- old/mdurl-0.1.1/.pre-commit-config.yaml 2022-04-12 22:15:42.000000000 +0200
+++ new/mdurl-0.1.2/.pre-commit-config.yaml 2022-08-14 14:35:21.000000000 +0200
@@ -6,7 +6,7 @@
additional_dependencies:
- mdformat-gfm
- repo: https://github.com/asottile/yesqa
- rev: 35cf7dc24fa922927caded7a21b2a8cb04bf8e10 # frozen: v1.3.0
+ rev: 265e9ff7c83add4949f81bb5fe14f4a743ffb04c # frozen: v1.4.0
hooks:
- id: yesqa
additional_dependencies:
@@ -18,7 +18,7 @@
hooks:
- id: isort
- repo: https://github.com/psf/black
- rev: ae2c0758c9e61a385df9700dc9c231bf54887041 # frozen: 22.3.0
+ rev: f6c139c5215ce04fd3e73a900f1372942d58eca0 # frozen: 22.6.0
hooks:
- id: black
- repo: https://github.com/myint/docformatter
@@ -26,7 +26,7 @@
hooks:
- id: docformatter
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: db7346d375eda68a0174f2c057dd97f2fbffe030 # frozen: v4.2.0
+ rev: 3298ddab3c13dd77d6ce1fc0baf97691430d84b0 # frozen: v4.3.0
hooks:
- id: check-yaml
- repo: https://github.com/pre-commit/pygrep-hooks
@@ -36,7 +36,7 @@
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- repo: https://github.com/PyCQA/flake8
- rev: cbeb4c9c4137cff1568659fcc48e8b85cddd0c8d # frozen: 4.0.1
+ rev: f8e1b317742036ff11ff86356fd2b68147e169f7 # frozen: 5.0.4
hooks:
- id: flake8
additional_dependencies:
@@ -44,7 +44,7 @@
- flake8-builtins
- flake8-comprehensions
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: bdfdfda2221c4fd123dbc9ac0f2074951bd5af58 # frozen: v0.942
+ rev: fde4bb992b03943ecb94207a52739ba07957bd06 # frozen: v0.971
hooks:
- id: mypy
args: ["--scripts-are-modules"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdurl-0.1.1/pyproject.toml new/mdurl-0.1.2/pyproject.toml
--- old/mdurl-0.1.1/pyproject.toml 2022-04-12 22:15:42.000000000 +0200
+++ new/mdurl-0.1.2/pyproject.toml 2022-08-14 14:35:21.000000000 +0200
@@ -4,7 +4,7 @@
[project]
name = "mdurl"
-version = "0.1.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
+version = "0.1.2" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
description = "Markdown URL utilities"
authors = [
{ name = "Taneli Hukkinen", email = "hukkin(a)users.noreply.github.com" },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdurl-0.1.1/src/mdurl/__init__.py new/mdurl-0.1.2/src/mdurl/__init__.py
--- old/mdurl-0.1.1/src/mdurl/__init__.py 2022-04-12 22:15:42.000000000 +0200
+++ new/mdurl-0.1.2/src/mdurl/__init__.py 2022-08-14 14:35:21.000000000 +0200
@@ -9,7 +9,7 @@
"parse",
"URL",
)
-__version__ = "0.1.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
+__version__ = "0.1.2" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
from mdurl._decode import DECODE_COMPONENT_CHARS, DECODE_DEFAULT_CHARS, decode
from mdurl._encode import ENCODE_COMPONENT_CHARS, ENCODE_DEFAULT_CHARS, encode
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdurl-0.1.1/src/mdurl/_decode.py new/mdurl-0.1.2/src/mdurl/_decode.py
--- old/mdurl-0.1.1/src/mdurl/_decode.py 2022-04-12 22:15:42.000000000 +0200
+++ new/mdurl-0.1.2/src/mdurl/_decode.py 2022-08-14 14:35:21.000000000 +0200
@@ -55,12 +55,11 @@
b2 = int(seq[i + 4 : i + 6], 16)
if (b2 & 0xC0) == 0x80:
- chr_ = ((b1 << 6) & 0x7C0) | (b2 & 0x3F)
-
- if chr_ < 0x80:
- result += "\ufffd\ufffd"
- else:
- result += chr(chr_)
+ all_bytes = bytes((b1, b2))
+ try:
+ result += all_bytes.decode()
+ except UnicodeDecodeError:
+ result += "\ufffd" * 2
i += 3
i += 3 # emulate JS for loop statement3
@@ -72,12 +71,11 @@
b3 = int(seq[i + 7 : i + 9], 16)
if (b2 & 0xC0) == 0x80 and (b3 & 0xC0) == 0x80:
- chr_ = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F)
-
- if chr_ < 0x800 or (chr_ >= 0xD800 and chr_ <= 0xDFFF):
- result += "\ufffd\ufffd\ufffd"
- else:
- result += chr(chr_)
+ all_bytes = bytes((b1, b2, b3))
+ try:
+ result += all_bytes.decode()
+ except UnicodeDecodeError:
+ result += "\ufffd" * 3
i += 6
i += 3 # emulate JS for loop statement3
@@ -90,18 +88,11 @@
b4 = int(seq[i + 10 : i + 12], 16)
if (b2 & 0xC0) == 0x80 and (b3 & 0xC0) == 0x80 and (b4 & 0xC0) == 0x80:
- chr_ = (
- ((b1 << 18) & 0x1C0000)
- | ((b2 << 12) & 0x3F000)
- | ((b3 << 6) & 0xFC0)
- | (b4 & 0x3F)
- )
-
- if chr_ < 0x10000 or chr_ > 0x10FFFF:
- result += "\ufffd\ufffd\ufffd\ufffd"
- else:
- chr_ -= 0x10000
- result += chr(0xD800 + (chr_ >> 10)) + chr(0xDC00 + (chr_ & 0x3FF))
+ all_bytes = bytes((b1, b2, b3, b4))
+ try:
+ result += all_bytes.decode()
+ except UnicodeDecodeError:
+ result += "\ufffd" * 4
i += 9
i += 3 # emulate JS for loop statement3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mdurl-0.1.1/tests/test_decode.py new/mdurl-0.1.2/tests/test_decode.py
--- old/mdurl-0.1.1/tests/test_decode.py 1970-01-01 01:00:00.000000000 +0100
+++ new/mdurl-0.1.2/tests/test_decode.py 2022-08-14 14:35:21.000000000 +0200
@@ -0,0 +1,5 @@
+from mdurl import decode
+
+
+def test_decode_multi_byte():
+ assert decode("https://host.invalid/%F0%9F%91%A9") == "https://host.invalid/����"
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-metaextract for openSUSE:Factory checked in at 2022-09-30 17:57:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-metaextract (Old)
and /work/SRC/openSUSE:Factory/.python-metaextract.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-metaextract"
Fri Sep 30 17:57:44 2022 rev:17 rq:1007061 version:1.0.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-metaextract/python-metaextract.changes 2021-12-09 19:46:04.549146730 +0100
+++ /work/SRC/openSUSE:Factory/.python-metaextract.new.2275/python-metaextract.changes 2022-09-30 17:58:03.405282254 +0200
@@ -1,0 +2,12 @@
+Thu Sep 29 16:10:29 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to Version 1.0.8:
+ * Merge pull request #15 from toabctl/gh-instead-of-travis
+ * Move from Travis CI to github actions
+ * Merge pull request #14 from toabctl/drop-pytest-runner
+ * Post release version bump to 1.0.8
+ * setup.py: drop setup_requires including setuptools and pytest-runner
+ * Merge pull request #12 from jayvdb/json_dumps_default
+ * Use default json encoder 'str'
+
+-------------------------------------------------------------------
Old:
----
1.0.7.tar.gz
New:
----
1.0.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-metaextract.spec ++++++
--- /var/tmp/diff_new_pack.j3MRKF/_old 2022-09-30 17:58:03.889283289 +0200
+++ /var/tmp/diff_new_pack.j3MRKF/_new 2022-09-30 17:58:03.893283298 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-metaextract
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-metaextract
-Version: 1.0.7
+Version: 1.0.8
Release: 0
Summary: Module to collect metadata for Python modules
License: Apache-2.0
++++++ 1.0.7.tar.gz -> 1.0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metaextract-1.0.7/.github/workflows/ci.yaml new/metaextract-1.0.8/.github/workflows/ci.yaml
--- old/metaextract-1.0.7/.github/workflows/ci.yaml 1970-01-01 01:00:00.000000000 +0100
+++ new/metaextract-1.0.8/.github/workflows/ci.yaml 2021-12-08 14:15:24.000000000 +0100
@@ -0,0 +1,36 @@
+name: metaextract
+
+on:
+ - push
+ - pull_request
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.9
+ - name: Install tox and any other packages
+ run: pip install tox
+ - name: Run tox
+ run: tox -e pep8
+ unittest:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python: ["2.7", "3.7", "3.8", "3.9"]
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+ - name: Install tox and any other packages
+ run: pip install tox
+ - name: Run tox
+ # Run tox using the version of Python in `PATH`
+ run: tox -e py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metaextract-1.0.7/.travis.yml new/metaextract-1.0.8/.travis.yml
--- old/metaextract-1.0.7/.travis.yml 2020-03-29 07:21:37.000000000 +0200
+++ new/metaextract-1.0.8/.travis.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-sudo: false
-language: python
-matrix:
- include:
- - python: 3.7
- env: TOX_ENV=pep8
- - python: 2.7
- env: TOX_ENV=py27
- - python: 3.7
- env: TOX_ENV=py37
-install:
-- pip install tox
-script:
-- tox -e $TOX_ENV
-deploy:
- provider: pypi
- user: toabctl
- password:
- secure: XU/FV623lG48aBV/CuCgOK2idAcfIjkEJbHGXp76Z2XK1+IdbBuIQZF9Lq0OnGINjYpJ/QvgeycciXW1q3WYniZcMaxOYwfQvuqkfZzehwkQWma0HaCadMkSMaKrHR0TvLNb/nNvYC6jf4A9AHcRDdHW7LOngSSls/WpsFPKTeO5gvwxmwjzotdo14NlJtFxcEdwZtRIhVH2FsvUOWsK0K5X9/137mLA/GQ3rDvkQQ/9d1lLUiGWcsEDeeY1FjsG0Wp2b4b6JpTkqMBe2WTzmnDL1JJ8Q8XyTOpCxoXujvMJQD0NxUyrc3iWzAuiyJ4JIgqqw1w4DtQKrUScwVE+NZaItnE3bAox/QbKU/xjE1WMQ4PBsGMW6ljhDZbNIMWlKuEDGRxKhWOO2kDUfdQhmCzxUfb3FcEf87OLQ8Va5Bv2NUbSBiS6MScTFFeR7wA5ikT63yWE9uEnotlm0kYI33G/PC1TEYhWHFoV/KPdhmTRF0hNiMrYB6Q3pbPa0fqPHlfVKw4W3M+tCyqCCHgyO9mhLou2cnenkaVuqPIH2V/fAhFFkagFndvAe1m4iY1QI3Ir4RtDrZzk+yEZHVCBup47uFh11JA0Li/DK4EfWt+vXqYO4cNRSpBhXG2r+FnF4vly4MIGJ/hjJDY25S3AZ7co/RNn2m5FwH8klGnVfHU=
- on:
- tags: true
- distributions: sdist bdist_wheel
- repo: toabctl/metaextract
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metaextract-1.0.7/metaextract/__init__.py new/metaextract-1.0.8/metaextract/__init__.py
--- old/metaextract-1.0.7/metaextract/__init__.py 2020-03-29 07:21:37.000000000 +0200
+++ new/metaextract-1.0.8/metaextract/__init__.py 2021-12-08 14:15:24.000000000 +0100
@@ -15,4 +15,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "1.0.7"
+__version__ = "1.0.8"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metaextract-1.0.7/setup.py new/metaextract-1.0.8/setup.py
--- old/metaextract-1.0.7/setup.py 2020-03-29 07:21:37.000000000 +0200
+++ new/metaextract-1.0.8/setup.py 2021-12-08 14:15:24.000000000 +0100
@@ -34,7 +34,6 @@
author_email="thomasbechtold(a)jpberlin.de",
url='http://github.com/toabctl/metaextract',
packages=['metaextract'],
- setup_requires=["setuptools", "pytest-runner"],
cmdclass=metaextract.setup.get_cmdclass(),
tests_require=["flake8", "pytest", "mock"],
classifiers=[
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-minio for openSUSE:Factory checked in at 2022-09-30 17:57:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-minio (Old)
and /work/SRC/openSUSE:Factory/.python-minio.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-minio"
Fri Sep 30 17:57:42 2022 rev:15 rq:1007059 version:7.1.11
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-minio/python-minio.changes 2022-06-16 18:22:26.680270454 +0200
+++ /work/SRC/openSUSE:Factory/.python-minio.new.2275/python-minio.changes 2022-09-30 17:58:01.561278312 +0200
@@ -1,0 +2,19 @@
+Thu Sep 29 16:28:14 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to version 7.1.12:
+ What's Changed
+ fix documentation display composing by @j13tw in #1231
+ fget_object(): add progress support by @moon-jong in #1235
+ Updating documentation links to new URLs by @djwfyi in #1239
+ list_objects: fix parsing user metadata as per MinIO server by @harshavardhana in #1240
+
+- Update to version 7.1.11:
+ select: yield available payload fully by requested num_bytes by @kldtz in #1225
+
+- Update to version 7.1.10:
+ fget_object(): remove resume support. by @balamurugana in #1215
+ fix lifecycle config rule validation by @balamurugana in #1217
+ error out if lifecycle rule has null filter by @balamurugana in #1219
+ EventIterable: Reconnect on closed response. by @balamurugana in #1222
+
+-------------------------------------------------------------------
Old:
----
minio-7.1.9.tar.gz
New:
----
minio-7.1.11.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-minio.spec ++++++
--- /var/tmp/diff_new_pack.02O3Dc/_old 2022-09-30 17:58:01.989279227 +0200
+++ /var/tmp/diff_new_pack.02O3Dc/_new 2022-09-30 17:58:01.997279245 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-minio
-Version: 7.1.9
+Version: 7.1.11
Release: 0
Summary: Minio library for Amazon S3 compatible cloud storage
License: Apache-2.0
++++++ minio-7.1.9.tar.gz -> minio-7.1.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/PKG-INFO new/minio-7.1.11/PKG-INFO
--- old/minio-7.1.9/PKG-INFO 2022-06-11 23:34:02.843320600 +0200
+++ new/minio-7.1.11/PKG-INFO 2022-07-25 07:47:56.479161000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: minio
-Version: 7.1.9
+Version: 7.1.11
Summary: MinIO Python SDK for Amazon S3 Compatible Cloud Storage
Home-page: https://github.com/minio/minio-py
Download-URL: https://github.com/minio/minio-py/releases
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/minio/__init__.py new/minio-7.1.11/minio/__init__.py
--- old/minio-7.1.9/minio/__init__.py 2022-06-11 23:29:34.000000000 +0200
+++ new/minio-7.1.11/minio/__init__.py 2022-07-25 07:46:29.000000000 +0200
@@ -33,7 +33,7 @@
__title__ = "minio-py"
__author__ = "MinIO, Inc."
-__version__ = "7.1.9"
+__version__ = "7.1.11"
__license__ = "Apache 2.0"
__copyright__ = "Copyright 2015, 2016, 2017, 2018, 2019, 2020 MinIO, Inc."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/minio/api.py new/minio-7.1.11/minio/api.py
--- old/minio-7.1.9/minio/api.py 2022-06-11 23:29:34.000000000 +0200
+++ new/minio-7.1.11/minio/api.py 2022-07-25 07:46:29.000000000 +0200
@@ -1047,27 +1047,18 @@
tmp_file_path = (
tmp_file_path or file_path + "." + stat.etag + ".part.minio"
)
- try:
- tmp_file_stat = os.stat(tmp_file_path)
- except IOError:
- tmp_file_stat = None # Ignore this error.
- offset = tmp_file_stat.st_size if tmp_file_stat else 0
- if offset > stat.size:
- os.remove(tmp_file_path)
- offset = 0
response = None
try:
response = self.get_object(
bucket_name,
object_name,
- offset=offset,
request_headers=request_headers,
ssec=ssec,
version_id=version_id,
extra_query_params=extra_query_params,
)
- with open(tmp_file_path, "ab") as tmp_file:
+ with open(tmp_file_path, "wb") as tmp_file:
for data in response.stream(amt=1024*1024):
tmp_file.write(data)
if os.path.exists(file_path):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/minio/datatypes.py new/minio-7.1.11/minio/datatypes.py
--- old/minio-7.1.9/minio/datatypes.py 2022-06-11 23:29:34.000000000 +0200
+++ new/minio-7.1.11/minio/datatypes.py 2022-07-25 07:46:29.000000000 +0200
@@ -840,7 +840,7 @@
def __next__(self):
records = None
while not records:
- if not self._response:
+ if not self._response or self._response.closed:
self._response = self._func()
records = self._get_records()
return records
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/minio/lifecycleconfig.py new/minio-7.1.11/minio/lifecycleconfig.py
--- old/minio-7.1.9/minio/lifecycleconfig.py 2022-06-11 23:29:34.000000000 +0200
+++ new/minio-7.1.11/minio/lifecycleconfig.py 2022-07-25 07:46:29.000000000 +0200
@@ -246,6 +246,15 @@
noncurrent_version_transition=None,
transition=None):
check_status(status)
+ if (not abort_incomplete_multipart_upload and not expiration
+ and not noncurrent_version_expiration
+ and not noncurrent_version_transition
+ and not transition):
+ raise ValueError(
+ "at least one of action (AbortIncompleteMultipartUpload, "
+ "Expiration, NoncurrentVersionExpiration, "
+ "NoncurrentVersionTransition or Transition) must be specified "
+ "in a rule")
if not rule_filter:
raise ValueError("Rule filter must be provided")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/minio/select.py new/minio-7.1.11/minio/select.py
--- old/minio-7.1.9/minio/select.py 2022-06-11 23:29:34.000000000 +0200
+++ new/minio-7.1.11/minio/select.py 2022-07-25 07:46:29.000000000 +0200
@@ -420,13 +420,10 @@
Stream extracted payload from response data. Upon completion, caller
should call self.close() to release network resources.
"""
- while True:
- if self._payload:
+ while self._read() > 0:
+ while self._payload:
result = self._payload
if num_bytes < len(self._payload):
result = self._payload[:num_bytes]
self._payload = self._payload[len(result):]
yield result
-
- if self._read() <= 0:
- break
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/minio.egg-info/PKG-INFO new/minio-7.1.11/minio.egg-info/PKG-INFO
--- old/minio-7.1.9/minio.egg-info/PKG-INFO 2022-06-11 23:33:59.000000000 +0200
+++ new/minio-7.1.11/minio.egg-info/PKG-INFO 2022-07-25 07:47:55.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: minio
-Version: 7.1.9
+Version: 7.1.11
Summary: MinIO Python SDK for Amazon S3 Compatible Cloud Storage
Home-page: https://github.com/minio/minio-py
Download-URL: https://github.com/minio/minio-py/releases
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.1.9/tests/functional/tests.py new/minio-7.1.11/tests/functional/tests.py
--- old/minio-7.1.9/tests/functional/tests.py 2022-06-11 23:29:34.000000000 +0200
+++ new/minio-7.1.11/tests/functional/tests.py 2022-07-25 07:46:29.000000000 +0200
@@ -281,7 +281,7 @@
data = _CLIENT.select_object_content(bucket_name, csvfile, request)
# Get the records
records = io.BytesIO()
- for data_bytes in data.stream(10*KB):
+ for data_bytes in data.stream(16):
records.write(data_bytes)
expected_crc = crc32(content.getvalue()) & 0xffffffff
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-minidb for openSUSE:Factory checked in at 2022-09-30 17:57:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-minidb (Old)
and /work/SRC/openSUSE:Factory/.python-minidb.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-minidb"
Fri Sep 30 17:57:43 2022 rev:7 rq:1007060 version:2.0.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-minidb/python-minidb.changes 2021-09-09 23:07:50.384851540 +0200
+++ /work/SRC/openSUSE:Factory/.python-minidb.new.2275/python-minidb.changes 2022-09-30 17:58:02.533280390 +0200
@@ -1,0 +2,6 @@
+Thu Sep 29 16:20:05 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to minidb 2.0.6
+ * Add vacuum_on_close option and Store.vacuum()
+
+-------------------------------------------------------------------
Old:
----
minidb-2.0.5.tar.gz
New:
----
minidb-2.0.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-minidb.spec ++++++
--- /var/tmp/diff_new_pack.pJGPfr/_old 2022-09-30 17:58:02.913281202 +0200
+++ /var/tmp/diff_new_pack.pJGPfr/_new 2022-09-30 17:58:02.917281211 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-minidb
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
%define skip_python2 1
%bcond_without test
Name: python-minidb
-Version: 2.0.5
+Version: 2.0.6
Release: 0
Summary: SQLite3-based store for Python objects
License: ISC
++++++ minidb-2.0.5.tar.gz -> minidb-2.0.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minidb-2.0.5/README.md new/minidb-2.0.6/README.md
--- old/minidb-2.0.5/README.md 2021-06-06 12:47:04.000000000 +0200
+++ new/minidb-2.0.6/README.md 2022-02-17 12:04:53.000000000 +0100
@@ -33,6 +33,13 @@
db.close() to flush the changes to disk, and optionally db.commit() if you
want to save the changes to disk without closing the database.
+By default, `minidb` executes `VACUUM` on the SQLite database on close. You
+can opt-out of this behaviour by passing `vacuum_on_close=False` to the
+`minidb.Store` constructor. You can manually execute a `VACUUM` by calling
+`.vacuum()` on the `minidb.Store` object, this helps reduce the file size
+in case you delete many objects at once. See the
+[SQLite VACUUM docs](https://www.sqlite.org/lang_vacuum.html) for details.
+
To actually store objects, we need to subclass from minidb.Model (which takes
care of all the behind-the-scenes magic for making your class persistable, and
adds methods for working with the database):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minidb-2.0.5/minidb.py new/minidb-2.0.6/minidb.py
--- old/minidb-2.0.5/minidb.py 2021-06-06 12:47:04.000000000 +0200
+++ new/minidb-2.0.6/minidb.py 2022-02-17 12:04:53.000000000 +0100
@@ -5,7 +5,7 @@
# |_|_|_|_|_||_|_\__,_|_.__/
# simple python object store
#
-# Copyright 2009-2010, 2014-2021 Thomas Perl <thp.io>. All rights reserved.
+# Copyright 2009-2010, 2014-2022 Thomas Perl <thp.io>. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -36,7 +36,7 @@
__author__ = 'Thomas Perl <m(a)thp.io>'
-__version__ = '2.0.5'
+__version__ = '2.0.6'
__url__ = 'http://thp.io/2010/minidb/'
__license__ = 'ISC'
@@ -130,10 +130,11 @@
PRIMARY_KEY = ('id', int)
MINIDB_ATTR = '_minidb'
- def __init__(self, filename=':memory:', debug=False, smartupdate=False):
+ def __init__(self, filename=':memory:', debug=False, smartupdate=False, vacuum_on_close=True):
self.db = sqlite3.connect(filename, check_same_thread=False)
self.debug = debug
self.smartupdate = smartupdate
+ self.vacuum_on_close = vacuum_on_close
self.registered = {}
self.lock = threading.RLock()
@@ -165,10 +166,15 @@
with self.lock:
self.db.commit()
+ def vacuum(self):
+ with self.lock:
+ self._execute('VACUUM')
+
def close(self):
with self.lock:
self.db.isolation_level = None
- self._execute('VACUUM')
+ if self.vacuum_on_close:
+ self._execute('VACUUM')
self.db.close()
def _ensure_schema(self, table, slots):
1
0