openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
January 2024
- 1 participants
- 1743 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-gTTS for openSUSE:Factory checked in at 2024-01-03 12:24:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gTTS (Old)
and /work/SRC/openSUSE:Factory/.python-gTTS.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gTTS"
Wed Jan 3 12:24:51 2024 rev:13 rq:1135656 version:2.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gTTS/python-gTTS.changes 2023-12-12 19:32:09.332296053 +0100
+++ /work/SRC/openSUSE:Factory/.python-gTTS.new.28375/python-gTTS.changes 2024-01-03 12:24:56.491375366 +0100
@@ -1,0 +2,6 @@
+Fri Dec 29 12:46:13 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 2.5.0:
+ * Add connection timeout + misc improvements (#440)
+
+-------------------------------------------------------------------
Old:
----
gTTS-2.4.0.tar.gz
New:
----
gTTS-2.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-gTTS.spec ++++++
--- /var/tmp/diff_new_pack.qmkG7z/_old 2024-01-03 12:24:57.767421990 +0100
+++ /var/tmp/diff_new_pack.qmkG7z/_new 2024-01-03 12:24:57.787422721 +0100
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-gTTS
-Version: 2.4.0
+Version: 2.5.0
Release: 0
Summary: Python module to create MP3 files from spoken text via the Google TTS API
License: MIT
@@ -79,5 +79,5 @@
%license LICENSE
%python_alternative %{_bindir}/gtts-cli
%{python_sitelib}/gtts
-%{python_sitelib}/gTTS-%{version}*-info
+%{python_sitelib}/gTTS-%{version}.dist-info
++++++ gTTS-2.4.0.tar.gz -> gTTS-2.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/.github/workflows/autolock.yml new/gTTS-2.5.0/.github/workflows/autolock.yml
--- old/gTTS-2.4.0/.github/workflows/autolock.yml 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/.github/workflows/autolock.yml 2023-12-20 05:16:08.000000000 +0100
@@ -9,7 +9,7 @@
lock:
runs-on: ubuntu-latest
steps:
- - uses: dessant/lock-threads@v4
+ - uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
issue-inactive-days: '15'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/.github/workflows/codecov.yml new/gTTS-2.5.0/.github/workflows/codecov.yml
--- old/gTTS-2.4.0/.github/workflows/codecov.yml 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/.github/workflows/codecov.yml 2023-12-20 05:16:08.000000000 +0100
@@ -21,7 +21,7 @@
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
with:
python-version: "3.12"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/.github/workflows/release.yml new/gTTS-2.5.0/.github/workflows/release.yml
--- old/gTTS-2.4.0/.github/workflows/release.yml 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/.github/workflows/release.yml 2023-12-20 05:16:08.000000000 +0100
@@ -22,11 +22,8 @@
steps:
- name: Release Please
- uses: google-github-actions/release-please-action@v3
+ uses: google-github-actions/release-please-action@v4
id: release
- with:
- release-type: python
- package-name: gTTS
# Only do the rest (package build/push) if a release was created
- name: Checkout
@@ -34,7 +31,7 @@
uses: actions/checkout@v4
- name: Setup Python
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build dependencies
@@ -47,7 +44,7 @@
run: python -m build
- name: Publish package
if: ${{ steps.release.outputs.release_created }}
- uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
+ uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
# References:
# * Release Please:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/.github/workflows/test.yml new/gTTS-2.5.0/.github/workflows/test.yml
--- old/gTTS-2.4.0/.github/workflows/test.yml 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/.github/workflows/test.yml 2023-12-20 05:16:08.000000000 +0100
@@ -29,7 +29,7 @@
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/.github/workflows/update_langs.yml new/gTTS-2.5.0/.github/workflows/update_langs.yml
--- old/gTTS-2.4.0/.github/workflows/update_langs.yml 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/.github/workflows/update_langs.yml 2023-12-20 05:16:08.000000000 +0100
@@ -23,7 +23,7 @@
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install gTTS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/.release-please-manifest.json new/gTTS-2.5.0/.release-please-manifest.json
--- old/gTTS-2.4.0/.release-please-manifest.json 1970-01-01 01:00:00.000000000 +0100
+++ new/gTTS-2.5.0/.release-please-manifest.json 2023-12-20 05:16:08.000000000 +0100
@@ -0,0 +1 @@
+{".":"2.5.0"}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/CHANGELOG.md new/gTTS-2.5.0/CHANGELOG.md
--- old/gTTS-2.4.0/CHANGELOG.md 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/CHANGELOG.md 2023-12-20 05:16:08.000000000 +0100
@@ -1,5 +1,12 @@
# Changelog
+## [2.5.0](https://github.com/pndurette/gTTS/compare/v2.4.0...v2.5.0) (2023-12-20)
+
+
+### Features
+
+* Add connection timeout + misc improvements ([#440](https://github.com/pndurette/gTTS/issues/440)) ([bcdb79d](https://github.com/pndurette/gTTS/commit/bcdb79df41e76c5c1e4fea638…)
+
## [2.4.0](https://github.com/pndurette/gTTS/compare/v2.3.2...v2.4.0) (2023-10-03)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/__init__.py new/gTTS-2.5.0/gtts/__init__.py
--- old/gTTS-2.4.0/gtts/__init__.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/__init__.py 2023-12-20 05:16:08.000000000 +0100
@@ -2,4 +2,4 @@
from .version import __version__ # noqa: F401
from .tts import gTTS, gTTSError
-__all__ = ["gTTS", "gTTSError"]
+__all__ = ["__version__", "gTTS", "gTTSError"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/lang.py new/gTTS-2.5.0/gtts/lang.py
--- old/gTTS-2.4.0/gtts/lang.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/lang.py 2023-12-20 05:16:08.000000000 +0100
@@ -38,7 +38,7 @@
"""Define extra languages.
Returns:
- dict: A dictionnary of extra languages manually defined.
+ dict: A dictionary of extra languages manually defined.
Variations of the ones generated in `_main_langs`,
observed to provide different dialects or accents or
@@ -64,7 +64,7 @@
Returns:
string: The language tag, as-is if not deprecated,
- or a fallack if it exits.
+ or a fallback if it exits.
Example:
``en-GB`` returns ``en``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/tests/test_tts.py new/gTTS-2.5.0/gtts/tests/test_tts.py
--- old/gTTS-2.4.0/gtts/tests/test_tts.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/tests/test_tts.py 2023-12-20 05:16:08.000000000 +0100
@@ -10,7 +10,7 @@
# Testing all languages takes some time.
# Set TEST_LANGS envvar to choose languages to test.
# * 'main': Languages extracted from the Web
-# * 'extra': Languagee set in Languages.EXTRA_LANGS
+# * 'extra': Language set in Languages.EXTRA_LANGS
# * 'all': All of the above
# * <csv>: Languages tags list to test
# Unset TEST_LANGS to test everything ('all')
@@ -125,7 +125,7 @@
def test_infer_msg():
- """Infer message sucessfully based on context"""
+ """Infer message successfully based on context"""
# Without response:
@@ -163,7 +163,7 @@
error500 = gTTSError(tts=tts500, response=response500)
assert (
error500.msg
- == "500 (ccc) from TTS API. Probable cause: Uptream API error. Try again later."
+ == "500 (ccc) from TTS API. Probable cause: Upstream API error. Try again later."
)
# Unknown (ex. 100)
@@ -190,5 +190,23 @@
tts.save(filename)
+(a)pytest.mark.net
+def test_timeout(tmp_path):
+ # Check default timeout
+ tts = gTTS(text="test")
+ assert tts.timeout is None
+
+ # Check passed in timeout
+ timeout = 1.2
+ tts = gTTS(text="test", timeout=timeout)
+ assert tts.timeout == timeout
+
+ # Make sure an exception is raised when a timeout occurs
+ tts = gTTS(text="test", timeout=0.000001)
+ filename = tmp_path / "save.mp3"
+ with pytest.raises(gTTSError):
+ tts.save(filename)
+
+
if __name__ == "__main__":
pytest.main(["-x", __file__])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/tests/test_utils.py new/gTTS-2.5.0/gtts/tests/test_utils.py
--- old/gTTS-2.4.0/gtts/tests/test_utils.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/tests/test_utils.py 2023-12-20 05:16:08.000000000 +0100
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import pytest
-from gtts.utils import _minimize, _len, _clean_tokens, _translate_url
+from gtts.utils import _minimize, _clean_tokens, _translate_url
delim = " "
Lmax = 10
@@ -32,12 +32,12 @@
def test_len_ascii():
text = "Bacon ipsum dolor sit amet flank corned beef."
- assert _len(text) == 45
+ assert len(text) == 45
def test_len_unicode():
text = u"但在一个重要的任务上"
- assert _len(text) == 10
+ assert len(text) == 10
def test_only_space_and_punc():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/tokenizer/core.py new/gTTS-2.5.0/gtts/tokenizer/core.py
--- old/gTTS-2.4.0/gtts/tokenizer/core.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/tokenizer/core.py 2023-12-20 05:16:08.000000000 +0100
@@ -229,7 +229,7 @@
Args:
regex_funcs (list): List of compiled ``regex`` objects. Each
- functions's pattern will be joined into a single pattern and
+ function's pattern will be joined into a single pattern and
compiled.
flags: ``re`` flag(s) to compile with the final regex. Defaults to
``re.IGNORECASE``
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/tokenizer/pre_processors.py new/gTTS-2.5.0/gtts/tokenizer/pre_processors.py
--- old/gTTS-2.4.0/gtts/tokenizer/pre_processors.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/tokenizer/pre_processors.py 2023-12-20 05:16:08.000000000 +0100
@@ -6,7 +6,7 @@
def tone_marks(text):
"""Add a space after tone-modifying punctuation.
- Because the `tone_marks` tokenizer case will split after a tone-modidfying
+ Because the `tone_marks` tokenizer case will split after a tone-modifying
punctuation mark, make sure there's whitespace after.
"""
@@ -30,7 +30,7 @@
def abbreviations(text):
"""Remove periods after an abbreviation from a list of known
- abbrevations that can be spoken the same without that period. This
+ abbreviations that can be spoken the same without that period. This
prevents having to handle tokenization of that period.
Note:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/tokenizer/tokenizer_cases.py new/gTTS-2.5.0/gtts/tokenizer/tokenizer_cases.py
--- old/gTTS-2.4.0/gtts/tokenizer/tokenizer_cases.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/tokenizer/tokenizer_cases.py 2023-12-20 05:16:08.000000000 +0100
@@ -35,7 +35,7 @@
def colon():
"""Colon case.
- Match a colon ":" only if not preceeded by a digit.
+ Match a colon ":" only if not preceded by a digit.
Mainly to prevent a cut in the middle of time notations e.g. 10:01
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/tts.py new/gTTS-2.5.0/gtts/tts.py
--- old/gTTS-2.4.0/gtts/tts.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/tts.py 2023-12-20 05:16:08.000000000 +0100
@@ -9,7 +9,7 @@
from gtts.lang import _fallback_deprecated_lang, tts_langs
from gtts.tokenizer import Tokenizer, pre_processors, tokenizer_cases
-from gtts.utils import _clean_tokens, _len, _minimize, _translate_url
+from gtts.utils import _clean_tokens, _minimize, _translate_url
__all__ = ["gTTS", "gTTSError"]
@@ -50,7 +50,7 @@
to catch a language error early. If set to ``True``,
a ``ValueError`` is raised if ``lang`` doesn't exist.
Setting ``lang_check`` to ``False`` skips Web requests
- (to validate language) and therefore speeds up instanciation.
+ (to validate language) and therefore speeds up instantiation.
Default is ``True``.
pre_processor_funcs (list): A list of zero or more functions that are
called to transform (pre-process) text before tokenizing. Those
@@ -73,6 +73,10 @@
tokenizer_cases.other_punctuation
]).run
+ timeout (float or tuple, optional): Seconds to wait for the server to
+ send data before giving up, as a float, or a ``(connect timeout,
+ read timeout)`` tuple. ``None`` will wait forever (default).
+
See Also:
:doc:`Pre-processing and tokenizing <tokenizer>`
@@ -116,6 +120,7 @@
tokenizer_cases.other_punctuation,
]
).run,
+ timeout=None,
):
# Debug
@@ -157,6 +162,8 @@
self.pre_processor_funcs = pre_processor_funcs
self.tokenizer_func = tokenizer_func
+ self.timeout = timeout
+
def _tokenize(self, text):
# Pre-clean
text = text.strip()
@@ -166,7 +173,7 @@
log.debug("pre-processing: %s", pp)
text = pp(text)
- if _len(text) <= self.GOOGLE_TTS_MAX_CHARS:
+ if len(text) <= self.GOOGLE_TTS_MAX_CHARS:
return _clean_tokens([text])
# Tokenize
@@ -184,7 +191,7 @@
# Filter empty tokens, post-minimize
tokens = [t for t in min_tokens if t]
- return min_tokens
+ return tokens
def _prepare_requests(self):
"""Created the TTS API the request(s) without sending them.
@@ -233,7 +240,7 @@
"""Get TTS API request bodies(s) that would be sent to the TTS API.
Returns:
- list: A list of TTS API request bodiess to make.
+ list: A list of TTS API request bodies to make.
"""
return [pr.body for pr in self._prepare_requests()]
@@ -259,7 +266,10 @@
with requests.Session() as s:
# Send request
r = s.send(
- request=pr, proxies=urllib.request.getproxies(), verify=False
+ request=pr,
+ verify=False,
+ proxies=urllib.request.getproxies(),
+ timeout=self.timeout,
)
log.debug("headers-%i: %s", idx, r.request.headers)
@@ -372,6 +382,6 @@
% self.tts.lang
)
elif status >= 500:
- cause = "Uptream API error. Try again later."
+ cause = "Upstream API error. Try again later."
return "{}. Probable cause: {}".format(premise, cause)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/utils.py new/gTTS-2.5.0/gtts/utils.py
--- old/gTTS-2.4.0/gtts/utils.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/utils.py 2023-12-20 05:16:08.000000000 +0100
@@ -36,9 +36,9 @@
# i.e. prevent a recursive infinite loop on `the_string[0:0]`
# if `the_string` starts with `delim` and is larger than `max_size`
if the_string.startswith(delim):
- the_string = the_string[_len(delim) :]
+ the_string = the_string[len(delim):]
- if _len(the_string) > max_size:
+ if len(the_string) > max_size:
try:
# Find the highest index of `delim` in `the_string[0:max_size]`
# i.e. `the_string` will be cut in half on `delim` index
@@ -53,24 +53,6 @@
return [the_string]
-def _len(text):
- """Same as ``len(text)`` for a string but that decodes
- ``text`` first in Python 2.x
-
- Args:
- text (string): String to get the size of.
-
- Returns:
- int: The size of the string.
- """
- try:
- # Python 2
- return len(unicode(text))
- except NameError: # pragma: no cover
- # Python 3
- return len(text)
-
-
def _clean_tokens(tokens):
"""Clean a list of strings
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/gtts/version.py new/gTTS-2.5.0/gtts/version.py
--- old/gTTS-2.4.0/gtts/version.py 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/gtts/version.py 2023-12-20 05:16:08.000000000 +0100
@@ -1 +1 @@
-__version__ = "2.4.0"
+__version__ = "2.5.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/pyproject.toml new/gTTS-2.5.0/pyproject.toml
--- old/gTTS-2.4.0/pyproject.toml 2023-10-03 18:50:36.000000000 +0200
+++ new/gTTS-2.5.0/pyproject.toml 2023-12-20 05:16:08.000000000 +0100
@@ -1,6 +1,6 @@
[project]
name = "gTTS"
-version = "2.4.0"
+version = "2.5.0"
description = "gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API"
authors = [{name = "Pierre Nicolas Durette", email = "pndurette(a)gmail.com"}]
requires-python = ">=3.7"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gTTS-2.4.0/release-please-config.json new/gTTS-2.5.0/release-please-config.json
--- old/gTTS-2.4.0/release-please-config.json 1970-01-01 01:00:00.000000000 +0100
+++ new/gTTS-2.5.0/release-please-config.json 2023-12-20 05:16:08.000000000 +0100
@@ -0,0 +1,8 @@
+{
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/co…",
+ "plugins": ["sentence-case"],
+ "release-type": "python",
+ "packages": {
+ ".": {}
+ }
+}
\ 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-gp-libs for openSUSE:Factory checked in at 2024-01-03 12:24:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gp-libs (Old)
and /work/SRC/openSUSE:Factory/.python-gp-libs.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gp-libs"
Wed Jan 3 12:24:48 2024 rev:2 rq:1135655 version:0.0.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gp-libs/python-gp-libs.changes 2023-11-24 23:33:51.077349544 +0100
+++ /work/SRC/openSUSE:Factory/.python-gp-libs.new.28375/python-gp-libs.changes 2024-01-03 12:24:55.051322751 +0100
@@ -1,0 +2,7 @@
+Fri Dec 29 12:45:26 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 0.0.5:
+ * Move CodeQL from advanced configuration file to GitHub’s default
+ * Add docstrings to functions, methods, classes, and packages
+
+-------------------------------------------------------------------
Old:
----
gp_libs-0.0.4.tar.gz
New:
----
gp_libs-0.0.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-gp-libs.spec ++++++
--- /var/tmp/diff_new_pack.nI1OLw/_old 2024-01-03 12:24:55.611343212 +0100
+++ /var/tmp/diff_new_pack.nI1OLw/_new 2024-01-03 12:24:55.615343359 +0100
@@ -17,18 +17,18 @@
Name: python-gp-libs
-Version: 0.0.4
+Version: 0.0.5
Release: 0
Summary: Internal utilities for projects following git-pull python package spec
License: MIT
URL: https://gp-libs.git-pull.com
Source: https://files.pythonhosted.org/packages/source/g/gp-libs/gp_libs-%{version}…
-BuildRequires: python-rpm-macros
-BuildRequires: %{python_module pip}
-BuildRequires: %{python_module wheel}
-BuildRequires: %{python_module poetry-core >= 1.0.0}
BuildRequires: %{python_module docutils}
BuildRequires: %{python_module myst-parser}
+BuildRequires: %{python_module pip}
+BuildRequires: %{python_module poetry-core >= 1.0.0}
+BuildRequires: %{python_module wheel}
+BuildRequires: python-rpm-macros
# SECTION test
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-rerunfailures}
++++++ gp_libs-0.0.4.tar.gz -> gp_libs-0.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/PKG-INFO new/gp_libs-0.0.5/PKG-INFO
--- old/gp_libs-0.0.4/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/gp_libs-0.0.5/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: gp-libs
-Version: 0.0.4
+Version: 0.0.5
Summary: Internal utilities for projects following git-pull python package spec
Home-page: https://gp-libs.git-pull.com
License: MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/pyproject.toml new/gp_libs-0.0.5/pyproject.toml
--- old/gp_libs-0.0.4/pyproject.toml 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/pyproject.toml 2023-12-03 10:54:20.496441600 +0100
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gp-libs"
-version = "0.0.4"
+version = "0.0.5"
description = "Internal utilities for projects following git-pull python package spec"
license = "MIT"
authors = ["Tony Narlock <tony(a)git-pull.com>"]
@@ -99,6 +99,7 @@
"TRY", # Trycertatops
"PERF", # Perflint
"RUF", # Ruff-specific rules
+ "D", # pydocstyle
]
[tool.ruff.isort]
@@ -112,6 +113,9 @@
]
combine-as-imports = true
+[tool.ruff.pydocstyle]
+convention = "numpy"
+
[tool.ruff.per-file-ignores]
"*/__init__.py" = ["F401"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/doctest_docutils.py new/gp_libs-0.0.5/src/doctest_docutils.py
--- old/gp_libs-0.0.4/src/doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/src/doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,3 +1,4 @@
+"""Doctest module for docutils."""
import doctest
import functools
import linecache
@@ -30,23 +31,24 @@
def is_allowed_version(version: str, spec: str) -> bool:
"""Check `spec` satisfies `version` or not.
+
This obeys PEP-440 specifiers:
https://peps.python.org/pep-0440/#version-specifiers
+
Some examples:
- >>> is_allowed_version('3.3', '<=3.5')
- True
- >>> is_allowed_version('3.3', '<=3.2')
- False
- >>> is_allowed_version('3.3', '>3.2, <4.0')
- True
+
+ >>> is_allowed_version('3.3', '<=3.5')
+ True
+ >>> is_allowed_version('3.3', '<=3.2')
+ False
+ >>> is_allowed_version('3.3', '>3.2, <4.0')
+ True
"""
return Version(version) in SpecifierSet(spec)
class TestDirective(Directive):
- """
- Base class for doctest-related directives.
- """
+ """Base class for doctest-related directives."""
has_content = True
required_arguments = 0
@@ -62,6 +64,7 @@
node.source, node.line = self.get_source_info()
def run(self) -> t.List[Node]:
+ """Run docutils test directive."""
# use ordinary docutils nodes for test code: they get special attributes
# so that our builder recognizes them, and the other builders are happy.
code = "\n".join(self.content)
@@ -135,14 +138,20 @@
class TestsetupDirective(TestDirective):
+ """Test setup directive."""
+
option_spec: t.ClassVar[OptionSpec] = {"skipif": directives.unchanged_required}
class TestcleanupDirective(TestDirective):
+ """Test cleanup directive."""
+
option_spec: t.ClassVar[OptionSpec] = {"skipif": directives.unchanged_required}
class DoctestDirective(TestDirective):
+ """Doctest directive."""
+
option_spec: t.ClassVar[OptionSpec] = {
"hide": directives.flag,
"no-trim-doctest-flags": directives.flag,
@@ -154,6 +163,8 @@
class MockTabDirective(TestDirective):
+ """Mock tab directive."""
+
def run(self) -> t.List[Node]:
"""Parse a mock-tabs directive."""
self.assert_has_content()
@@ -164,6 +175,7 @@
def setup() -> t.Dict[str, t.Any]:
+ """Configure doctest for doctest_docutils."""
directives.register_directive("testsetup", TestsetupDirective)
directives.register_directive("testcleanup", TestcleanupDirective)
directives.register_directive("doctest", DoctestDirective)
@@ -181,6 +193,8 @@
class DocTestFinderNameDoesNotExist(ValueError):
+ """Raised with doctest lookup name not provided."""
+
def __init__(self, string: str):
return super().__init__(
"DocTestFinder.find: name must be given "
@@ -189,11 +203,11 @@
class DocutilsDocTestFinder:
- """
- A class used to extract the DocTests that are relevant to a given
- docutils file. Doctests can be extracted from the following directive
- types: doctest_block (doctest), DocTestDirective. Myst-parser is also
- supported for parsing markdown files.
+ """DocTestFinder for doctest-docutils.
+
+ Class used to extract the DocTests relevant to a docutils file. Doctests are
+ extracted from the following directive types: doctest_block (doctest),
+ DocTestDirective. Myst-parser is also supported for parsing markdown files.
"""
def __init__(
@@ -201,13 +215,11 @@
verbose: bool = False,
parser: "doctest.DocTestParser" = parser,
):
- """
- Create a new doctest finder.
+ """Create a new doctest finder.
- The optional argument `parser` specifies a class or
- function that should be used to create new DocTest objects (or
- objects that implement the same interface as DocTest). The
- signature for this factory function should match the signature
+ The optional argument `parser` specifies a class or function that should be used
+ to create new DocTest objects (or objects that implement the same interface as
+ DocTest). The signature for this factory function should match the signature
of the DocTest constructor.
"""
self._parser = parser
@@ -220,20 +232,14 @@
globs: t.Optional[t.Dict[str, t.Any]] = None,
extraglobs: t.Optional[t.Dict[str, t.Any]] = None,
) -> t.List[doctest.DocTest]:
- """
- Return a list of the DocTests that are defined by the given
- string (its parsed directives).
-
- The globals for each DocTest is formed by combining `globs`
- and `extraglobs` (bindings in `extraglobs` override bindings
- in `globs`). A new copy of the globals dictionary is created
- for each DocTest. If `globs` is not specified, then it
- defaults to the module's `__dict__`, if specified, or {}
- otherwise. If `extraglobs` is not specified, then it defaults
- to {}.
+ """Return list of the DocTests defined by given string (its parsed directives).
+ The globals for each DocTest is formed by combining `globs` and `extraglobs`
+ (bindings in `extraglobs` override bindings in `globs`). A new copy of the
+ globals dictionary is created for each DocTest. If `globs` is not specified,
+ then it defaults to the module's `__dict__`, if specified, or {} otherwise.
+ If `extraglobs` is not specified, then it defaults to {}.
"""
-
# If name was not specified, then extract it from the string.
if name is None:
name = getattr(string, "__name__", None)
@@ -272,9 +278,7 @@
seen: t.Dict[int, int],
source_path: t.Optional[pathlib.Path] = None,
) -> None:
- """
- Find tests for the given string, and add them to `tests`.
- """
+ """Find tests for the given string, and add them to `tests`."""
if self._verbose:
print("Finding tests in %s" % name)
@@ -369,10 +373,12 @@
def _from_module(
self, module: t.Optional[t.Union[str, types.ModuleType]], object: object
) -> bool:
- """`cached_property` objects are never considered a part
+ """Return true if the given object lives in the given module.
+
+ `cached_property` objects are never considered a part
of the 'current module'. As such they are skipped by doctest.
Here we override `_from_module` to check the underlying
- function instead. https://github.com/python/cpython/issues/107995
+ function instead. https://github.com/python/cpython/issues/107995.
"""
if isinstance(object, functools.cached_property):
object = object.func
@@ -394,10 +400,7 @@
globs: t.Dict[str, t.Any],
source_lines: t.List[str],
) -> doctest.DocTest:
- """
- Return a DocTest for the given string, if it defines a docstring;
- otherwise, return None.
- """
+ """Return a DocTest for given string, or return None."""
lineno = int(source_lines[0])
# Return a DocTest for this string.
@@ -405,6 +408,8 @@
class TestDocutilsPackageRelativeError(Exception):
+ """Raise when doctest_docutils is called for package not relative to module."""
+
def __init__(self) -> None:
return super().__init__(
"Package may only be specified for module-relative paths."
@@ -476,7 +481,9 @@
def _test() -> int:
- """Changes from standard library at 3.10
+ """Execute doctest module via CLI.
+
+ Port changes from standard library at 3.10:
- Sets up logging.basicLogging(level=logging.DEBUG) w/ args.verbose
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/gp_libs.py new/gp_libs-0.0.5/src/gp_libs.py
--- old/gp_libs-0.0.4/src/gp_libs.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/src/gp_libs.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,7 +1,8 @@
+"""Metadata package for gp-libs."""
__title__ = "gp-libs"
__package_name__ = "gp_libs"
__description__ = "Internal utilities for git-pull projects"
-__version__ = "0.0.4"
+__version__ = "0.0.5"
__author__ = "Tony Narlock"
__github__ = "https://github.com/git-pull/gp-libs"
__docs__ = "https://gp-libs.git-pull.com"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/linkify_issues.py new/gp_libs-0.0.5/src/linkify_issues.py
--- old/gp_libs-0.0.4/src/linkify_issues.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/src/linkify_issues.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,3 +1,4 @@
+"""Autolinking extension for Sphinx."""
import re
import typing as t
@@ -12,9 +13,12 @@
class LinkifyIssues(SphinxTransform):
+ """Autolink references for Sphinx."""
+
default_priority = 999
def apply(self) -> None:
+ """Apply Sphinx transform."""
config = self.document.settings.env.config
issue_re: re.Pattern[str] = (
re.compile(config.issue_re)
@@ -58,12 +62,15 @@
class SetupDict(t.TypedDict):
+ """Setup mapping for Sphinx app."""
+
version: str
parallel_read_safe: bool
parallel_write_safe: bool
def setup(app: Sphinx) -> SetupDict:
+ """Initialize Sphinx extension for linkify_issues."""
app.add_transform(LinkifyIssues)
app.add_config_value("issue_re", re.compile(DEFAULT_ISSUE_RE), "env")
app.add_config_value(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/pytest_doctest_docutils.py new/gp_libs-0.0.5/src/pytest_doctest_docutils.py
--- old/gp_libs-0.0.4/src/pytest_doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/src/pytest_doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,6 +1,4 @@
-"""pytest_doctest_docutils
-
-pytest plugin for doctest w/ reStructuredText and markdown
+"""pytest plugin for doctest w/ reStructuredText and markdown.
.. seealso::
@@ -40,6 +38,7 @@
def pytest_addoption(parser: "Parser") -> None:
+ """Add options to py.test for doctest_doctests."""
group = parser.getgroup("collect")
group.addoption(
"--doctest-docutils-modules",
@@ -66,6 +65,7 @@
def pytest_unconfigure() -> None:
+ """Unconfigure hook for pytest-doctest-docutils."""
global RUNNER_CLASS
RUNNER_CLASS = None
@@ -74,6 +74,7 @@
def pytest_collect_file(
file_path: pathlib.Path, parent: pytest.Collector
) -> t.Optional[t.Union["DocTestDocutilsFile", "_pytest.doctest.DoctestModule"]]:
+ """Test collector for pytest-doctest-docutils."""
config = parent.config
if file_path.suffix == ".py":
if config.option.doctestmodules and not any(
@@ -179,9 +180,12 @@
class DocutilsDocTestRunner(doctest.DocTestRunner):
+ """DocTestRunner for doctest_docutils."""
+
def summarize( # type: ignore
self, out: "_Out", verbose: t.Optional[bool] = None
) -> t.Tuple[int, int]:
+ """Summarize the test runs."""
string_io = io.StringIO()
old_stdout = sys.stdout
sys.stdout = string_io
@@ -211,7 +215,10 @@
class DocTestDocutilsFile(pytest.Module):
+ """Pytest module for doctest_docutils."""
+
def collect(self) -> t.Iterable["DoctestItem"]:
+ """Collect tests for pytest module."""
setup()
encoding = self.config.getini("doctest_encoding")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/__init__.py new/gp_libs-0.0.5/tests/__init__.py
--- old/gp_libs-0.0.4/tests/__init__.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/tests/__init__.py 2023-12-03 10:54:20.496441600 +0100
@@ -0,0 +1 @@
+"""Tests for gp_libs package."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/conftest.py new/gp_libs-0.0.5/tests/conftest.py
--- old/gp_libs-0.0.4/tests/conftest.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/tests/conftest.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,3 +1,12 @@
+"""Conftest.py (root-level).
+
+We keep this in root pytest fixtures in pytest's doctest plugin to be available, as well
+as avoiding conftest.py from being included in the wheel, in addition to pytest_plugin
+for pytester only being available via the root directory.
+
+See "pytest_plugins in non-top-level conftest files" in
+https://docs.pytest.org/en/stable/deprecations.html
+"""
import pathlib
import typing as t
@@ -10,6 +19,8 @@
class MakeAppParams(t.Protocol):
+ """Typing protocol for sphinx make_app_params."""
+
def __call__(
self,
#: index content
@@ -17,6 +28,7 @@
*args: object,
**kwargs: t.Any,
) -> AppParams:
+ """Create Sphinx App factory with params."""
...
@@ -26,6 +38,8 @@
app_params: AppParams,
tmp_path: pathlib.Path,
) -> t.Generator[t.Callable[[t.Any], AppParams], None, None]:
+ """Return Sphinx App factory, accepts custom params."""
+
def fn(
#: index content
index: t.Optional[t.Union[t.IO[str], str]] = None,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/test_doctest_docutils.py new/gp_libs-0.0.5/tests/test_doctest_docutils.py
--- old/gp_libs-0.0.4/tests/test_doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/tests/test_doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,3 +1,4 @@
+"""Tests for doctest_docutils."""
import doctest
import pathlib
import textwrap
@@ -10,6 +11,8 @@
class DocTestFinderFixture(t.NamedTuple):
+ """Test fixture for doctest_docutils."""
+
# pytest
test_id: str
@@ -185,6 +188,8 @@
class FilePathModeNotImplemented(Exception):
+ """Raised if file_path_mode not supported."""
+
def __init__(self, file_path_mode: str) -> None:
return super().__init__(f"No file_path_mode supported for {file_path_mode}")
@@ -201,6 +206,7 @@
tests_found: int,
file_path_mode: str,
) -> None:
+ """Test for doctest_docutils."""
# Initialize variables
tests_path = tmp_path / "tests"
first_test_key = next(iter(files.keys()))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/test_linkify_issues.py new/gp_libs-0.0.5/tests/test_linkify_issues.py
--- old/gp_libs-0.0.4/tests/test_linkify_issues.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/tests/test_linkify_issues.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,3 +1,4 @@
+"""Tests for linkify_issues extension for sphinx."""
import pathlib
import typing as t
@@ -9,6 +10,8 @@
class LinkTestFixture(t.NamedTuple):
+ """Pytest fixtures for linkify_issues."""
+
# pytest
test_id: str
@@ -47,6 +50,7 @@
text: str,
issue_id: str,
) -> None:
+ """Test linkification of issues."""
args, kwargs = make_app_params(
index=text,
confoverrides={"issue_url_tpl": issue_url_tpl, "extensions": "linkify_issues"},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/test_pytest_doctest_docutils.py new/gp_libs-0.0.5/tests/test_pytest_doctest_docutils.py
--- old/gp_libs-0.0.4/tests/test_pytest_doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100
+++ new/gp_libs-0.0.5/tests/test_pytest_doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100
@@ -1,3 +1,4 @@
+"""Test pytest plugin for doctest_docutils."""
import textwrap
import typing as t
@@ -8,6 +9,8 @@
class PytestDocTestFinderFixture(t.NamedTuple):
+ """Pytest fixture for DocTestFinder."""
+
# pytest
test_id: str
@@ -199,6 +202,7 @@
files: FixtureFileDict,
tests_found: int,
) -> None:
+ """Verify DocTestFinder's collection of doctests."""
# Initialize variables
pytester.plugins = ["pytest_doctest_docutils"]
pytester.makefile(
@@ -233,6 +237,7 @@
pytester: _pytest.pytester.Pytester,
monkeypatch: pytest.MonkeyPatch,
) -> None:
+ """Test pytest plugin with python file doctests."""
# Initialize variables
pytester.plugins = ["pytest_doctest_docutils"]
pytester.makefile(
@@ -304,6 +309,7 @@
pytester: _pytest.pytester.Pytester,
monkeypatch: pytest.MonkeyPatch,
) -> None:
+ """Test pytest plugin with doctests in markdown."""
# Initialize variables
pytester.plugins = ["pytest_doctest_docutils"]
pytester.makefile(
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-xsge_lighting for openSUSE:Factory checked in at 2024-01-03 12:24:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xsge_lighting (Old)
and /work/SRC/openSUSE:Factory/.python-xsge_lighting.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xsge_lighting"
Wed Jan 3 12:24:45 2024 rev:4 rq:1135653 version:1.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xsge_lighting/python-xsge_lighting.changes 2021-06-01 10:37:49.080849440 +0200
+++ /work/SRC/openSUSE:Factory/.python-xsge_lighting.new.28375/python-xsge_lighting.changes 2024-01-03 12:24:53.659271888 +0100
@@ -1,0 +2,6 @@
+Fri Dec 29 12:28:21 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 1.0.3:
+ * Relicensed to LGPL
+
+-------------------------------------------------------------------
Old:
----
xsge_lighting-1.0.2.tar.gz
New:
----
xsge_lighting-1.0.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-xsge_lighting.spec ++++++
--- /var/tmp/diff_new_pack.ggPmhm/_old 2024-01-03 12:24:54.183291035 +0100
+++ /var/tmp/diff_new_pack.ggPmhm/_new 2024-01-03 12:24:54.183291035 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-xsge_lighting
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,18 +16,17 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%define skip_python2 1
-%define skip_python36 1
+%{?sle15_python_module_pythons}
Name: python-xsge_lighting
-Version: 1.0.2
+Version: 1.0.3
Release: 0
Summary: xSGE Lighting Library
-License: GPL-3.0-or-later
+License: LGPL-3.0-or-later
URL: https://python-sge.github.io/
#Git-Clone: https://github.com/python-sge/xsge
Source: https://files.pythonhosted.org/packages/source/x/xsge_lighting/xsge_lightin…
-BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module pip}
+BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros
Requires: python-sge-pygame >= 1.0
Requires: python-six >= 1.4.0
@@ -47,14 +46,15 @@
%setup -q -n xsge_lighting-%{version}
%build
-%python_build
+%pyproject_wheel
%install
-%python_install
+%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%files %{python_files}
%doc README
%license xsge_lighting/COPYING
-%{python_sitelib}/*
+%{python_sitelib}/xsge_lighting
+%{python_sitelib}/xsge_lighting-%{version}.dist-info
++++++ xsge_lighting-1.0.2.tar.gz -> xsge_lighting-1.0.3.tar.gz ++++++
++++ 6158 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-wheezy.template for openSUSE:Factory checked in at 2024-01-03 12:24:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wheezy.template (Old)
and /work/SRC/openSUSE:Factory/.python-wheezy.template.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wheezy.template"
Wed Jan 3 12:24:42 2024 rev:4 rq:1136485 version:3.2.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wheezy.template/python-wheezy.template.changes 2023-05-31 21:55:20.345303866 +0200
+++ /work/SRC/openSUSE:Factory/.python-wheezy.template.new.28375/python-wheezy.template.changes 2024-01-03 12:24:52.115215473 +0100
@@ -1,0 +2,15 @@
+Wed Jan 3 10:37:27 UTC 2024 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 3.2.2:
+ * fix: added none type to builder rule union for value
+ * fix: updated build markup value type with union of str and
+ none
+
+-------------------------------------------------------------------
+Fri Dec 29 10:12:40 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 3.2.1:
+ * fix: typing issues with cython.
+ * fix: test nocover pragma for conditional type definition.
+
+-------------------------------------------------------------------
Old:
----
wheezy.template-3.1.0.tar.gz
New:
----
wheezy.template-3.2.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-wheezy.template.spec ++++++
--- /var/tmp/diff_new_pack.xp1SNC/_old 2024-01-03 12:24:53.095251280 +0100
+++ /var/tmp/diff_new_pack.xp1SNC/_new 2024-01-03 12:24:53.099251427 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-wheezy.template
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,16 @@
Name: python-wheezy.template
-Version: 3.1.0
+Version: 3.2.2
Release: 0
Summary: A lightweight template library
License: MIT
Group: Development/Languages/Python
URL: https://github.com/akornatskyy/wheezy.template
Source: https://files.pythonhosted.org/packages/source/w/wheezy.template/wheezy.tem…
+BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
@@ -44,10 +46,10 @@
%build
export CFLAGS="%{optflags}"
-%python_build
+%pyproject_wheel
%install
-%python_install
+%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/wheezy.template
%python_expand %fdupes %{buildroot}%{$python_sitelib}
++++++ wheezy.template-3.1.0.tar.gz -> wheezy.template-3.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/PKG-INFO new/wheezy.template-3.2.2/PKG-INFO
--- old/wheezy.template-3.1.0/PKG-INFO 2021-04-17 09:07:39.007938000 +0200
+++ new/wheezy.template-3.2.2/PKG-INFO 2024-01-02 12:12:02.930339600 +0100
@@ -1,75 +1,11 @@
Metadata-Version: 2.1
Name: wheezy.template
-Version: 3.1.0
+Version: 3.2.2
Summary: A lightweight template library
Home-page: https://github.com/akornatskyy/wheezy.template
Author: Andriy Kornatskyy
Author-email: andriy.kornatskyy(a)live.com
License: MIT
-Description: # wheezy.template
-
- [![Build Status](https://travis-ci.org/akornatskyy/wheezy.template.svg?branch=master…
- [![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master)
- [![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=late…
- [![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template)
-
- [wheezy.template](https://pypi.org/project/wheezy.template/) is a
- [python](https://www.python.org) package written in pure Python code. It
- is a lightweight template library. The design goals achived:
-
- - **Compact, Expressive, Clean:** Minimizes the number of keystrokes
- required to build a template. Enables fast and well read coding. You
- do not need to explicitly denote statement blocks within HTML
- (unlike other template systems), the parser is smart enough to
- understand your code. This enables a compact and expressive syntax
- which is really clean and just pleasure to type.
- - **Intuitive, No time to Learn:** Basic Python programming skills
- plus HTML markup. You are productive just from start. Use full power
- of Python with minimal markup required to denote python statements.
- - **Do Not Repeat Yourself:** Master layout templates for inheritance;
- include and import directives for maximum reuse.
- - **Blazingly Fast:** Maximum rendering performance: ultimate speed
- and context preprocessor features.
-
- Simple template:
-
- ```txt
- @require(user, items)
- Welcome, @user.name!
- @if items:
- @for i in items:
- @i.name: @i.price!s.
- @end
- @else:
- No items found.
- @end
- ```
-
- It is optimized for performance, well tested and documented.
-
- Resources:
-
- - [source code](https://github.com/akornatskyy/wheezy.template),
- [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos)
- and [issues](https://github.com/akornatskyy/wheezy.template/issues)
- tracker are available on
- [github](https://github.com/akornatskyy/wheezy.template)
- - [documentation](https://wheezytemplate.readthedocs.io/en/latest/)
-
- ## Install
-
- [wheezy.template](https://pypi.org/project/wheezy.template/) requires
- [python](https://www.python.org) version 3.6+. It is independent of
- operating system. You can install it from
- [pypi](https://pypi.org/project/wheezy.template/) site:
-
- ```sh
- pip install -U wheezy.template
- ```
-
- If you run into any issue or have comments, go ahead and add on
- [github](https://github.com/akornatskyy/wheezy.template).
-
Keywords: html markup template preprocessor
Platform: any
Classifier: Environment :: Web Environment
@@ -78,10 +14,10 @@
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP
@@ -89,5 +25,70 @@
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Widget Sets
Classifier: Topic :: Text Processing :: Markup :: HTML
-Requires-Python: >=3.6
+Requires-Python: >=3.8
Description-Content-Type: text/markdown
+License-File: LICENSE
+
+# wheezy.template
+
+[![tests](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml)
+[![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master)
+[![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=late…
+[![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template)
+
+[wheezy.template](https://pypi.org/project/wheezy.template/) is a
+[python](https://www.python.org) package written in pure Python code. It
+is a lightweight template library. The design goals achived:
+
+- **Compact, Expressive, Clean:** Minimizes the number of keystrokes
+ required to build a template. Enables fast and well read coding. You
+ do not need to explicitly denote statement blocks within HTML
+ (unlike other template systems), the parser is smart enough to
+ understand your code. This enables a compact and expressive syntax
+ which is really clean and just pleasure to type.
+- **Intuitive, No time to Learn:** Basic Python programming skills
+ plus HTML markup. You are productive just from start. Use full power
+ of Python with minimal markup required to denote python statements.
+- **Do Not Repeat Yourself:** Master layout templates for inheritance;
+ include and import directives for maximum reuse.
+- **Blazingly Fast:** Maximum rendering performance: ultimate speed
+ and context preprocessor features.
+
+Simple template:
+
+```txt
+@require(user, items)
+Welcome, @user.name!
+@if items:
+ @for i in items:
+ @i.name: @i.price!s.
+ @end
+@else:
+ No items found.
+@end
+```
+
+It is optimized for performance, well tested and documented.
+
+Resources:
+
+- [source code](https://github.com/akornatskyy/wheezy.template),
+ [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos)
+ and [issues](https://github.com/akornatskyy/wheezy.template/issues)
+ tracker are available on
+ [github](https://github.com/akornatskyy/wheezy.template)
+- [documentation](https://wheezytemplate.readthedocs.io/en/latest/)
+
+## Install
+
+[wheezy.template](https://pypi.org/project/wheezy.template/) requires
+[python](https://www.python.org) version 3.8+. It is independent of
+operating system. You can install it from
+[pypi](https://pypi.org/project/wheezy.template/) site:
+
+```sh
+pip install -U wheezy.template
+```
+
+If you run into any issue or have comments, go ahead and add on
+[github](https://github.com/akornatskyy/wheezy.template).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/README.md new/wheezy.template-3.2.2/README.md
--- old/wheezy.template-3.1.0/README.md 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/README.md 2024-01-02 12:11:54.000000000 +0100
@@ -1,6 +1,6 @@
# wheezy.template
-[![Build Status](https://travis-ci.org/akornatskyy/wheezy.template.svg?branch=master…
+[![tests](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master)
[![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=late…
[![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template)
@@ -51,7 +51,7 @@
## Install
[wheezy.template](https://pypi.org/project/wheezy.template/) requires
-[python](https://www.python.org) version 3.6+. It is independent of
+[python](https://www.python.org) version 3.8+. It is independent of
operating system. You can install it from
[pypi](https://pypi.org/project/wheezy.template/) site:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/setup.py new/wheezy.template-3.2.2/setup.py
--- old/wheezy.template-3.1.0/setup.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/setup.py 2024-01-02 12:11:54.000000000 +0100
@@ -38,7 +38,7 @@
setup(
name="wheezy.template",
version=VERSION,
- python_requires=">=3.6",
+ python_requires=">=3.8",
description="A lightweight template library",
long_description=README,
long_description_content_type="text/markdown",
@@ -53,10 +53,10 @@
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
- "Programming Language :: Python :: 3.6",
- "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/__init__.py new/wheezy.template-3.2.2/src/wheezy/__init__.py
--- old/wheezy.template-3.1.0/src/wheezy/__init__.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/__init__.py 2024-01-02 12:11:54.000000000 +0100
@@ -7,4 +7,6 @@
except ImportError:
from pkgutil import extend_path
- __path__: typing.Iterable[str] = extend_path(__path__, __name__)
+ __path__: typing.List[str] = extend_path( # type: ignore[no-redef]
+ __path__, __name__
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/__init__.py new/wheezy.template-3.2.2/src/wheezy/template/__init__.py
--- old/wheezy.template-3.1.0/src/wheezy/template/__init__.py 2021-04-17 09:07:37.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/__init__.py 2024-01-02 12:12:02.000000000 +0100
@@ -17,4 +17,4 @@
"Preprocessor",
)
-__version__ = "3.1.0"
+__version__ = "3.2.2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/builder.py new/wheezy.template-3.2.2/src/wheezy/template/builder.py
--- old/wheezy.template-3.1.0/src/wheezy/template/builder.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/builder.py 2024-01-02 12:11:54.000000000 +0100
@@ -16,7 +16,6 @@
class BlockBuilder(Builder):
-
__slots__ = ("rules", "indent", "lineno", "buf")
def __init__(
@@ -87,7 +86,6 @@
class SourceBuilder(object):
-
__slots__ = ("rules", "lineno")
def __init__(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/comp.py new/wheezy.template-3.2.2/src/wheezy/template/comp.py
--- old/wheezy.template-3.1.0/src/wheezy/template/comp.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/comp.py 2024-01-02 12:11:54.000000000 +0100
@@ -1,4 +1,5 @@
import ast
+import sys
import typing
from _thread import allocate_lock # noqa
@@ -7,3 +8,17 @@
node = compile(source, name, "exec", ast.PyCF_ONLY_AST)
ast.increment_lineno(node, lineno)
return node
+
+
+if sys.version_info <= (3, 9, 0): # pragma: nocover
+ from typing import List, Tuple
+else: # pragma: nocover
+ Tuple = tuple # type: ignore
+ List = list # type: ignore
+
+
+__all__ = (
+ "adjust_source_lineno",
+ "Tuple",
+ "List",
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/console.py new/wheezy.template-3.2.2/src/wheezy/template/console.py
--- old/wheezy.template-3.1.0/src/wheezy/template/console.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/console.py 2024-01-02 12:11:54.000000000 +0100
@@ -10,7 +10,7 @@
from wheezy.template.loader import FileLoader
try:
- from wheezy.html.utils import escape_html as escape # type: ignore[import]
+ from wheezy.html.utils import escape_html as escape
except ImportError: # pragma: nocover
from html import escape
@@ -77,9 +77,7 @@
elif o == "-s":
d.searchpath = a.split(";")
elif o == "-w": # pragma: nocover
- from wheezy.html.ext.template import ( # type: ignore[import]
- WhitespaceExtension,
- )
+ from wheezy.html.ext.template import WhitespaceExtension
d.extensions.append(WhitespaceExtension())
if not value:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/engine.py new/wheezy.template-3.2.2/src/wheezy/template/engine.py
--- old/wheezy.template-3.1.0/src/wheezy/template/engine.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/engine.py 2024-01-02 12:11:54.000000000 +0100
@@ -1,3 +1,4 @@
+import sys
import typing
from types import ModuleType
@@ -44,7 +45,9 @@
self.global_vars = {"_r": self.render, "_i": self.import_name}
self.loader = loader
self.template_class = template_class or Template
- self.compiler = Compiler(self.global_vars, -2)
+ self.compiler = Compiler(
+ self.global_vars, sys.version_info >= (3, 11, 0) and -1 or -2
+ )
self.lexer = Lexer(**lexer_scan(extensions))
self.parser = Parser(**parser_scan(extensions))
self.builder = SourceBuilder(**builder_scan(extensions))
@@ -66,7 +69,6 @@
) -> str:
"""Renders template by name in given context."""
try:
-
return self.renders[name](ctx, local_defs, super_defs)
except KeyError:
self.compile_template(name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/ext/code.py new/wheezy.template-3.2.2/src/wheezy/template/ext/code.py
--- old/wheezy.template-3.1.0/src/wheezy/template/ext/code.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/ext/code.py 2024-01-02 12:11:54.000000000 +0100
@@ -1,6 +1,7 @@
import re
import typing
+from wheezy.template.comp import Tuple
from wheezy.template.typing import Builder, LexerRule, ParserRule, Token
from wheezy.template.utils import find_balanced
@@ -48,13 +49,10 @@
"""Includes support for embedded python code."""
def __init__(self, token_start: str = "@") -> None:
-
self.lexer_rules: typing.Mapping[int, LexerRule] = {
300: (re.compile(r"\s*%s(?=\()" % token_start), code_token),
}
parser_rules: typing.Mapping[str, ParserRule] = {"code": parse_code}
- builder_rules: typing.List[typing.Tuple[str, typing.Any]] = [
- ("code", build_code)
- ]
+ builder_rules: typing.List[Tuple[str, typing.Any]] = [("code", build_code)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/ext/core.py new/wheezy.template-3.2.2/src/wheezy/template/ext/core.py
--- old/wheezy.template-3.1.0/src/wheezy/template/ext/core.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/ext/core.py 2024-01-02 12:11:54.000000000 +0100
@@ -1,6 +1,7 @@
import re
import typing
+from wheezy.template.comp import Tuple
from wheezy.template.typing import Builder, LexerRule, ParserConfig, Token
from wheezy.template.utils import find_all_balanced
@@ -83,12 +84,12 @@
return value.rstrip()[8:-1]
-def parse_import(value: str) -> typing.Tuple[str, str]:
+def parse_import(value: str) -> Tuple[str, str]:
name, var = value[7:].rsplit(" as ", 1)
return name, var
-def parse_from(value: str) -> typing.Tuple[str, str, str]:
+def parse_from(value: str) -> Tuple[str, str, str]:
name, var = value[5:].rsplit(" import ", 1)
s = var.rsplit(" as ", 1)
if len(s) == 2:
@@ -100,7 +101,7 @@
def parse_var(
value: str,
-) -> typing.Tuple[str, typing.Optional[typing.List[str]]]:
+) -> Tuple[str, typing.Optional[typing.List[str]]]:
if "!!" not in value:
return value, None
var, var_filter = value.rsplit("!!", 1)
@@ -144,7 +145,7 @@
def build_import(
- builder: Builder, lineno: int, token: str, value: typing.Tuple[str, str]
+ builder: Builder, lineno: int, token: str, value: Tuple[str, str]
) -> bool:
assert token == "import "
name, var = value
@@ -156,7 +157,7 @@
builder: Builder,
lineno: int,
token: str,
- value: typing.Tuple[str, str, str],
+ value: Tuple[str, str, str],
) -> bool:
assert token == "from "
name, var, alias = value
@@ -353,7 +354,7 @@
def build_markup(
- builder: Builder, lineno: int, token: str, value: str
+ builder: Builder, lineno: int, token: str, value: typing.Union[str, None]
) -> bool:
assert token == "markup"
if value:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/ext/determined.py new/wheezy.template-3.2.2/src/wheezy/template/ext/determined.py
--- old/wheezy.template-3.1.0/src/wheezy/template/ext/determined.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/ext/determined.py 2024-01-02 12:11:54.000000000 +0100
@@ -1,6 +1,7 @@
import re
import typing
+from wheezy.template.comp import Tuple
from wheezy.template.utils import find_balanced
RE_ARGS = re.compile(r'\s*(?P<expr>(([\'"]).*?\3|.+?))\s*\,')
@@ -117,7 +118,7 @@
def parse_params(
text: str,
-) -> typing.Tuple[typing.List[str], typing.Mapping[str, str]]:
+) -> Tuple[typing.List[str], typing.Mapping[str, str]]:
"""Parses function parameters.
>>> parse_params('')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/loader.py new/wheezy.template-3.2.2/src/wheezy/template/loader.py
--- old/wheezy.template-3.1.0/src/wheezy/template/loader.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/loader.py 2024-01-02 12:11:54.000000000 +0100
@@ -4,6 +4,7 @@
import time
import typing
+from wheezy.template.comp import Tuple
from wheezy.template.engine import Engine
from wheezy.template.typing import Loader, SupportsRender
@@ -27,7 +28,7 @@
self.searchpath = searchpath
self.encoding = encoding
- def list_names(self) -> typing.Tuple[str, ...]:
+ def list_names(self) -> Tuple[str, ...]:
"""Return a list of names relative to directories. Ignores any files
and directories that start with dot.
"""
@@ -83,7 +84,7 @@
def __init__(self, templates: typing.Mapping[str, str]) -> None:
self.templates = templates
- def list_names(self) -> typing.Tuple[str, ...]:
+ def list_names(self) -> Tuple[str, ...]:
"""List all keys from internal dict."""
return tuple(sorted(self.templates.keys()))
@@ -100,7 +101,7 @@
def __init__(self, loaders: typing.List[Loader]) -> None:
self.loaders = loaders
- def list_names(self) -> typing.Tuple[str, ...]:
+ def list_names(self) -> Tuple[str, ...]:
"""Returns as list of names from all loaders."""
names = set()
for loader in self.loaders:
@@ -127,7 +128,7 @@
self.engine = engine
self.ctx = ctx or {}
- def list_names(self) -> typing.Tuple[str, ...]:
+ def list_names(self) -> Tuple[str, ...]:
return self.engine.loader.list_names()
def load(self, name: str) -> str:
@@ -155,7 +156,7 @@
from warnings import warn
self.engine = engine
- self.names: typing.Dict[str, int] = {}
+ self.names: typing.Dict[str, float] = {}
warn(
"autoreload limitation: master (inherited), imported "
"and preprocessed templates. It is recommended to use "
@@ -190,7 +191,7 @@
def file_changed(self, name: str) -> bool:
try:
last_known_stamp = self.names[name]
- current_time = int(time.time())
+ current_time = time.time()
if current_time - last_known_stamp <= 2:
return False
except KeyError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy/template/typing.py new/wheezy.template-3.2.2/src/wheezy/template/typing.py
--- old/wheezy.template-3.1.0/src/wheezy/template/typing.py 2021-04-17 09:07:29.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy/template/typing.py 2024-01-02 12:11:54.000000000 +0100
@@ -1,7 +1,9 @@
import typing
from abc import abstractmethod
-Token = typing.Tuple[int, str, str]
+from wheezy.template.comp import List, Tuple
+
+Token = Tuple[int, str, str]
class Builder:
@@ -33,27 +35,27 @@
... # pragma: nocover
-Tokenizer = typing.Callable[[typing.Match], Token]
-LexerRule = typing.Tuple[typing.Pattern, Tokenizer]
+Tokenizer = typing.Callable[[typing.Match[str]], Token]
+LexerRule = Tuple[typing.Pattern[str], Tokenizer]
PreProcessorRule = typing.Callable[[str], str]
-PostProcessorRule = typing.Callable[[typing.List[Token]], str]
+PostProcessorRule = typing.Callable[[List[Token]], str]
BuilderRule = typing.Callable[
[
Builder,
int,
str,
- typing.Union[str, typing.List[str], typing.Iterable[Token]],
+ typing.Union[str, List[str], typing.Iterable[Token], None],
],
bool,
]
-ParserRule = typing.Callable[[str], typing.Union[str, typing.List[str]]]
+ParserRule = typing.Callable[[str], typing.Union[str, List[str]]]
class ParserConfig:
- end_tokens: typing.List[str]
- continue_tokens: typing.List[str]
- compound_tokens: typing.List[str]
- out_tokens: typing.List[str]
+ end_tokens: List[str]
+ continue_tokens: List[str]
+ compound_tokens: List[str]
+ out_tokens: List[str]
RenderTemplate = typing.Callable[
@@ -77,7 +79,7 @@
class Loader:
@abstractmethod
- def list_names(self) -> typing.Tuple[str, ...]:
+ def list_names(self) -> Tuple[str, ...]:
... # pragma: nocover
@abstractmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy.template.egg-info/PKG-INFO new/wheezy.template-3.2.2/src/wheezy.template.egg-info/PKG-INFO
--- old/wheezy.template-3.1.0/src/wheezy.template.egg-info/PKG-INFO 2021-04-17 09:07:38.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy.template.egg-info/PKG-INFO 2024-01-02 12:12:02.000000000 +0100
@@ -1,75 +1,11 @@
Metadata-Version: 2.1
Name: wheezy.template
-Version: 3.1.0
+Version: 3.2.2
Summary: A lightweight template library
Home-page: https://github.com/akornatskyy/wheezy.template
Author: Andriy Kornatskyy
Author-email: andriy.kornatskyy(a)live.com
License: MIT
-Description: # wheezy.template
-
- [![Build Status](https://travis-ci.org/akornatskyy/wheezy.template.svg?branch=master…
- [![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master)
- [![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=late…
- [![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template)
-
- [wheezy.template](https://pypi.org/project/wheezy.template/) is a
- [python](https://www.python.org) package written in pure Python code. It
- is a lightweight template library. The design goals achived:
-
- - **Compact, Expressive, Clean:** Minimizes the number of keystrokes
- required to build a template. Enables fast and well read coding. You
- do not need to explicitly denote statement blocks within HTML
- (unlike other template systems), the parser is smart enough to
- understand your code. This enables a compact and expressive syntax
- which is really clean and just pleasure to type.
- - **Intuitive, No time to Learn:** Basic Python programming skills
- plus HTML markup. You are productive just from start. Use full power
- of Python with minimal markup required to denote python statements.
- - **Do Not Repeat Yourself:** Master layout templates for inheritance;
- include and import directives for maximum reuse.
- - **Blazingly Fast:** Maximum rendering performance: ultimate speed
- and context preprocessor features.
-
- Simple template:
-
- ```txt
- @require(user, items)
- Welcome, @user.name!
- @if items:
- @for i in items:
- @i.name: @i.price!s.
- @end
- @else:
- No items found.
- @end
- ```
-
- It is optimized for performance, well tested and documented.
-
- Resources:
-
- - [source code](https://github.com/akornatskyy/wheezy.template),
- [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos)
- and [issues](https://github.com/akornatskyy/wheezy.template/issues)
- tracker are available on
- [github](https://github.com/akornatskyy/wheezy.template)
- - [documentation](https://wheezytemplate.readthedocs.io/en/latest/)
-
- ## Install
-
- [wheezy.template](https://pypi.org/project/wheezy.template/) requires
- [python](https://www.python.org) version 3.6+. It is independent of
- operating system. You can install it from
- [pypi](https://pypi.org/project/wheezy.template/) site:
-
- ```sh
- pip install -U wheezy.template
- ```
-
- If you run into any issue or have comments, go ahead and add on
- [github](https://github.com/akornatskyy/wheezy.template).
-
Keywords: html markup template preprocessor
Platform: any
Classifier: Environment :: Web Environment
@@ -78,10 +14,10 @@
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP
@@ -89,5 +25,70 @@
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Widget Sets
Classifier: Topic :: Text Processing :: Markup :: HTML
-Requires-Python: >=3.6
+Requires-Python: >=3.8
Description-Content-Type: text/markdown
+License-File: LICENSE
+
+# wheezy.template
+
+[![tests](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.template/actions/workflows/tests.yml)
+[![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.template/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.template?branch=master)
+[![Documentation Status](https://readthedocs.org/projects/wheezytemplate/badge/?version=late…
+[![pypi version](https://badge.fury.io/py/wheezy.template.svg)](https://badge.fury.io/py/wheezy.template)
+
+[wheezy.template](https://pypi.org/project/wheezy.template/) is a
+[python](https://www.python.org) package written in pure Python code. It
+is a lightweight template library. The design goals achived:
+
+- **Compact, Expressive, Clean:** Minimizes the number of keystrokes
+ required to build a template. Enables fast and well read coding. You
+ do not need to explicitly denote statement blocks within HTML
+ (unlike other template systems), the parser is smart enough to
+ understand your code. This enables a compact and expressive syntax
+ which is really clean and just pleasure to type.
+- **Intuitive, No time to Learn:** Basic Python programming skills
+ plus HTML markup. You are productive just from start. Use full power
+ of Python with minimal markup required to denote python statements.
+- **Do Not Repeat Yourself:** Master layout templates for inheritance;
+ include and import directives for maximum reuse.
+- **Blazingly Fast:** Maximum rendering performance: ultimate speed
+ and context preprocessor features.
+
+Simple template:
+
+```txt
+@require(user, items)
+Welcome, @user.name!
+@if items:
+ @for i in items:
+ @i.name: @i.price!s.
+ @end
+@else:
+ No items found.
+@end
+```
+
+It is optimized for performance, well tested and documented.
+
+Resources:
+
+- [source code](https://github.com/akornatskyy/wheezy.template),
+ [examples](https://github.com/akornatskyy/wheezy.template/tree/master/demos)
+ and [issues](https://github.com/akornatskyy/wheezy.template/issues)
+ tracker are available on
+ [github](https://github.com/akornatskyy/wheezy.template)
+- [documentation](https://wheezytemplate.readthedocs.io/en/latest/)
+
+## Install
+
+[wheezy.template](https://pypi.org/project/wheezy.template/) requires
+[python](https://www.python.org) version 3.8+. It is independent of
+operating system. You can install it from
+[pypi](https://pypi.org/project/wheezy.template/) site:
+
+```sh
+pip install -U wheezy.template
+```
+
+If you run into any issue or have comments, go ahead and add on
+[github](https://github.com/akornatskyy/wheezy.template).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wheezy.template-3.1.0/src/wheezy.template.egg-info/entry_points.txt new/wheezy.template-3.2.2/src/wheezy.template.egg-info/entry_points.txt
--- old/wheezy.template-3.1.0/src/wheezy.template.egg-info/entry_points.txt 2021-04-17 09:07:38.000000000 +0200
+++ new/wheezy.template-3.2.2/src/wheezy.template.egg-info/entry_points.txt 2024-01-02 12:12:02.000000000 +0100
@@ -1,3 +1,2 @@
[console_scripts]
wheezy.template = wheezy.template.console:main
-
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-xsge_gui for openSUSE:Factory checked in at 2024-01-03 12:24:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xsge_gui (Old)
and /work/SRC/openSUSE:Factory/.python-xsge_gui.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xsge_gui"
Wed Jan 3 12:24:41 2024 rev:4 rq:1136307 version:2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xsge_gui/python-xsge_gui.changes 2021-06-01 10:35:45.804639559 +0200
+++ /work/SRC/openSUSE:Factory/.python-xsge_gui.new.28375/python-xsge_gui.changes 2024-01-03 12:24:49.611123979 +0100
@@ -1,0 +2,51 @@
+Fri Dec 29 10:32:00 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 2.0.0:
+ Additions:
+ + xsge_gui.RadioButton.group
+ + xsge_gui.button_bottom_sprite
+ + xsge_gui.button_bottomleft_sprite
+ + xsge_gui.button_bottomright_sprite
+ + xsge_gui.button_top_sprite
+ + xsge_gui.button_topleft_sprite
+ + xsge_gui.button_topright_sprite
+ + xsge_gui.button_pressed_bottom_sprite
+ + xsge_gui.button_pressed_bottomleft_sprite
+ + xsge_gui.button_pressed_bottomright_sprite
+ + xsge_gui.button_pressed_top_sprite
+ + xsge_gui.button_pressed_topleft_sprite
+ + xsge_gui.button_pressed_topright_sprite
+ + xsge_gui.button_selected_bottom_sprite
+ + xsge_gui.button_selected_bottomleft_sprite
+ + xsge_gui.button_selected_bottomright_sprite
+ + xsge_gui.button_selected_top_sprite
+ + xsge_gui.button_selected_topleft_sprite
+ + xsge_gui.button_selected_topright_sprite
+ + xsge_gui.button_color
+ + xsge_gui.button_pressed_color
+ + xsge_gui.button_selected_color
+ + xsge_gui.Button.get_height
+ + xsge_gui.textbox_color
+ + xsge_gui.textbox_top_sprite
+ + xsge_gui.textbox_topleft_sprite
+ + xsge_gui.textbox_topright_sprite
+ + xsge_gui.textbox_bottom_sprite
+ + xsge_gui.textbox_bottomleft_sprite
+ + xsge_gui.textbox_bottomright_sprite
+
+ Removals:
+ - xsge_gui.Window.event_close
+ - xsge_gui.button_sprite
+ - xsge_gui.button_pressed_sprite
+ - xsge_gui.button_selected_sprite
+ - xsge_gui.textbox_sprite
+
+ Misc changes:
+ * Windows no longer implicitly have a "close" button in the
+ top-right.
+ * Default fonts used are now in the Roboto family instead of the
+ obsolete Droid Sans.
+ * Default fonts are now much larger.
+ * Relicensed to GNU LGPL.
+
+-------------------------------------------------------------------
Old:
----
xsge_gui-1.2.1.tar.gz
New:
----
xsge_gui-2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-xsge_gui.spec ++++++
--- /var/tmp/diff_new_pack.U50B7X/_old 2024-01-03 12:24:51.471191941 +0100
+++ /var/tmp/diff_new_pack.U50B7X/_new 2024-01-03 12:24:51.471191941 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-xsge_gui
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,18 +16,18 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%define skip_python2 1
-%define skip_python36 1
+%{?sle15_python_module_pythons}
Name: python-xsge_gui
-Version: 1.2.1
+Version: 2.0
Release: 0
Summary: xSGE GUI Toolkit
-License: GPL-3.0-or-later
+License: LGPL-3.0-or-later
Group: Development/Languages/Python
-URL: http://xsge.nongnu.org
+URL: https://python-sge.github.io/
Source: https://files.pythonhosted.org/packages/source/x/xsge_gui/xsge_gui-%{versio…
+BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-sge-pygame >= 1.0
@@ -47,14 +47,15 @@
%setup -q -n xsge_gui-%{version}
%build
-%python_build
+%pyproject_wheel
%install
-%python_install
+%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%files %{python_files}
%doc README WHATSNEW
%license xsge_gui/COPYING
-%{python_sitelib}/*
+%{python_sitelib}/xsge_gui
+%{python_sitelib}/xsge_gui-%{version}.dist-info
++++++ xsge_gui-1.2.1.tar.gz -> xsge_gui-2.0.tar.gz ++++++
++++ 9849 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-setuptools-gettext for openSUSE:Factory checked in at 2024-01-03 12:24:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-setuptools-gettext (Old)
and /work/SRC/openSUSE:Factory/.python-setuptools-gettext.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-setuptools-gettext"
Wed Jan 3 12:24:38 2024 rev:3 rq:1136273 version:0.1.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-setuptools-gettext/python-setuptools-gettext.changes 2023-06-12 15:26:21.691020082 +0200
+++ /work/SRC/openSUSE:Factory/.python-setuptools-gettext.new.28375/python-setuptools-gettext.changes 2024-01-03 12:24:47.307039793 +0100
@@ -1,0 +2,8 @@
+Fri Dec 29 10:28:24 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 0.1.8:
+ * **Full Changelog**: https://github.com/breezy-
+ team/setuptools-gettext/compare/v0.1.1...v0.1.7
+ * Delay adding entry points to finalize_distribution_options
+
+-------------------------------------------------------------------
Old:
----
setuptools-gettext-0.1.1.tar.gz
New:
----
setuptools-gettext-0.1.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-setuptools-gettext.spec ++++++
--- /var/tmp/diff_new_pack.JIfXQX/_old 2024-01-03 12:24:48.371078671 +0100
+++ /var/tmp/diff_new_pack.JIfXQX/_new 2024-01-03 12:24:48.375078817 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-setuptools-gettext
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,22 +18,19 @@
%{?sle15_python_module_pythons}
Name: python-setuptools-gettext
-Version: 0.1.1
+Version: 0.1.8
Release: 0
Summary: Setuptools gettext extension plugin
License: GPL-2.0-or-later
URL: https://github.com/breezy-team/setuptools-gettext
Source: https://files.pythonhosted.org/packages/source/s/setuptools-gettext/setupto…
BuildRequires: %{python_module pip}
-BuildRequires: %{python_module setuptools >= 46.1}
+BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-setuptools >= 46.1
BuildArch: noarch
-# SECTION test requirements
-BuildRequires: %{python_module setuptools >= 46.1}
-# /SECTION
%python_subpackages
%description
@@ -56,5 +53,5 @@
%doc README.md
%license COPYING
%{python_sitelib}/setuptools_gettext
-%{python_sitelib}/setuptools_gettext-%{version}*-info
+%{python_sitelib}/setuptools_gettext-%{version}.dist-info
++++++ setuptools-gettext-0.1.1.tar.gz -> setuptools-gettext-0.1.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/.github/workflows/disperse.yml new/setuptools-gettext-0.1.8/.github/workflows/disperse.yml
--- old/setuptools-gettext-0.1.1/.github/workflows/disperse.yml 2022-10-20 23:41:36.000000000 +0200
+++ new/setuptools-gettext-0.1.8/.github/workflows/disperse.yml 2023-12-05 00:26:00.000000000 +0100
@@ -11,14 +11,4 @@
steps:
- uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v2
- - name: Install dependencies
- run: |
- sudo apt install protobuf-compiler
- - name: Install disperse
- run: |
- pip install git+https://github.com/jelmer/disperse
- - name: Validate disperse.conf
- run: |
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python disperse validate .
+ - uses: jelmer/action-disperse-validate@v1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/.github/workflows/pythontest.yml new/setuptools-gettext-0.1.8/.github/workflows/pythontest.yml
--- old/setuptools-gettext-0.1.1/.github/workflows/pythontest.yml 2022-10-20 23:41:36.000000000 +0200
+++ new/setuptools-gettext-0.1.8/.github/workflows/pythontest.yml 2023-12-05 00:26:00.000000000 +0100
@@ -13,18 +13,13 @@
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version:
- ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-rc - 3.11", pypy3]
- exclude:
- - os: macos-latest
- python-version: pypy3
- - os: windows-latest
- python-version: pypy3
+ ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
@@ -36,8 +31,8 @@
if: "matrix.os == 'ubuntu-latest'"
- name: Style checks
run: |
- pip install -U flake8
- python -m flake8
+ pip install -U ruff
+ python -m ruff check .
- name: Typing checks
run: |
pip install -U mypy types-setuptools
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/.gitignore new/setuptools-gettext-0.1.8/.gitignore
--- old/setuptools-gettext-0.1.1/.gitignore 2022-10-20 23:41:36.000000000 +0200
+++ new/setuptools-gettext-0.1.8/.gitignore 2023-12-05 00:26:00.000000000 +0100
@@ -1,3 +1,5 @@
dist
build
setuptools_gettext.egg-info
+*~
+__pycache__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/MANIFEST.in new/setuptools-gettext-0.1.8/MANIFEST.in
--- old/setuptools-gettext-0.1.1/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/MANIFEST.in 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1 @@
+graft example/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/PKG-INFO new/setuptools-gettext-0.1.8/PKG-INFO
--- old/setuptools-gettext-0.1.1/PKG-INFO 2022-10-20 23:41:44.439694400 +0200
+++ new/setuptools-gettext-0.1.8/PKG-INFO 2023-12-05 00:26:04.905951300 +0100
@@ -1,14 +1,13 @@
Metadata-Version: 2.1
Name: setuptools-gettext
-Version: 0.1.1
+Version: 0.1.8
Summary: Setuptools gettext extension plugin
-Home-page: https://github.com/breezy-team/setuptools-gettext
-Maintainer: Breezy Developers
-Maintainer-email: breezy-core(a)googlegroups.com
-License: GPLv2 or later
+Maintainer-email: Breezy Developers <breezy-core(a)googlegroups.com>
+Project-URL: Homepage, https://github.com/breezy-team/setuptools-gettext
+Project-URL: repository, https://github.com/breezy-team/setuptools-gettext.git
Keywords: distutils,setuptools,gettext
Classifier: Topic :: Software Development :: Version Control
-Classifier: License :: OSI Approved :: Apache Software License
+Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
@@ -18,10 +17,34 @@
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
-Requires-Python: >=3.6
+Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: COPYING
# setuptools plugin for gettext
Compile .po files into .mo files.
+
+This plugin adds `build_mo`, `clean_mo` and `install_mo` subcommands for
+setup.py as well as hooking those into standard commands.
+
+## Usage
+
+By default, setuptools_gettext compiles and installs mo files when there is a
+`po` directory present that contains ``.po`` files.
+
+The .mo files are installed adjacent to your package as package data in a subdirectory called ``locale``.
+
+You can override these settings in ``pyproject.toml``:
+
+```toml
+[build-system]
+requires = ["setuptools", "setuptools-gettext"]
+...
+
+[tool.setuptools-gettext]
+# directory in which the .po files can be found
+source_dir = "po"
+# directory in which the generated .mo files are placed when building
+build_dir = "breezy/locale"
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/README.md new/setuptools-gettext-0.1.8/README.md
--- old/setuptools-gettext-0.1.1/README.md 2022-10-20 23:41:36.000000000 +0200
+++ new/setuptools-gettext-0.1.8/README.md 2023-12-05 00:26:00.000000000 +0100
@@ -1,3 +1,27 @@
# setuptools plugin for gettext
Compile .po files into .mo files.
+
+This plugin adds `build_mo`, `clean_mo` and `install_mo` subcommands for
+setup.py as well as hooking those into standard commands.
+
+## Usage
+
+By default, setuptools_gettext compiles and installs mo files when there is a
+`po` directory present that contains ``.po`` files.
+
+The .mo files are installed adjacent to your package as package data in a subdirectory called ``locale``.
+
+You can override these settings in ``pyproject.toml``:
+
+```toml
+[build-system]
+requires = ["setuptools", "setuptools-gettext"]
+...
+
+[tool.setuptools-gettext]
+# directory in which the .po files can be found
+source_dir = "po"
+# directory in which the generated .mo files are placed when building
+build_dir = "breezy/locale"
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/disperse.conf new/setuptools-gettext-0.1.8/disperse.conf
--- old/setuptools-gettext-0.1.1/disperse.conf 2022-10-20 23:41:36.000000000 +0200
+++ new/setuptools-gettext-0.1.8/disperse.conf 2023-12-05 00:26:00.000000000 +0100
@@ -1,7 +1,7 @@
# See https://github.com/jelmer/disperse
timeout_days: 5
tag_name: "v$VERSION"
-verify_command: "flake8"
+verify_command: "ruff check ."
update_version {
path: "setuptools_gettext/__init__.py"
match: "^__version__ = \((.*)\)$"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/.gitignore new/setuptools-gettext-0.1.8/example/.gitignore
--- old/setuptools-gettext-0.1.1/example/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/.gitignore 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,2 @@
+hallowereld.egg-info
+hallowereld/locale
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/README.md new/setuptools-gettext-0.1.8/example/README.md
--- old/setuptools-gettext-0.1.1/example/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/README.md 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,11 @@
+This directory contains an example project that uses ``setuptools_gettext``.
+
+Note that while it uses the standard Python ``gettext`` module to access translations,
+``setuptools_gettext`` will also happily work with other gettext-compatible
+packages.
+
+The pot file can be updated by running ``./setup.py update-pot`` in the current
+directory.
+
+A new translation file can be created by
+running ``msginit -l $LANG -o po/$LANG.po po/hallowereld.pot``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/hallowereld/__init__.py new/setuptools-gettext-0.1.8/example/hallowereld/__init__.py
--- old/setuptools-gettext-0.1.1/example/hallowereld/__init__.py 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/hallowereld/__init__.py 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,33 @@
+"""A simple example of a Python package with translations."""
+
+# Use the "_" shorthand for gettext
+from gettext import gettext as _
+
+
+def hallo() -> str:
+ return _("Hello World!")
+
+
+def load_translations():
+ import gettext
+ import os
+
+ if os.path.exists('setup.py'):
+ # We are running from source, so we need to install the translations
+ locale_dir = os.path.join(os.path.dirname(__file__), "locale")
+ else:
+ # Otherwise, we assume the translations are installed in the relevant
+ # system directory that shares our prefix
+
+ # Note that we can't just use sys.prefix, since while Python might be
+ # installed in /usr, our package (and thus the translations) might be
+ # in /usr/local
+ locale_dir = os.path.join(
+ os.path.dirname(__file__),
+ "..", "..", "..", "..", "share", "locale")
+ gettext.bindtextdomain("hallowereld", localedir=locale_dir)
+ print("Loading translations from", locale_dir)
+
+ # Set the default domain, so we can use gettext (or _()) instead of
+ # dgettext
+ gettext.textdomain("hallowereld")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/hallowereld/__main__.py new/setuptools-gettext-0.1.8/example/hallowereld/__main__.py
--- old/setuptools-gettext-0.1.1/example/hallowereld/__main__.py 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/hallowereld/__main__.py 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,5 @@
+from . import hallo, load_translations
+
+load_translations()
+
+print(hallo())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/po/hallowereld.pot new/setuptools-gettext-0.1.8/example/po/hallowereld.pot
--- old/setuptools-gettext-0.1.1/example/po/hallowereld.pot 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/po/hallowereld.pot 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the hallowereld package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: hallowereld\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2023-12-04 14:57+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL(a)li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: hallowereld/__init__.py:6
+msgid "Hello World!"
+msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/po/nl.po new/setuptools-gettext-0.1.8/example/po/nl.po
--- old/setuptools-gettext-0.1.1/example/po/nl.po 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/po/nl.po 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,22 @@
+# Dutch translations for hallowereld package.
+# Copyright (C) 2023 THE hallowereld'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the hallowereld package.
+# Jelmer Vernooij <jelmer(a)jelmer.uk>, 2023.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: hallowereld\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2023-12-04 14:57+0000\n"
+"PO-Revision-Date: 2023-12-04 14:58+0000\n"
+"Last-Translator: Jelmer Vernooij <jelmer(a)jelmer.uk>\n"
+"Language-Team: Dutch <vertaling(a)vrijschrift.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hallowereld/__init__.py:6
+msgid "Hello World!"
+msgstr "Hallo Wereld!"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/pyproject.toml new/setuptools-gettext-0.1.8/example/pyproject.toml
--- old/setuptools-gettext-0.1.1/example/pyproject.toml 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/pyproject.toml 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,15 @@
+[build-system]
+requires = ["setuptools", "setuptools-gettext"]
+
+[project]
+name = "hallowereld"
+version = "0.1.0"
+
+[tool.setuptools]
+packages = ["hallowereld"]
+
+[tool.setuptools-gettext]
+source_dir = "po"
+# Set the build directory, to make it easier to find the compiled catalogs
+# in the source tree.
+build_dir = "hallowereld/locale"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/example/setup.py new/setuptools-gettext-0.1.8/example/setup.py
--- old/setuptools-gettext-0.1.1/example/setup.py 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/example/setup.py 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,5 @@
+#!/usr/bin/python3
+
+from setuptools import setup
+
+setup()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/pyproject.toml new/setuptools-gettext-0.1.8/pyproject.toml
--- old/setuptools-gettext-0.1.1/pyproject.toml 1970-01-01 01:00:00.000000000 +0100
+++ new/setuptools-gettext-0.1.8/pyproject.toml 2023-12-05 00:26:00.000000000 +0100
@@ -0,0 +1,77 @@
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "setuptools-gettext"
+maintainers = [{name = "Breezy Developers", email = "breezy-core(a)googlegroups.com"}]
+description = "Setuptools gettext extension plugin"
+keywords = ["distutils", "setuptools", "gettext"]
+classifiers = [
+ "Topic :: Software Development :: Version Control",
+ "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
+ "Intended Audience :: Developers",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Operating System :: POSIX",
+ "Operating System :: MacOS :: MacOS X",
+ "Operating System :: Microsoft :: Windows",
+]
+requires-python = ">=3.7"
+dependencies = ["setuptools>=60.8", 'tomli>=1.2.1; python_version<"3.11"']
+dynamic = ["version"]
+
+[project.readme]
+file = "README.md"
+content-type = "text/markdown"
+
+[project.urls]
+Homepage = "https://github.com/breezy-team/setuptools-gettext"
+repository = "https://github.com/breezy-team/setuptools-gettext.git"
+
+[project.entry-points."distutils.commands"]
+build_mo = "setuptools_gettext:build_mo"
+clean_mo = "setuptools_gettext:clean_mo"
+install_mo = "setuptools_gettext:install_mo"
+update_pot = "setuptools_gettext:update_pot"
+
+[project.entry-points."setuptools.finalize_distribution_options"]
+setuptools_gettext = "setuptools_gettext:pyprojecttoml_config"
+
+[tool.setuptools]
+packages = ["setuptools_gettext"]
+zip-safe = true
+include-package-data = false
+
+[tool.setuptools.dynamic]
+version = {attr = "setuptools_gettext.__version__"}
+
+[tool.mypy]
+ignore_missing_imports = true
+
+[tool.ruff]
+select = [
+ "ANN",
+ "D",
+ "E",
+ "F",
+ "I",
+ "UP",
+]
+target-version = "py37"
+line-length = 79
+ignore = [
+ "ANN001",
+ "ANN101",
+ "ANN201",
+ "D100",
+ "D101",
+ "D102",
+ "D103",
+]
+
+[tool.ruff.pydocstyle]
+convention = "google"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setup.cfg new/setuptools-gettext-0.1.8/setup.cfg
--- old/setuptools-gettext-0.1.1/setup.cfg 2022-10-20 23:41:44.439694400 +0200
+++ new/setuptools-gettext-0.1.8/setup.cfg 2023-12-05 00:26:04.905951300 +0100
@@ -1,44 +1,3 @@
-[metadata]
-name = setuptools-gettext
-version = attr:setuptools_gettext.__version__
-maintainer = Breezy Developers
-maintainer_email = breezy-core(a)googlegroups.com
-license = GPLv2 or later
-description = Setuptools gettext extension plugin
-keywords = distutils, setuptools, gettext
-url = https://github.com/breezy-team/setuptools-gettext
-long_description = file:README.md
-long_description_content_type = text/markdown
-classifiers =
- Topic :: Software Development :: Version Control
- License :: OSI Approved :: Apache Software License
- Intended Audience :: Developers
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.7
- Programming Language :: Python :: 3.8
- Programming Language :: Python :: 3.9
- Programming Language :: Python :: 3.10
- Operating System :: POSIX
- Operating System :: MacOS :: MacOS X
- Operating System :: Microsoft :: Windows
-
-[options]
-packages = setuptools_gettext
-zip_safe = True
-install_requires = setuptools>=46.1
-setup_requires = setuptools>=46.1
-python_requires = >=3.6
-
-[options.entry_points]
-distutils.commands =
- build_mo = setuptools_gettext:build_mo
-
-[mypy]
-ignore_missing_imports = True
-
-[flake8]
-exclude = build
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setup.py new/setuptools-gettext-0.1.8/setup.py
--- old/setuptools-gettext-0.1.1/setup.py 2022-10-20 23:41:36.000000000 +0200
+++ new/setuptools-gettext-0.1.8/setup.py 2023-12-05 00:26:00.000000000 +0100
@@ -1,4 +1,5 @@
#!/usr/bin/python3
from setuptools import setup
+
setup()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setuptools_gettext/__init__.py new/setuptools-gettext-0.1.8/setuptools_gettext/__init__.py
--- old/setuptools-gettext-0.1.1/setuptools_gettext/__init__.py 2022-10-20 23:41:38.000000000 +0200
+++ new/setuptools-gettext-0.1.8/setuptools_gettext/__init__.py 2023-12-05 00:26:02.000000000 +0100
@@ -1,7 +1,6 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2007, 2009, 2011 Canonical Ltd.
-# Copyright (C) 2022 Breezy Developers
+# Copyright (C) 2022-2023 Jelmer Vernooij <jelmer(a)jelmer.uk>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,21 +18,38 @@
# This code is from bzr-explorer and modified for bzr.
-"""build_mo command for setup.py"""
+"""build_mo command for setup.py."""
-from distutils import log
-from distutils.core import Command
-from distutils.dep_util import newer
-from distutils.spawn import find_executable
+import logging
import os
import re
+import sys
+from typing import List, Optional, Tuple
+from setuptools import Command
+from setuptools.dist import Distribution
-__version__ = (0, 1, 1)
+__version__ = (0, 1, 8)
+DEFAULT_SOURCE_DIR = 'po'
+DEFAULT_BUILD_DIR = 'locale'
+
+
+def lang_from_dir(source_dir: os.PathLike) -> List[str]:
+ re_po = re.compile(r'^([a-zA-Z_]+)\.po$')
+ lang = []
+ for i in os.listdir(source_dir):
+ mo = re_po.match(i)
+ if mo:
+ lang.append(mo.group(1))
+ return lang
+
+
+def parse_lang(lang: str) -> List[str]:
+ return [i.strip() for i in lang.split(',') if i.strip()]
class build_mo(Command):
- """Subcommand of build command: build_mo"""
+ """Subcommand of build command: build_mo."""
description = 'compile po files to mo files'
@@ -43,7 +59,6 @@
# - help string.
user_options = [('build-dir=', 'd', 'Directory to build locale files'),
('output-base=', 'o', 'mo-files base name'),
- ('source-dir=', None, 'Directory with sources po files'),
('force', 'f', 'Force creation of mo files'),
('lang=', None, 'Comma-separated list of languages '
'to process'),
@@ -54,45 +69,50 @@
def initialize_options(self):
self.build_dir = None
self.output_base = None
- self.source_dir = None
self.force = None
self.lang = None
+ self.outfiles = []
def finalize_options(self):
self.set_undefined_options('build', ('force', 'force'))
self.prj_name = self.distribution.get_name()
- if self.build_dir is None:
- self.build_dir = 'breezy/locale'
if not self.output_base:
self.output_base = self.prj_name or 'messages'
- if self.source_dir is None:
- self.source_dir = 'po'
+ self.source_dir = self.distribution.gettext_source_dir
+ if self.build_dir is None:
+ self.build_dir = (
+ getattr(self.distribution, 'gettext_build_dir', None)
+ or DEFAULT_BUILD_DIR)
if self.lang is None:
- re_po = re.compile(r'^([a-zA-Z_]+)\.po$')
- self.lang = []
- for i in os.listdir(self.source_dir):
- mo = re_po.match(i)
- if mo:
- self.lang.append(mo.group(1))
+ self.lang = lang_from_dir(self.source_dir)
else:
- self.lang = [i.strip() for i in self.lang.split(',') if i.strip()]
+ self.lang = parse_lang(self.lang)
+
+ def get_inputs(self):
+ inputs = []
+ for lang in self.lang:
+ po = os.path.join(self.source_dir, lang + '.po')
+ if not os.path.isfile(po):
+ po = os.path.join(self.source_dir, lang + '.po')
+ inputs.append(po)
+ return inputs
def run(self):
- """Run msgfmt for each language"""
+ """Run msgfmt for each language."""
if not self.lang:
return
if find_executable('msgfmt') is None:
- log.warn("GNU gettext msgfmt utility not found!")
- log.warn("Skip compiling po files.")
+ logging.warn("GNU gettext msgfmt utility not found!")
+ logging.warn("Skip compiling po files.")
return
if 'en' in self.lang:
if find_executable('msginit') is None:
- log.warn("GNU gettext msginit utility not found!")
- log.warn("Skip creating English PO file.")
+ logging.warn("GNU gettext msginit utility not found!")
+ logging.warn("Skip creating English PO file.")
else:
- log.info('Creating English PO file...')
+ logging.info('Creating English PO file...')
pot = (self.prj_name or 'messages') + '.pot'
en_po = 'en.po'
self.spawn(['msginit',
@@ -107,12 +127,232 @@
basename += '.mo'
for lang in self.lang:
- po = os.path.join('po', lang + '.po')
+ po = os.path.join(self.source_dir, lang + '.po')
if not os.path.isfile(po):
- po = os.path.join('po', lang + '.po')
+ po = os.path.join(self.source_dir, lang + '.po')
dir_ = os.path.join(self.build_dir, lang, 'LC_MESSAGES')
self.mkpath(dir_)
mo = os.path.join(dir_, basename)
if self.force or newer(po, mo):
- log.info('Compile: %s -> %s' % (po, mo))
+ logging.info(f'Compile: {po} -> {mo}')
self.spawn(['msgfmt', '-o', mo, po])
+ self.outfiles.append(mo)
+
+ def get_outputs(self):
+ return self.outfiles
+
+
+class clean_mo(Command):
+ description = 'clean .mo files'
+
+ user_options = [('build-dir=', 'd', 'Directory to build locale files')]
+
+ def initialize_options(self):
+ self.build_dir = None
+
+ def finalize_options(self):
+ if self.build_dir is None:
+ self.build_dir = (
+ getattr(self.distribution, 'gettext_build_dir', None)
+ or DEFAULT_BUILD_DIR)
+
+ def run(self):
+ if not os.path.isdir(self.build_dir):
+ return
+ for root, dirs, files in os.walk(self.build_dir):
+ for file_ in files:
+ if file_.endswith('.mo'):
+ os.unlink(os.path.join(root, file_))
+
+
+class install_mo(Command):
+
+ description: str = "install .mo files"
+
+ user_options = [
+ (
+ 'install-dir=',
+ 'd',
+ "base directory for installing data files "
+ "(default: installation base dir)",
+ ),
+ ('root=', None,
+ "install everything relative to this alternate root directory"),
+ ('force', 'f', "force installation (overwrite existing files)"),
+ ]
+
+ boolean_options: List[str] = ['force']
+ build_dir: Optional[str]
+ install_dir: Optional[str]
+ root: Optional[str]
+
+ def initialize_options(self) -> None:
+ self.install_dir = None
+ self.outfiles: List[str] = []
+ self.root = None
+ self.force = 0
+ self.build_dir = None
+
+ def finalize_options(self) -> None:
+ self.set_undefined_options(
+ 'install',
+ ('install_data', 'install_dir'),
+ ('root', 'root'),
+ ('force', 'force'),
+ )
+ if self.build_dir is None:
+ self.build_dir = (
+ self.distribution.gettext_build_dir) # type: ignore
+
+ def run(self) -> None:
+ assert self.install_dir is not None
+ assert self.build_dir is not None
+ self.mkpath(self.install_dir)
+ import glob
+ for filepath in glob.glob(self.build_dir + "/*/LC_MESSAGES/*.mo"):
+ langfile = filepath[len(self.build_dir.rstrip('/')+'/'):]
+ targetpath = os.path.join(
+ self.install_dir,
+ os.path.dirname(os.path.join("share/locale", langfile)))
+ if self.root is not None:
+ targetpath = change_root(self.root, targetpath)
+ self.mkpath(targetpath)
+ (out, _) = self.copy_file(filepath, targetpath)
+ self.outfiles.append(out)
+
+ def get_inputs(self):
+ import glob
+ return glob.glob(self.build_dir + "/*/LC_MESSAGES/*.mo")
+
+ def get_outputs(self):
+ return self.outfiles
+
+
+class update_pot(Command):
+
+ description: str = "update the .pot file"
+
+ user_options: List[Tuple[str, str, str]] = []
+
+ def initialize_options(self) -> None:
+ pass
+
+ def finalize_options(self) -> None:
+ pass
+
+ def run(self) -> None:
+ # TODO(jelmer): Support pygettext3 as well
+ xgettext = find_executable('xgettext')
+ if xgettext is None:
+ logging.error("GNU gettext xgettext utility not found!")
+ return
+ args = [xgettext]
+ args.extend([
+ "--package-name", self.distribution.get_name(),
+ "--from-code", "UTF-8",
+ "--sort-by-file",
+ "--add-comments=i18n:",
+ "-d", self.distribution.get_name(),
+ "-p", self.distribution.gettext_source_dir, # type: ignore
+ "-o", f"{self.distribution.get_name()}.pot",
+ ])
+
+ input_files = []
+ for root, _dirs, files in os.walk('.'):
+ for file_ in files:
+ if file_.endswith('.py'):
+ input_files.append(os.path.join(root, file_))
+ args.extend(input_files)
+
+ pot_path = os.path.join(
+ self.distribution.gettext_source_dir, self.distribution.get_name()) # type: ignore
+ if os.path.exists(pot_path):
+ args.append("--join")
+ if self.distribution.get_contact():
+ args += ["--msgid-bugs-address", self.distribution.get_contact()]
+
+ self.spawn(args)
+
+
+def has_gettext(_c) -> bool:
+ return os.path.isdir(DEFAULT_SOURCE_DIR)
+
+
+def pyprojecttoml_config(dist: Distribution) -> None:
+ build = dist.get_command_class("build")
+ build.sub_commands.append(('build_mo', has_gettext))
+ clean = dist.get_command_class("clean")
+ clean.sub_commands.append(('clean_mo', has_gettext))
+ install = dist.get_command_class("install")
+ install.sub_commands.append(('install_mo', has_gettext))
+
+ if sys.version_info[:2] >= (3, 11):
+ from tomllib import load as toml_load
+ else:
+ from tomli import load as toml_load
+ try:
+ with open("pyproject.toml", "rb") as f:
+ cfg = toml_load(f).get("tool", {}).get("setuptools-gettext")
+ except FileNotFoundError:
+ load_pyproject_config(dist, {})
+ else:
+ if cfg:
+ load_pyproject_config(dist, cfg)
+ else:
+ load_pyproject_config(dist, {})
+
+
+def load_pyproject_config(dist: Distribution, cfg) -> None:
+ dist.gettext_source_dir = ( # type: ignore
+ cfg.get("source_dir") or DEFAULT_SOURCE_DIR)
+ dist.gettext_build_dir = ( # type: ignore
+ cfg.get("build_dir") or DEFAULT_BUILD_DIR)
+
+
+def find_executable(executable):
+ _, ext = os.path.splitext(executable)
+ if sys.platform == 'win32' and ext != '.exe':
+ executable = executable + '.exe'
+
+ if os.path.isfile(executable):
+ return executable
+
+ path = os.environ.get('PATH', os.defpath)
+
+ # PATH='' doesn't match, whereas PATH=':' looks in the current directory
+ if not path:
+ return None
+
+ paths = path.split(os.pathsep)
+ for p in paths:
+ f = os.path.join(p, executable)
+ if os.path.isfile(f):
+ return f
+ return None
+
+
+def newer(source, target) -> bool:
+ if not os.path.exists(target):
+ return True
+
+ from stat import ST_MTIME
+
+ mtime1 = os.stat(source)[ST_MTIME]
+ mtime2 = os.stat(target)[ST_MTIME]
+
+ return mtime1 > mtime2
+
+
+def change_root(new_root, pathname):
+ if os.name == 'posix':
+ if not os.path.isabs(pathname):
+ return os.path.join(new_root, pathname)
+ else:
+ return os.path.join(new_root, pathname[1:])
+ elif os.name == 'nt':
+ (drive, path) = os.path.splitdrive(pathname)
+ if path[0] == '\\':
+ path = path[1:]
+ return os.path.join(new_root, path)
+ else:
+ raise AssertionError("Unsupported OS: %s" % os.name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/PKG-INFO new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/PKG-INFO
--- old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/PKG-INFO 2022-10-20 23:41:44.000000000 +0200
+++ new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/PKG-INFO 2023-12-05 00:26:04.000000000 +0100
@@ -1,14 +1,13 @@
Metadata-Version: 2.1
Name: setuptools-gettext
-Version: 0.1.1
+Version: 0.1.8
Summary: Setuptools gettext extension plugin
-Home-page: https://github.com/breezy-team/setuptools-gettext
-Maintainer: Breezy Developers
-Maintainer-email: breezy-core(a)googlegroups.com
-License: GPLv2 or later
+Maintainer-email: Breezy Developers <breezy-core(a)googlegroups.com>
+Project-URL: Homepage, https://github.com/breezy-team/setuptools-gettext
+Project-URL: repository, https://github.com/breezy-team/setuptools-gettext.git
Keywords: distutils,setuptools,gettext
Classifier: Topic :: Software Development :: Version Control
-Classifier: License :: OSI Approved :: Apache Software License
+Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
@@ -18,10 +17,34 @@
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
-Requires-Python: >=3.6
+Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: COPYING
# setuptools plugin for gettext
Compile .po files into .mo files.
+
+This plugin adds `build_mo`, `clean_mo` and `install_mo` subcommands for
+setup.py as well as hooking those into standard commands.
+
+## Usage
+
+By default, setuptools_gettext compiles and installs mo files when there is a
+`po` directory present that contains ``.po`` files.
+
+The .mo files are installed adjacent to your package as package data in a subdirectory called ``locale``.
+
+You can override these settings in ``pyproject.toml``:
+
+```toml
+[build-system]
+requires = ["setuptools", "setuptools-gettext"]
+...
+
+[tool.setuptools-gettext]
+# directory in which the .po files can be found
+source_dir = "po"
+# directory in which the generated .mo files are placed when building
+build_dir = "breezy/locale"
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/SOURCES.txt new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/SOURCES.txt
--- old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/SOURCES.txt 2022-10-20 23:41:44.000000000 +0200
+++ new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/SOURCES.txt 2023-12-05 00:26:04.000000000 +0100
@@ -1,11 +1,20 @@
.gitignore
COPYING
+MANIFEST.in
README.md
disperse.conf
-setup.cfg
+pyproject.toml
setup.py
.github/workflows/disperse.yml
.github/workflows/pythontest.yml
+example/.gitignore
+example/README.md
+example/pyproject.toml
+example/setup.py
+example/hallowereld/__init__.py
+example/hallowereld/__main__.py
+example/po/hallowereld.pot
+example/po/nl.po
setuptools_gettext/__init__.py
setuptools_gettext.egg-info/PKG-INFO
setuptools_gettext.egg-info/SOURCES.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/entry_points.txt new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/entry_points.txt
--- old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/entry_points.txt 2022-10-20 23:41:44.000000000 +0200
+++ new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/entry_points.txt 2023-12-05 00:26:04.000000000 +0100
@@ -1,2 +1,8 @@
[distutils.commands]
build_mo = setuptools_gettext:build_mo
+clean_mo = setuptools_gettext:clean_mo
+install_mo = setuptools_gettext:install_mo
+update_pot = setuptools_gettext:update_pot
+
+[setuptools.finalize_distribution_options]
+setuptools_gettext = setuptools_gettext:pyprojecttoml_config
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/requires.txt new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/requires.txt
--- old/setuptools-gettext-0.1.1/setuptools_gettext.egg-info/requires.txt 2022-10-20 23:41:44.000000000 +0200
+++ new/setuptools-gettext-0.1.8/setuptools_gettext.egg-info/requires.txt 2023-12-05 00:26:04.000000000 +0100
@@ -1 +1,4 @@
-setuptools>=46.1
+setuptools>=60.8
+
+[:python_version < "3.11"]
+tomli>=1.2.1
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-snimpy for openSUSE:Factory checked in at 2024-01-03 12:24:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-snimpy (Old)
and /work/SRC/openSUSE:Factory/.python-snimpy.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-snimpy"
Wed Jan 3 12:24:36 2024 rev:7 rq:1135641 version:1.0.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-snimpy/python-snimpy.changes 2023-08-01 15:38:18.581738502 +0200
+++ /work/SRC/openSUSE:Factory/.python-snimpy.new.28375/python-snimpy.changes 2024-01-03 12:24:44.642942453 +0100
@@ -1,0 +2,7 @@
+Fri Dec 29 10:26:57 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 1.0.2:
+ * Compatibility with Python 3.12 by adding dependency to
+ pyasyncore.
+
+-------------------------------------------------------------------
Old:
----
snimpy-1.0.1.tar.gz
New:
----
snimpy-1.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-snimpy.spec ++++++
--- /var/tmp/diff_new_pack.G4Zu8G/_old 2024-01-03 12:24:45.410970515 +0100
+++ /var/tmp/diff_new_pack.G4Zu8G/_new 2024-01-03 12:24:45.410970515 +0100
@@ -18,7 +18,7 @@
Name: python-snimpy
-Version: 1.0.1
+Version: 1.0.2
Release: 0
Summary: Interactive SNMP tool
License: ISC
++++++ snimpy-1.0.1.tar.gz -> snimpy-1.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/.github/FUNDING.yml new/snimpy-1.0.2/.github/FUNDING.yml
--- old/snimpy-1.0.1/.github/FUNDING.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/snimpy-1.0.2/.github/FUNDING.yml 2023-07-02 17:55:20.000000000 +0200
@@ -0,0 +1,3 @@
+---
+github: vincentbernat
+custom: https://www.buymeacoffee.com/vincentbernat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/.github/workflows/tests.yml new/snimpy-1.0.2/.github/workflows/tests.yml
--- old/snimpy-1.0.1/.github/workflows/tests.yml 2023-06-25 00:17:32.000000000 +0200
+++ new/snimpy-1.0.2/.github/workflows/tests.yml 2023-11-01 13:54:09.000000000 +0100
@@ -1,3 +1,4 @@
+---
name: Tests
on:
push:
@@ -13,6 +14,7 @@
name: Run tests
runs-on: ubuntu-latest
strategy:
+ fail-fast: false
matrix:
python-version:
- 3.7
@@ -20,10 +22,12 @@
- 3.9
- "3.10"
- "3.11"
+ - "3.12"
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v4
with:
submodules: true
+ fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/HISTORY.rst new/snimpy-1.0.2/HISTORY.rst
--- old/snimpy-1.0.1/HISTORY.rst 2023-06-30 08:47:54.000000000 +0200
+++ new/snimpy-1.0.2/HISTORY.rst 2023-12-12 09:27:40.000000000 +0100
@@ -3,6 +3,11 @@
History
-------
+1.0.2 (2023-12-12)
+++++++++++++++++++
+
+* Compatibility with Python 3.12 by adding dependency to pyasyncore.
+
1.0.1 (2023-06-30)
++++++++++++++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/PKG-INFO new/snimpy-1.0.2/PKG-INFO
--- old/snimpy-1.0.1/PKG-INFO 2023-06-30 08:51:27.635898400 +0200
+++ new/snimpy-1.0.2/PKG-INFO 2023-12-12 09:28:02.394754200 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: snimpy
-Version: 1.0.1
+Version: 1.0.2
Summary: interactive SNMP tool
Home-page: https://github.com/vincentbernat/snimpy
Author: Vincent Bernat
@@ -83,6 +83,11 @@
History
-------
+1.0.2 (2023-12-12)
+++++++++++++++++++
+
+* Compatibility with Python 3.12 by adding dependency to pyasyncore.
+
1.0.1 (2023-06-30)
++++++++++++++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/docs/_themes/flask_theme_support.py new/snimpy-1.0.2/docs/_themes/flask_theme_support.py
--- old/snimpy-1.0.1/docs/_themes/flask_theme_support.py 2023-06-30 08:50:57.000000000 +0200
+++ new/snimpy-1.0.2/docs/_themes/flask_theme_support.py 2023-06-30 08:56:02.000000000 +0200
@@ -1,19 +1,7 @@
# flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
-from pygments.token import (
- Keyword,
- Name,
- Comment,
- String,
- Error,
- Number,
- Operator,
- Generic,
- Whitespace,
- Punctuation,
- Other,
- Literal,
-)
+from pygments.token import Keyword, Name, Comment, String, Error, \
+ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
@@ -22,68 +10,77 @@
styles = {
# No corresponding class for the following:
- # Text: "", # class: ''
- Whitespace: "underline #f8f8f8", # class: 'w'
- Error: "#a40000 border:#ef2929", # class: 'err'
- Other: "#000000", # class 'x'
- Comment: "italic #8f5902", # class: 'c'
- Comment.Preproc: "noitalic", # class: 'cp'
- Keyword: "bold #004461", # class: 'k'
- Keyword.Constant: "bold #004461", # class: 'kc'
- Keyword.Declaration: "bold #004461", # class: 'kd'
- Keyword.Namespace: "bold #004461", # class: 'kn'
- Keyword.Pseudo: "bold #004461", # class: 'kp'
- Keyword.Reserved: "bold #004461", # class: 'kr'
- Keyword.Type: "bold #004461", # class: 'kt'
- Operator: "#582800", # class: 'o'
- Operator.Word: "bold #004461", # class: 'ow' - like keywords
- Punctuation: "bold #000000", # class: 'p'
+ #Text: "", # class: ''
+ Whitespace: "underline #f8f8f8", # class: 'w'
+ Error: "#a40000 border:#ef2929", # class: 'err'
+ Other: "#000000", # class 'x'
+
+ Comment: "italic #8f5902", # class: 'c'
+ Comment.Preproc: "noitalic", # class: 'cp'
+
+ Keyword: "bold #004461", # class: 'k'
+ Keyword.Constant: "bold #004461", # class: 'kc'
+ Keyword.Declaration: "bold #004461", # class: 'kd'
+ Keyword.Namespace: "bold #004461", # class: 'kn'
+ Keyword.Pseudo: "bold #004461", # class: 'kp'
+ Keyword.Reserved: "bold #004461", # class: 'kr'
+ Keyword.Type: "bold #004461", # class: 'kt'
+
+ Operator: "#582800", # class: 'o'
+ Operator.Word: "bold #004461", # class: 'ow' - like keywords
+
+ Punctuation: "bold #000000", # class: 'p'
+
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
- Name: "#000000", # class: 'n'
- Name.Attribute: "#c4a000", # class: 'na' - to be revised
- Name.Builtin: "#004461", # class: 'nb'
- Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
- Name.Class: "#000000", # class: 'nc' - to be revised
- Name.Constant: "#000000", # class: 'no' - to be revised
- Name.Decorator: "#888", # class: 'nd' - to be revised
- Name.Entity: "#ce5c00", # class: 'ni'
- Name.Exception: "bold #cc0000", # class: 'ne'
- Name.Function: "#000000", # class: 'nf'
- Name.Property: "#000000", # class: 'py'
- Name.Label: "#f57900", # class: 'nl'
- Name.Namespace: "#000000", # class: 'nn' - to be revised
- Name.Other: "#000000", # class: 'nx'
- Name.Tag: "bold #004461", # class: 'nt' - like a keyword
- Name.Variable: "#000000", # class: 'nv' - to be revised
- Name.Variable.Class: "#000000", # class: 'vc' - to be revised
- Name.Variable.Global: "#000000", # class: 'vg' - to be revised
- Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
- Number: "#990000", # class: 'm'
- Literal: "#000000", # class: 'l'
- Literal.Date: "#000000", # class: 'ld'
- String: "#4e9a06", # class: 's'
- String.Backtick: "#4e9a06", # class: 'sb'
- String.Char: "#4e9a06", # class: 'sc'
- String.Doc: "italic #8f5902", # class: 'sd' - like a comment
- String.Double: "#4e9a06", # class: 's2'
- String.Escape: "#4e9a06", # class: 'se'
- String.Heredoc: "#4e9a06", # class: 'sh'
- String.Interpol: "#4e9a06", # class: 'si'
- String.Other: "#4e9a06", # class: 'sx'
- String.Regex: "#4e9a06", # class: 'sr'
- String.Single: "#4e9a06", # class: 's1'
- String.Symbol: "#4e9a06", # class: 'ss'
- Generic: "#000000", # class: 'g'
- Generic.Deleted: "#a40000", # class: 'gd'
- Generic.Emph: "italic #000000", # class: 'ge'
- Generic.Error: "#ef2929", # class: 'gr'
- Generic.Heading: "bold #000080", # class: 'gh'
- Generic.Inserted: "#00A000", # class: 'gi'
- Generic.Output: "#888", # class: 'go'
- Generic.Prompt: "#745334", # class: 'gp'
- Generic.Strong: "bold #000000", # class: 'gs'
- Generic.Subheading: "bold #800080", # class: 'gu'
- Generic.Traceback: "bold #a40000", # class: 'gt'
+ Name: "#000000", # class: 'n'
+ Name.Attribute: "#c4a000", # class: 'na' - to be revised
+ Name.Builtin: "#004461", # class: 'nb'
+ Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
+ Name.Class: "#000000", # class: 'nc' - to be revised
+ Name.Constant: "#000000", # class: 'no' - to be revised
+ Name.Decorator: "#888", # class: 'nd' - to be revised
+ Name.Entity: "#ce5c00", # class: 'ni'
+ Name.Exception: "bold #cc0000", # class: 'ne'
+ Name.Function: "#000000", # class: 'nf'
+ Name.Property: "#000000", # class: 'py'
+ Name.Label: "#f57900", # class: 'nl'
+ Name.Namespace: "#000000", # class: 'nn' - to be revised
+ Name.Other: "#000000", # class: 'nx'
+ Name.Tag: "bold #004461", # class: 'nt' - like a keyword
+ Name.Variable: "#000000", # class: 'nv' - to be revised
+ Name.Variable.Class: "#000000", # class: 'vc' - to be revised
+ Name.Variable.Global: "#000000", # class: 'vg' - to be revised
+ Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
+
+ Number: "#990000", # class: 'm'
+
+ Literal: "#000000", # class: 'l'
+ Literal.Date: "#000000", # class: 'ld'
+
+ String: "#4e9a06", # class: 's'
+ String.Backtick: "#4e9a06", # class: 'sb'
+ String.Char: "#4e9a06", # class: 'sc'
+ String.Doc: "italic #8f5902", # class: 'sd' - like a comment
+ String.Double: "#4e9a06", # class: 's2'
+ String.Escape: "#4e9a06", # class: 'se'
+ String.Heredoc: "#4e9a06", # class: 'sh'
+ String.Interpol: "#4e9a06", # class: 'si'
+ String.Other: "#4e9a06", # class: 'sx'
+ String.Regex: "#4e9a06", # class: 'sr'
+ String.Single: "#4e9a06", # class: 's1'
+ String.Symbol: "#4e9a06", # class: 'ss'
+
+ Generic: "#000000", # class: 'g'
+ Generic.Deleted: "#a40000", # class: 'gd'
+ Generic.Emph: "italic #000000", # class: 'ge'
+ Generic.Error: "#ef2929", # class: 'gr'
+ Generic.Heading: "bold #000080", # class: 'gh'
+ Generic.Inserted: "#00A000", # class: 'gi'
+ Generic.Output: "#888", # class: 'go'
+ Generic.Prompt: "#745334", # class: 'gp'
+ Generic.Strong: "bold #000000", # class: 'gs'
+ Generic.Subheading: "bold #800080", # class: 'gu'
+ Generic.Traceback: "bold #a40000", # class: 'gt'
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/docs/installation.rst new/snimpy-1.0.2/docs/installation.rst
--- old/snimpy-1.0.1/docs/installation.rst 2016-11-15 07:58:49.000000000 +0100
+++ new/snimpy-1.0.2/docs/installation.rst 2023-11-01 14:06:33.000000000 +0100
@@ -39,3 +39,7 @@
install with::
$ sudo apt-get install snimpy
+
+If you plan to use custom MIBs, note that as snimpy relies on libsmi_ to
+find the MIBs, so you have to add the path to these MIBs in /etc/smi.conf or
+$HOME/.smirc .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/setup.py new/snimpy-1.0.2/setup.py
--- old/snimpy-1.0.1/setup.py 2023-06-30 08:51:10.000000000 +0200
+++ new/snimpy-1.0.2/setup.py 2023-11-01 13:53:27.000000000 +0100
@@ -3,7 +3,7 @@
from setuptools.command.test import test
import snimpy
-rtd = os.environ.get('READTHEDOCS', None) == 'True'
+rtd = os.environ.get("READTHEDOCS", None) == "True"
class SnimpyTestCommand(test):
@@ -12,49 +12,54 @@
# avoid errors at the end of the test
import multiprocessing
import pysnmp
+
SnimpyTestCommand.multiprocessing = multiprocessing
SnimpyTestCommand.pysnmp = pysnmp
return test.run_tests(self, *args, **kwds)
if __name__ == "__main__":
- readme = open('README.rst').read()
- history = open('HISTORY.rst').read().replace('.. :changelog:', '')
+ readme = open("README.rst").read()
+ history = open("HISTORY.rst").read().replace(".. :changelog:", "")
- setup(name="snimpy",
- classifiers=[
- 'Development Status :: 4 - Beta',
- 'Environment :: Console',
- 'Intended Audience :: System Administrators',
- 'License :: OSI Approved :: ISC License (ISCL)',
- 'Operating System :: POSIX',
- 'Programming Language :: Python :: 3',
- 'Topic :: System :: Networking',
- 'Topic :: Utilities',
- 'Topic :: System :: Monitoring'
- ],
- url='https://github.com/vincentbernat/snimpy',
- description=snimpy.__doc__,
- long_description=readme + '\n\n' + history,
- long_description_content_type='text/x-rst',
- author=snimpy.__author__,
- author_email=snimpy.__email__,
- packages=["snimpy"],
- entry_points={
- 'console_scripts': [
- 'snimpy = snimpy.main:interact',
- ],
- },
- data_files=[('share/man/man1', ['man/snimpy.1'])],
- zip_safe=False,
- cffi_modules=(not rtd and ["snimpy/smi_build.py:ffi"] or []),
- install_requires=["cffi >= 1.0.0", "pysnmp-lextudio >= 4", "setuptools"],
- setup_requires=["cffi >= 1.0.0", "vcversioner"],
- cmdclass={
- "test": SnimpyTestCommand
- },
- pbr=False,
- vcversioner={
- 'version_module_paths': ['snimpy/_version.py'],
- },
- )
+ setup(
+ name="snimpy",
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ "Environment :: Console",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: ISC License (ISCL)",
+ "Operating System :: POSIX",
+ "Programming Language :: Python :: 3",
+ "Topic :: System :: Networking",
+ "Topic :: Utilities",
+ "Topic :: System :: Monitoring",
+ ],
+ url="https://github.com/vincentbernat/snimpy",
+ description=snimpy.__doc__,
+ long_description=readme + "\n\n" + history,
+ long_description_content_type="text/x-rst",
+ author=snimpy.__author__,
+ author_email=snimpy.__email__,
+ packages=["snimpy"],
+ entry_points={
+ "console_scripts": [
+ "snimpy = snimpy.main:interact",
+ ],
+ },
+ data_files=[("share/man/man1", ["man/snimpy.1"])],
+ zip_safe=False,
+ cffi_modules=(not rtd and ["snimpy/smi_build.py:ffi"] or []),
+ install_requires=[
+ "cffi >= 1.0.0",
+ "pysnmp-lextudio >= 4",
+ 'pyasyncore; python_version >= "3.12"',
+ "setuptools",
+ ],
+ setup_requires=["cffi >= 1.0.0", "vcversioner"],
+ cmdclass={"test": SnimpyTestCommand},
+ pbr=False,
+ vcversioner={
+ "version_module_paths": ["snimpy/_version.py"],
+ },
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/snimpy/_version.py new/snimpy-1.0.2/snimpy/_version.py
--- old/snimpy-1.0.1/snimpy/_version.py 2023-06-30 08:51:27.000000000 +0200
+++ new/snimpy-1.0.2/snimpy/_version.py 2023-12-12 09:28:02.000000000 +0100
@@ -1,5 +1,5 @@
# This file is automatically generated by setup.py.
-__version__ = '1.0.1'
-__sha__ = 'g34faeabd7b74'
-__revision__ = 'g34faeabd7b74'
+__version__ = '1.0.2'
+__sha__ = 'gc3715fe92a55'
+__revision__ = 'gc3715fe92a55'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/snimpy.egg-info/PKG-INFO new/snimpy-1.0.2/snimpy.egg-info/PKG-INFO
--- old/snimpy-1.0.1/snimpy.egg-info/PKG-INFO 2023-06-30 08:51:27.000000000 +0200
+++ new/snimpy-1.0.2/snimpy.egg-info/PKG-INFO 2023-12-12 09:28:02.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: snimpy
-Version: 1.0.1
+Version: 1.0.2
Summary: interactive SNMP tool
Home-page: https://github.com/vincentbernat/snimpy
Author: Vincent Bernat
@@ -83,6 +83,11 @@
History
-------
+1.0.2 (2023-12-12)
+++++++++++++++++++
+
+* Compatibility with Python 3.12 by adding dependency to pyasyncore.
+
1.0.1 (2023-06-30)
++++++++++++++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/snimpy.egg-info/SOURCES.txt new/snimpy-1.0.2/snimpy.egg-info/SOURCES.txt
--- old/snimpy-1.0.1/snimpy.egg-info/SOURCES.txt 2023-06-30 08:51:27.000000000 +0200
+++ new/snimpy-1.0.2/snimpy.egg-info/SOURCES.txt 2023-12-12 09:28:02.000000000 +0100
@@ -11,6 +11,7 @@
setup.py
tox.ini
version.txt
+.github/FUNDING.yml
.github/dependabot.yml
.github/workflows/tests.yml
docs/Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/snimpy.egg-info/requires.txt new/snimpy-1.0.2/snimpy.egg-info/requires.txt
--- old/snimpy-1.0.1/snimpy.egg-info/requires.txt 2023-06-30 08:51:27.000000000 +0200
+++ new/snimpy-1.0.2/snimpy.egg-info/requires.txt 2023-12-12 09:28:02.000000000 +0100
@@ -1,3 +1,6 @@
cffi>=1.0.0
pysnmp-lextudio>=4
setuptools
+
+[:python_version >= "3.12"]
+pyasyncore
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/tests/agent.py new/snimpy-1.0.2/tests/agent.py
--- old/snimpy-1.0.1/tests/agent.py 2023-06-30 08:51:10.000000000 +0200
+++ new/snimpy-1.0.2/tests/agent.py 2023-12-02 19:08:36.000000000 +0100
@@ -3,7 +3,7 @@
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
-from pysnmp.carrier.asynsock.dgram import udp, udp6
+from pysnmp.carrier.asyncio.dgram import udp, udp6
from pysnmp.proto.api import v2c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/tox.ini new/snimpy-1.0.2/tox.ini
--- old/snimpy-1.0.1/tox.ini 2023-06-27 22:38:04.000000000 +0200
+++ new/snimpy-1.0.2/tox.ini 2023-11-01 13:47:41.000000000 +0100
@@ -1,5 +1,5 @@
[tox]
-envlist = py{34,35,36,37,38,39,310,311}{,-ipython},lint,doc
+envlist = py{34,35,36,37,38,39,310,311,312}{,-ipython},lint,doc
skip_missing_interpreters = True
[gh-actions]
@@ -10,6 +10,7 @@
3.9: py39
3.10: py310
3.11: py311
+ 3.12: py312
[testenv]
allowlist_externals = make
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snimpy-1.0.1/version.txt new/snimpy-1.0.2/version.txt
--- old/snimpy-1.0.1/version.txt 2023-06-30 08:51:27.000000000 +0200
+++ new/snimpy-1.0.2/version.txt 2023-12-12 09:28:02.000000000 +0100
@@ -1 +1 @@
-1.0.1-0-g34faeabd7b74
\ No newline at end of file
+1.0.2-0-gc3715fe92a55
\ 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-ttp for openSUSE:Factory checked in at 2024-01-03 12:24:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ttp (Old)
and /work/SRC/openSUSE:Factory/.python-ttp.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ttp"
Wed Jan 3 12:24:34 2024 rev:4 rq:1135639 version:0.9.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ttp/python-ttp.changes 2023-05-03 12:57:15.251824357 +0200
+++ /work/SRC/openSUSE:Factory/.python-ttp.new.28375/python-ttp.changes 2024-01-03 12:24:41.938843652 +0100
@@ -1,0 +2,10 @@
+Wed Dec 27 15:56:30 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 0.9.5:
+ * 1. group `to_int` function improved handling of missing keys,
+ * 2. group `to_int` function added support to handle list of
+ integers conversion, #109
+ * 3. group `to_int` function improved best effort conversion
+ logic to not fail on any conversion error at all
+
+-------------------------------------------------------------------
Old:
----
ttp-0.9.4.tar.gz
New:
----
ttp-0.9.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ttp.spec ++++++
--- /var/tmp/diff_new_pack.9vOiqH/_old 2024-01-03 12:24:42.886878291 +0100
+++ /var/tmp/diff_new_pack.9vOiqH/_new 2024-01-03 12:24:42.890878438 +0100
@@ -25,7 +25,7 @@
%bcond_with test
%endif
Name: python-ttp%{psuffix}
-Version: 0.9.4
+Version: 0.9.5
Release: 0
Summary: Template Text Parser
License: MIT
++++++ ttp-0.9.4.tar.gz -> ttp-0.9.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/pyproject.toml new/ttp-0.9.5/pyproject.toml
--- old/ttp-0.9.4/pyproject.toml 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/pyproject.toml 2023-06-25 02:27:08.000000000 +0200
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ttp"
-version = "0.9.4"
+version = "0.9.5"
description = "Template Text Parser"
authors = ["Denis Mulyalin <d.mulyalin(a)gmail.com>"]
maintainers = ["Denis Mulyalin <d.mulyalin(a)gmail.com>"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/test/pytest/test_group_functions.py new/ttp-0.9.5/test/pytest/test_group_functions.py
--- old/ttp-0.9.4/test/pytest/test_group_functions.py 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/test/pytest/test_group_functions.py 2023-06-25 02:27:08.000000000 +0200
@@ -864,4 +864,127 @@
'switched-vlan': {'mode': 'access'},
'vrf': 'XYZ'}]}}]]
-# test_expand_issue_65()
\ No newline at end of file
+# test_expand_issue_65()
+
+def test_group_to_int_for_non_integer():
+ template = """
+<input load="text">
+interface GigabitEthernet1/1
+ mtu ABC
+!
+interface GigabitEthernet1/2
+ mtu 8000
+!
+interface GigabitEthernet1/2
+ mtu 9200.0
+!
+</input>
+
+<group to_int="">
+interface {{ name }}
+ mtu {{ mtu }}
+</group>
+ """
+ parser = ttp(template=template)
+ parser.parse()
+ res = parser.result()
+ pprint.pprint(res)
+ assert res == [[[{'mtu': 'ABC', 'name': 'GigabitEthernet1/1'},
+ {'mtu': 8000, 'name': 'GigabitEthernet1/2'},
+ {'mtu': 9200.0, 'name': 'GigabitEthernet1/2'}]]]
+
+# test_group_to_int_for_non_integer()
+
+def test_group_to_int_missing_key_issue_109():
+ template = """
+<input load="text">
+interface GigabitEthernet1/1
+ mtu ABC
+!
+interface GigabitEthernet1/2
+ mtu 8000
+!
+interface GigabitEthernet1/2
+ mtu 9200.0
+!
+</input>
+
+<group to_int="mtu, foo, bar">
+interface {{ name }}
+ mtu {{ mtu }}
+</group>
+ """
+ parser = ttp(template=template)
+ parser.parse()
+ res = parser.result()
+ pprint.pprint(res)
+ assert res == [[[{'mtu': 'ABC', 'name': 'GigabitEthernet1/1'},
+ {'mtu': 8000, 'name': 'GigabitEthernet1/2'},
+ {'mtu': 9200.0, 'name': 'GigabitEthernet1/2'}]]]
+
+# test_group_to_int_missing_key_issue_109()
+
+def test_group_to_int_with_intlist_true_issue_109():
+ template = """
+<input load="text">
+interface GigabitEthernet1/1
+ switchport trunk allowed vlan 1,2,3,4
+!
+interface GigabitEthernet1/2
+ switchport trunk allowed vlan 123
+!
+interface GigabitEthernet1/3
+ switchport trunk allowed vlan foo,bar
+!
+interface GigabitEthernet1/4
+!
+</input>
+
+<group to_int="trunk_vlan, intlist=True">
+interface {{ name }}
+ switchport trunk allowed vlan {{ trunk_vlan | split(',') }}
+</group>
+ """
+ parser = ttp(template=template)
+ parser.parse()
+ res = parser.result()
+ pprint.pprint(res)
+ assert res == [[[{'name': 'GigabitEthernet1/1', 'trunk_vlan': [1, 2, 3, 4]},
+ {'name': 'GigabitEthernet1/2', 'trunk_vlan': [123]},
+ {'name': 'GigabitEthernet1/3', 'trunk_vlan': ['foo', 'bar']},
+ {'name': 'GigabitEthernet1/4'}]]]
+
+# test_group_to_int_with_intlist_issue_109()
+
+
+def test_group_to_int_with_intlist_false_issue_109():
+ template = """
+<input load="text">
+interface GigabitEthernet1/1
+ switchport trunk allowed vlan 1,2,3,4
+!
+interface GigabitEthernet1/2
+ switchport trunk allowed vlan 123
+!
+interface GigabitEthernet1/3
+ switchport trunk allowed vlan foo,bar
+!
+interface GigabitEthernet1/4
+!
+</input>
+
+<group to_int="trunk_vlan">
+interface {{ name }}
+ switchport trunk allowed vlan {{ trunk_vlan | split(',') }}
+</group>
+ """
+ parser = ttp(template=template)
+ parser.parse()
+ res = parser.result()
+ pprint.pprint(res)
+ assert res == [[[{'name': 'GigabitEthernet1/1', 'trunk_vlan': ['1', '2', '3', '4']},
+ {'name': 'GigabitEthernet1/2', 'trunk_vlan': ['123']},
+ {'name': 'GigabitEthernet1/3', 'trunk_vlan': ['foo', 'bar']},
+ {'name': 'GigabitEthernet1/4'}]]]
+
+# test_group_to_int_with_intlist_false_issue_109()
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/ttp/__init__.py new/ttp-0.9.5/ttp/__init__.py
--- old/ttp-0.9.4/ttp/__init__.py 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/ttp/__init__.py 2023-06-25 02:27:08.000000000 +0200
@@ -2,7 +2,7 @@
__all__ = ["ttp"]
__author__ = "Denis Mulyalin <d.mulyalin(a)gmail.com>"
-__version__ = "0.9.4"
+__version__ = "0.9.5"
from sys import version_info
# get python version:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/ttp/group/sformat.py new/ttp-0.9.5/ttp/group/sformat.py
--- old/ttp-0.9.4/ttp/group/sformat.py 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/ttp/group/sformat.py 2023-06-25 02:27:08.000000000 +0200
@@ -9,7 +9,9 @@
"""
try:
data[add_field] = string.format(**data)
- except KeyError: # KeyError happens when not enough keys in **data supplied to format method
+ except (
+ KeyError
+ ): # KeyError happens when not enough keys in **data supplied to format method
kwargs = _ttp_["global_vars"].copy()
kwargs.update(_ttp_["vars"])
kwargs.update(data)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/ttp/group/to_converters.py new/ttp-0.9.5/ttp/group/to_converters.py
--- old/ttp-0.9.4/ttp/group/to_converters.py 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/ttp/group/to_converters.py 2023-06-25 02:27:08.000000000 +0200
@@ -12,16 +12,37 @@
return data, None
-def to_int(data, *keys):
+def to_int(data, *keys, intlist=False):
if not keys:
keys = list(data.keys())
for k in keys:
- v = data[k]
+ # check if given key exists
+ try:
+ v = data[k]
+ except KeyError:
+ continue
+
+ # do best effort string to int conversion
try:
data[k] = int(v)
- except ValueError:
+ except:
try:
data[k] = float(v)
except:
- continue
+ pass
+
+ # convert list of integer strings to list of integers
+ if intlist is True and isinstance(data[k], list):
+ converted_list = []
+ for i in data[k]:
+ try:
+ converted_list.append(int(i))
+ except:
+ try:
+ converted_list.append(float(i))
+ except:
+ converted_list.append(i)
+
+ data[k] = converted_list
+
return data, None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/ttp/output/validate_yangson.py new/ttp-0.9.5/ttp/output/validate_yangson.py
--- old/ttp-0.9.4/ttp/output/validate_yangson.py 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/ttp/output/validate_yangson.py 2023-06-25 02:27:08.000000000 +0200
@@ -106,14 +106,14 @@
) as yf:
_module_entry(yf)
marr = []
- for (yam, mrev) in modmap:
+ for yam, mrev in modmap:
men = {"name": yam, "revision": mrev}
sarr = []
mrec = modmap[(yam, mrev)]
men["namespace"] = mrec["namespace"]
fts = mrec["features"]
imp_only = mrec["import-only"]
- for (subm, srev) in mrec["includes"]:
+ for subm, srev in mrec["includes"]:
sen = {"name": subm}
try:
srec = submodmap[subm]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ttp-0.9.4/ttp/ttp.py new/ttp-0.9.5/ttp/ttp.py
--- old/ttp-0.9.4/ttp/ttp.py 2023-04-23 15:35:34.000000000 +0200
+++ new/ttp-0.9.5/ttp/ttp.py 2023-06-25 02:27:08.000000000 +0200
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-__version__ = "0.9.4"
+__version__ = "0.9.5"
import re
import os
@@ -2333,7 +2333,7 @@
from pprint import pformat
attributes = dict(vars(self))
- _ = attributes.pop("_ttp_") # remove _ttp_ dictionary to not clutter the output
+ _ = attributes.pop("_ttp_") # remove _ttp_ dictionary to not clutter the output
text = "Variable object {}, Variable name '{}' content:\n{}".format(
self, self.var_name, pformat(attributes, indent=4)
)
@@ -3045,7 +3045,7 @@
copied = E.copy()
copied.update(result_data)
return copied
-
+
def start(self, result, PATH, DEFAULTS=None, FUNCTIONS=None, REDICT=""):
DEFAULTS = DEFAULTS or {}
FUNCTIONS = FUNCTIONS or []
@@ -3200,9 +3200,9 @@
def form_path(self, path):
"""
Method to form dynamic path transforming it into a list of tuples,
- where each tuple first element is a path item value and second
- element is a number of asterisks, need to keep asterisks count
- separatefrom path item value becasue match result value can end
+ where each tuple first element is a path item value and second
+ element is a number of asterisks, need to keep asterisks count
+ separatefrom path item value becasue match result value can end
with asterisk - issue #97
"""
for index, path_item in enumerate(path):
@@ -3228,7 +3228,10 @@
path_item = re.sub(pattern, str(self.variables[m]), path_item)
else:
return False
- path[index] = (path_item, asterisk_count * "*",)
+ path[index] = (
+ path_item,
+ asterisk_count * "*",
+ )
return path
def processgrp(self):
@@ -3236,12 +3239,14 @@
# add default values to group results
for k, v in self.record["DEFAULTS"].items():
self.record["result"].setdefault(k, v)
- # if merge_with_last - tail match, attempt to reconstruct group result
- # this only will work if self.record["result"] contains enough info to form PATH
+ # if merge_with_last - tail match, attempt to reconstruct group result
+ # this only will work if self.record["result"] contains enough info to form PATH
if self.record.get("merge_with_last") is True:
processed_path = self.form_path(list(self.record["PATH"]))
if processed_path:
- self.record["result"] = self.reconstruct_last_element(self.record["result"], processed_path)
+ self.record["result"] = self.reconstruct_last_element(
+ self.record["result"], processed_path
+ )
# process group functions
for item in self.record["FUNCTIONS"]:
func_name = item["name"]
@@ -3271,7 +3276,6 @@
"""Class to serve run output functions, returners and formatters"""
def __init__(self, element=None, template_obj=None, _ttp_=None, **kwargs):
-
# set attributes default values
self._ttp_ = _ttp_
self.attributes = {"returner": "self", "format": "raw", "load": "python"}
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-streamdeck for openSUSE:Factory checked in at 2024-01-03 12:24:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-streamdeck (Old)
and /work/SRC/openSUSE:Factory/.python-streamdeck.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-streamdeck"
Wed Jan 3 12:24:32 2024 rev:4 rq:1135638 version:0.9.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-streamdeck/python-streamdeck.changes 2023-11-13 22:25:37.514005726 +0100
+++ /work/SRC/openSUSE:Factory/.python-streamdeck.new.28375/python-streamdeck.changes 2024-01-03 12:24:39.210743974 +0100
@@ -1,0 +2,6 @@
+Fri Dec 29 10:24:43 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- update to 0.9.5:
+ * Added support for the StreamDeck Plus.
+
+-------------------------------------------------------------------
Old:
----
streamdeck-0.9.4.tar.gz
New:
----
streamdeck-0.9.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-streamdeck.spec ++++++
--- /var/tmp/diff_new_pack.dpYO1M/_old 2024-01-03 12:24:41.386823483 +0100
+++ /var/tmp/diff_new_pack.dpYO1M/_new 2024-01-03 12:24:41.386823483 +0100
@@ -17,7 +17,7 @@
Name: python-streamdeck
-Version: 0.9.4
+Version: 0.9.5
Release: 0
Summary: Library to control Elgato StreamDeck devices
License: MIT
++++++ streamdeck-0.9.4.tar.gz -> streamdeck-0.9.5.tar.gz ++++++
++++ 2094 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-wtf-peewee for openSUSE:Factory checked in at 2024-01-03 12:24:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wtf-peewee (Old)
and /work/SRC/openSUSE:Factory/.python-wtf-peewee.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wtf-peewee"
Wed Jan 3 12:24:30 2024 rev:2 rq:1135637 version:3.0.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wtf-peewee/python-wtf-peewee.changes 2022-04-17 23:52:11.754500750 +0200
+++ /work/SRC/openSUSE:Factory/.python-wtf-peewee.new.28375/python-wtf-peewee.changes 2024-01-03 12:24:36.574647658 +0100
@@ -1,0 +2,7 @@
+Fri Dec 29 10:23:54 UTC 2023 - Dirk Müller <dmueller(a)suse.com>
+
+- udpate to 3.0.5:
+ * Workaround for backwards-incompatible clown change in wtforms
+ 3.1.0
+
+-------------------------------------------------------------------
Old:
----
wtf-peewee-3.0.4.tar.gz
New:
----
wtf-peewee-3.0.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-wtf-peewee.spec ++++++
--- /var/tmp/diff_new_pack.rOOMjN/_old 2024-01-03 12:24:37.266672942 +0100
+++ /var/tmp/diff_new_pack.rOOMjN/_new 2024-01-03 12:24:37.270673089 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-wtf-peewee
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 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-wtf-peewee
-Version: 3.0.4
+Version: 3.0.5
Release: 0
Summary: WTForms integration for peewee models
License: MIT
++++++ wtf-peewee-3.0.4.tar.gz -> wtf-peewee-3.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/PKG-INFO new/wtf-peewee-3.0.5/PKG-INFO
--- old/wtf-peewee-3.0.4/PKG-INFO 2022-04-16 19:50:34.000000000 +0200
+++ new/wtf-peewee-3.0.5/PKG-INFO 2023-10-25 19:16:26.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: wtf-peewee
-Version: 3.0.4
+Version: 3.0.5
Summary: WTForms integration for peewee models
Home-page: https://github.com/coleifer/wtf-peewee/
Author: Charles Leifer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/setup.py new/wtf-peewee-3.0.5/setup.py
--- old/wtf-peewee-3.0.4/setup.py 2022-04-16 19:49:27.000000000 +0200
+++ new/wtf-peewee-3.0.5/setup.py 2023-10-25 19:16:02.000000000 +0200
@@ -3,7 +3,7 @@
setup(
name='wtf-peewee',
- version='3.0.4',
+ version='3.0.5',
url='https://github.com/coleifer/wtf-peewee/',
license='MIT',
author='Charles Leifer',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/wtf_peewee.egg-info/PKG-INFO new/wtf-peewee-3.0.5/wtf_peewee.egg-info/PKG-INFO
--- old/wtf-peewee-3.0.4/wtf_peewee.egg-info/PKG-INFO 2022-04-16 19:50:34.000000000 +0200
+++ new/wtf-peewee-3.0.5/wtf_peewee.egg-info/PKG-INFO 2023-10-25 19:16:26.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: wtf-peewee
-Version: 3.0.4
+Version: 3.0.5
Summary: WTForms integration for peewee models
Home-page: https://github.com/coleifer/wtf-peewee/
Author: Charles Leifer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/wtfpeewee/fields.py new/wtf-peewee-3.0.5/wtfpeewee/fields.py
--- old/wtf-peewee-3.0.4/wtfpeewee/fields.py 2022-01-07 19:17:35.000000000 +0100
+++ new/wtf-peewee-3.0.5/wtfpeewee/fields.py 2023-10-25 19:16:06.000000000 +0200
@@ -14,6 +14,7 @@
except ImportError:
raise ImportError('Could not import markupsafe.Markup. Please install '
'markupsafe.')
+from wtforms import __version__ as wtforms_version
from wtforms import fields, form, widgets
from wtforms.fields import FormField, _unset_value
from wtforms.validators import ValidationError
@@ -38,12 +39,20 @@
return super(StaticAttributesMixin, self).__call__(**kwargs)
+if wtforms_version < '3.1.0':
+ def wtf_choice(*args):
+ return args
+else:
+ def wtf_choice(*args):
+ return args + ({},)
+
+
class BooleanSelectField(fields.SelectFieldBase):
widget = widgets.Select()
def iter_choices(self):
- yield ('1', 'True', self.data)
- yield ('', 'False', not self.data)
+ yield wtf_choice('1', 'True', self.data)
+ yield wtf_choice('', 'False', not self.data)
def process_data(self, value):
try:
@@ -164,10 +173,10 @@
def iter_choices(self):
if self.allow_blank:
- yield (u'__None', self.blank_text, self.data is None)
+ yield wtf_choice(u'__None', self.blank_text, self.data is None)
for value, label in self.choices:
- yield (value, label, self.coerce(value) == self.data)
+ yield wtf_choice(value, label, self.coerce(value) == self.data)
def process_data(self, value):
if value is None:
@@ -253,10 +262,10 @@
def iter_choices(self):
if self.allow_blank:
- yield (u'__None', self.blank_text, self.data is None)
+ yield wtf_choice(u'__None', self.blank_text, self.data is None)
for obj in self.query.clone():
- yield (obj._pk, self.get_label(obj), obj == self.data)
+ yield wtf_choice(obj._pk, self.get_label(obj), obj == self.data)
def process_formdata(self, valuelist):
if valuelist:
@@ -304,7 +313,7 @@
def iter_choices(self):
for obj in self.query.clone():
- yield (obj._pk, self.get_label(obj), obj in self.data)
+ yield wtf_choice(obj._pk, self.get_label(obj), obj in self.data)
def process_formdata(self, valuelist):
if valuelist:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/wtfpeewee/tests.py new/wtf-peewee-3.0.5/wtfpeewee/tests.py
--- old/wtf-peewee-3.0.4/wtfpeewee/tests.py 2022-01-07 19:17:35.000000000 +0100
+++ new/wtf-peewee-3.0.5/wtfpeewee/tests.py 2023-10-25 19:16:06.000000000 +0200
@@ -8,6 +8,7 @@
from wtforms.form import Form as WTForm
from wtforms.validators import Regexp
from wtfpeewee.fields import *
+from wtfpeewee.fields import wtf_choice
from wtfpeewee.orm import model_form
from wtfpeewee._compat import PY2
@@ -110,6 +111,9 @@
self.entry_a2 = Entry.create(blog=self.blog_a, title='a2', content='a2 content', pub_date=datetime.datetime(2011, 1, 2))
self.entry_b1 = Entry.create(blog=self.blog_b, title='b1', content='b1 content', pub_date=datetime.datetime(2011, 1, 1))
+ def assertChoices(self, c, expected):
+ self.assertEqual(list(c.iter_choices()), [wtf_choice(*i) for i in expected])
+
def test_defaults(self):
BlogFormDef = model_form(Blog, field_args={'title': {'default': 'hello world'}})
@@ -171,15 +175,17 @@
self.assertTrue(isinstance(form.salutation, SelectChoicesField))
self.assertTrue(isinstance(form.true_or_false, wtfields.BooleanField))
- self.assertEqual(list(form.gender.iter_choices()), [
- ('m', 'Male', False), ('f', 'Female', False)
- ])
- self.assertEqual(list(form.status.iter_choices()), [
- ('__None', '----------------', True), (1, 'One', False), (2, 'Two', False)
- ])
- self.assertEqual(list(form.salutation.iter_choices()), [
- ('__None', '----------------', True), ('mr', 'Mr.', False), ('mrs', 'Mrs.', False),
- ])
+ self.assertChoices(form.gender, [
+ ('m', 'Male', False),
+ ('f', 'Female', False)])
+ self.assertChoices(form.status, [
+ ('__None', '----------------', True),
+ (1, 'One', False),
+ (2, 'Two', False)])
+ self.assertChoices(form.salutation, [
+ ('__None', '----------------', True),
+ ('mr', 'Mr.', False),
+ ('mrs', 'Mrs.', False)])
choices_obj = ChoicesModel(gender='m', status=2, salutation=None)
form = ChoicesForm(obj=choices_obj)
@@ -279,9 +285,9 @@
self.assertEqual(form.blog.data, None)
# check that the options look right
- self.assertEqual(list(form.blog.iter_choices()), [
- (self.blog_a._pk, u'a', False), (self.blog_b._pk, u'b', False)
- ])
+ self.assertChoices(form.blog, [
+ (self.blog_a._pk, u'a', False),
+ (self.blog_b._pk, u'b', False)])
def test_blog_form_with_obj(self):
form = BlogForm(obj=self.blog_a)
@@ -299,9 +305,9 @@
self.assertTrue(form.validate())
# check that the options look right
- self.assertEqual(list(form.blog.iter_choices()), [
- (self.blog_a._pk, u'a', True), (self.blog_b._pk, u'b', False)
- ])
+ self.assertChoices(form.blog, [
+ (self.blog_a._pk, u'a', True),
+ (self.blog_b._pk, u'b', False)])
def test_blog_form_saving(self):
form = BlogForm(FakePost({'title': 'new blog'}))
@@ -437,24 +443,21 @@
blog = SelectMultipleQueryField(query=Blog.select())
frm = TestForm()
- self.assertEqual([x for x in frm.blog.iter_choices()], [
+ self.assertChoices(frm.blog, [
(self.blog_a.id, 'a', False),
- (self.blog_b.id, 'b', False),
- ])
+ (self.blog_b.id, 'b', False)])
frm = TestForm(FakePost({'blog': [self.blog_b.id]}))
- self.assertEqual([x for x in frm.blog.iter_choices()], [
+ self.assertChoices(frm.blog, [
(self.blog_a.id, 'a', False),
- (self.blog_b.id, 'b', True),
- ])
+ (self.blog_b.id, 'b', True)])
self.assertEqual(frm.blog.data, [self.blog_b])
self.assertTrue(frm.validate())
frm = TestForm(FakePost({'blog': [self.blog_b.id, self.blog_a.id]}))
- self.assertEqual([x for x in frm.blog.iter_choices()], [
+ self.assertChoices(frm.blog, [
(self.blog_a.id, 'a', True),
- (self.blog_b.id, 'b', True),
- ])
+ (self.blog_b.id, 'b', True)])
self.assertEqual(frm.blog.data, [self.blog_a, self.blog_b])
self.assertTrue(frm.validate())
1
0