[med-svn] [Git][python-team/packages/enlighten][upstream] New upstream version 1.11.2
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun Feb 26 06:58:08 GMT 2023
Andreas Tille pushed to branch upstream at Debian Python Team / packages / enlighten
Commits:
e69e6dc8 by Andreas Tille at 2023-02-26T07:54:30+01:00
New upstream version 1.11.2
- - - - -
12 changed files:
- .github/workflows/tests.yml
- README.rst
- enlighten/__init__.py
- enlighten/_notebook_manager.py
- pylintrc
- setup.cfg
- setup.py
- setup_helpers.py
- tests/test_counter.py
- tests/test_notebook_manager.ipynb
- tests/test_notebook_manager.py
- tox.ini
Changes:
=====================================
.github/workflows/tests.yml
=====================================
@@ -13,40 +13,48 @@ jobs:
Tests:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
name: ${{ startsWith(matrix.toxenv, 'py') && matrix.python-version || format('{0} ({1})', matrix.toxenv, matrix.python-version) }} ${{ matrix.optional && '[OPTIONAL]' }}
+ continue-on-error: ${{ matrix.optional || false }}
strategy:
fail-fast: false
matrix:
- python-version: ['3.10']
+ python-version: ['3.11']
toxenv: [lint, docs, codecov]
include:
- - python-version: 3.9
+ - python-version: '3.10'
+ toxenv: py310
+
+ - python-version: '3.9'
toxenv: py39
- - python-version: 3.8
+ - python-version: '3.8'
toxenv: py38
- - python-version: 3.7
+ - python-version: '3.7'
toxenv: py37
- - python-version: 3.6
+ - python-version: '3.6'
toxenv: py36
+ os: ubuntu-20.04
- - python-version: 3.5
+ - python-version: '3.5'
toxenv: py35
+ os: ubuntu-20.04
- - python-version: 3.4
+ - python-version: '3.4'
optional: true
os: ubuntu-18.04
toxenv: py34
- - python-version: 2.7
+ - python-version: '2.7'
toxenv: py27
+ os: ubuntu-20.04
- - python-version: 2.7
+ - python-version: '2.7'
toxenv: el7
+ os: ubuntu-20.04
- python-version: pypy-2.7
toxenv: pypy27
@@ -54,10 +62,10 @@ jobs:
- python-version: pypy-3.9
toxenv: pypy39
- - python-version: '3.11-dev'
+ - python-version: '3.12-dev'
optional: true
- toxenv: py311
- toxpython: 3.11
+ toxenv: py312
+ toxpython: '3.12'
env:
TOXENV: ${{ matrix.toxenv }}
=====================================
README.rst
=====================================
@@ -9,7 +9,7 @@
:target: https://python-enlighten.readthedocs.org
:alt: Documentation Status
-.. |gh_actions| image:: https://img.shields.io/github/workflow/status/Rockhopper-Technologies/enlighten/Tests?event=push&logo=github-actions&style=plastic
+.. |gh_actions| image:: https://img.shields.io/github/actions/workflow/status/Rockhopper-Technologies/enlighten/tests.yml?event=push&logo=github-actions&style=plastic
:target: https://github.com/Rockhopper-Technologies/enlighten/actions/workflows/tests.yml
:alt: GitHub Actions Status
=====================================
enlighten/__init__.py
=====================================
@@ -16,7 +16,7 @@ from enlighten.manager import Manager, get_manager
from enlighten._util import EnlightenWarning, Justify
-__version__ = '1.11.1'
+__version__ = '1.11.2'
__all__ = ['Counter', 'EnlightenWarning', 'Justify', 'Manager',
'StatusBar', 'SubCounter', 'get_manager', 'NotebookManager']
=====================================
enlighten/_notebook_manager.py
=====================================
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright 2017 - 2021 Avram Lubkin, All Rights Reserved
+# Copyright 2017 - 2023 Avram Lubkin, All Rights Reserved
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -86,9 +86,10 @@ class NotebookManager(BaseManager):
positions = self.counters.values()
- for num in range(max(positions), 0, -1):
- if num not in positions:
- self._output[num - 1] = ' <br>'
+ if positions:
+ for num in range(max(positions), 0, -1):
+ if num not in positions:
+ self._output[num - 1] = ' <br>'
for counter in self.counters:
counter.enabled = False
=====================================
pylintrc
=====================================
@@ -1,4 +1,10 @@
+[MAIN]
+
+# Load and enable all available extensions. Use --list-extensions to see a list
+# all available extensions.
+enable-all-extensions=yes
+
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, json
=====================================
setup.cfg
=====================================
@@ -3,7 +3,7 @@ universal=1
[metadata]
description_file = README.rst
-license_file = LICENSE
+license_files = LICENSE
[tool:pytest]
python_files = test_*.py
=====================================
setup.py
=====================================
@@ -62,6 +62,7 @@ setup(
'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 :: Utilities',
=====================================
setup_helpers.py
=====================================
@@ -1,4 +1,4 @@
-# Copyright 2017 - 2022 Avram Lubkin, All Rights Reserved
+# Copyright 2017 - 2023 Avram Lubkin, All Rights Reserved
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -109,37 +109,53 @@ def check_rst2html(path):
return 0
-def check_copyrights():
+def _get_changed_files():
"""
- Check files recursively to ensure year of last change is in copyright line
+ Get files in current repository that have been changed
+ Ignore changes to copyright lines
"""
- this_year = str(datetime.date.today().year)
- changed_now = []
+ changed = []
# Get list of changed files
process = subprocess.run(
('git', 'status', '--porcelain=1'), stdout=subprocess.PIPE, check=True, text=True
)
for entry in process.stdout.splitlines():
- filename = entry[3:].strip()
- # Get changes for file
- process = subprocess.run(
- ('git', 'diff', '-U0', filename), stdout=subprocess.PIPE, check=True, text=True
- )
+ # Ignore deleted files
+ if entry[1] == 'D':
+ continue
+
+ # Construct diff command
+ filename = entry[3:].strip()
+ diff_cmd = ['git', 'diff', filename]
+ if entry[0].strip():
+ diff_cmd.insert(-1, '--cached')
# Find files with changes that aren't only for copyright
+ process = subprocess.run(diff_cmd, stdout=subprocess.PIPE, check=True, text=True)
for line in process.stdout.splitlines():
- if line[0] != '+' or line[:3] == '+++': # Ignore anything but the new contents
+ if line[0] != '+' or line[:3] == '+++': # Ignore everything but the new contents
continue
if re.search(r'copyright.*20\d\d', line, re.IGNORECASE): # Ignore copyright line
continue
- changed_now.append(filename)
+ changed.append(filename)
break
+ return changed
+
+
+def check_copyrights():
+ """
+ Check files recursively to ensure year of last change is in copyright line
+ """
+
+ this_year = str(datetime.date.today().year)
+ changed_now = _get_changed_files()
+
# Look for copyright lines
process = subprocess.run(
('git', 'grep', '-i', 'copyright'), stdout=subprocess.PIPE, check=True, text=True
@@ -151,11 +167,12 @@ def check_copyrights():
modified = None
# Get the year in the copyright line
- match = re.match(r'([^:]+):.*(20\d\d)', entry)
+ filename, text = entry.split(':', 1)
+ match = re.match(r'.*(20\d\d)', text)
if match:
- filename, year = match.groups()
+ year = match.group(1)
- # If files is in current changes, use this year
+ # If file is in current changes, use this year
if filename in changed_now:
modified = this_year
@@ -193,7 +210,7 @@ def check_copyrights():
# Compare modified date to copyright year
if modified and modified != year:
rtn = 1
- print('%s [%s]' % (entry, modified))
+ print('%s: %s [%s]' % (filename, text, modified))
return rtn
=====================================
tests/test_counter.py
=====================================
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright 2017 - 2021 Avram Lubkin, All Rights Reserved
+# Copyright 2017 - 2023 Avram Lubkin, All Rights Reserved
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -562,7 +562,7 @@ class TestCounter(TestCase):
"""
Floats should support prefixed formatting
"""
- bar_format = u'{count:!.2j}B / {total:!.2j}B | {rate:!.2j}B/s | {interval:!.2j} s/B'
+ bar_format = u'{count:!.2j}B / {total:!.2j}B | {rate:!.2j}B/s | {interval:!.2j}s/B'
ctr = Counter(stream=self.tty.stdout, total=3.2 * 2 ** 20, bar_format=bar_format)
ctr.count = 2048.0
@@ -571,7 +571,7 @@ class TestCounter(TestCase):
self.assertEqual(formatted, '2.00 KiB / 3.20 MiB | 1.00 KiB/s | 0.00 s/B')
# Counter_format
- counter_format = u'{count:!.2j}B | {rate:!.2j}B/s | {interval:!.2j} s/B'
+ counter_format = u'{count:!.2j}B | {rate:!.2j}B/s | {interval:!.2j}s/B'
ctr = Counter(stream=self.tty.stdout, counter_format=counter_format)
ctr.count = 2048.0
@@ -679,11 +679,11 @@ class TestCounter(TestCase):
Subcounter float fields should support prefixed formatting
"""
- bar_format = (u'{count:!.2j}B / {total:!.2j}B | {rate:!.2j}B/s | {interval:!.2j} s/B'
+ bar_format = (u'{count:!.2j}B / {total:!.2j}B | {rate:!.2j}B/s | {interval:!.2j}s/B'
u' | {count_0:!.2j}B | {count_00:!.2j}B'
- u' | {count_1:!.2j}B | {rate_1:!.2j}B/s | {interval_1:!.2j} s/B'
- u' | {count_2:!.2j}B | {rate_2:!.2j}B/s | {interval_2:!.2j} s/B'
- u' | {count_3:!.2j}B | {rate_3:!.2j}B/s | {interval_3:!.2j} s/B'
+ u' | {count_1:!.2j}B | {rate_1:!.2j}B/s | {interval_1:!.2j}s/B'
+ u' | {count_2:!.2j}B | {rate_2:!.2j}B/s | {interval_2:!.2j}s/B'
+ u' | {count_3:!.2j}B | {rate_3:!.2j}B/s | {interval_3:!.2j}s/B'
)
ctr = Counter(stream=self.tty.stdout, total=3.2 * 2 ** 20,
bar_format=bar_format, all_fields=True)
=====================================
tests/test_notebook_manager.ipynb
=====================================
@@ -146,6 +146,18 @@
")))"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# test_stop_no_counters\n",
+ "# Test stop succeeds when there are no counters\n",
+ "manager = NotebookManager()\n",
+ "manager.stop()"
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,
@@ -174,7 +186,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.9.4"
+ "version": "3.11.1 (main, Jan 6 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)]"
+ },
+ "vscode": {
+ "interpreter": {
+ "hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
+ }
}
},
"nbformat": 4,
=====================================
tests/test_notebook_manager.py
=====================================
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright 2021 Avram Lubkin, All Rights Reserved
+# Copyright 2021 - 2023 Avram Lubkin, All Rights Reserved
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -97,5 +97,8 @@ class TestNotebookManager(TestCase):
# test_styles: should have output
self.assertTrue(has_html_output(notebook.cells[6]), 'display_data not found in outputs')
+ # test_stop_no_counters: should have output
+ self.assertTrue(has_html_output(notebook.cells[7]), 'display_data not found in outputs')
+
# Cleanup: should have no output
- self.assertFalse(notebook.cells[7].outputs)
+ self.assertFalse(notebook.cells[8].outputs)
=====================================
tox.ini
=====================================
@@ -6,7 +6,7 @@ envlist =
coverage
docs
el7
- py{27,36,37,38,39,py27,py38}
+ py{27,36,37,38,39,310,py27,py38}
[base]
deps =
@@ -22,7 +22,7 @@ deps =
nbformat
[testenv]
-basepython = python3.10
+basepython = python3.11
usedevelop = True
ignore_errors = True
@@ -38,10 +38,13 @@ basepython = python2.7
deps =
blessed == 1.18.1
mock == 1.0.1
- prefixed == 0.3.2
+ prefixed == 0.6.0
# setuptools == 0.9.8 (Doesn't support PEP 508)
setuptools == 20.2.2
backports.functools-lru-cache == 1.2.1
+ # Blessed dependencies
+ six == 1.9.0
+ wcwidth == 0.2.5
[testenv:flake8]
skip_install = True
@@ -49,7 +52,7 @@ deps =
flake8
commands =
- {envpython} -m flake8
+ flake8
[testenv:pylint]
skip_install = True
@@ -61,7 +64,7 @@ deps =
pyenchant
commands =
- {envpython} -m pylint enlighten setup setup_helpers tests examples
+ pylint enlighten setup setup_helpers tests examples
[testenv:nbqa]
skip_install = True
@@ -73,8 +76,8 @@ deps =
nbqa
commands =
- {envpython} -m nbqa flake8 tests
- {envpython} -m nbqa pylint tests
+ nbqa flake8 tests
+ nbqa pylint tests
[testenv:copyright]
skip_install = True
@@ -103,20 +106,23 @@ deps =
coverage
commands =
- {envpython} -m coverage erase
- {envpython} -m coverage run -p -m unittest discover -s {toxinidir}/tests {posargs}
- {envpython} -m coverage combine
- {envpython} -m coverage report
+ coverage erase
+ coverage run -p -m unittest discover -s {toxinidir}/tests {posargs}
+ coverage combine
+ coverage report
[testenv:codecov]
-passenv = CI TRAVIS TRAVIS_* CODECOV_* GITHUB_*
+passenv =
+ CI
+ CODECOV_*
+ GITHUB_*
deps =
{[testenv:coverage]deps}
codecov
commands =
{[testenv:coverage]commands}
- {envpython} -m codecov
+ codecov
[testenv:docs]
deps =
View it on GitLab: https://salsa.debian.org/python-team/packages/enlighten/-/commit/e69e6dc8a8a7d0e063ebb525ad7604b679e4b301
--
View it on GitLab: https://salsa.debian.org/python-team/packages/enlighten/-/commit/e69e6dc8a8a7d0e063ebb525ad7604b679e4b301
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230226/5202d2e4/attachment-0001.htm>
More information about the debian-med-commit
mailing list