Skip to content

Commit

Permalink
3.2.1 - Improve stop-signal handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
vkottler committed Apr 4, 2024
1 parent d3362c4 commit d768112
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
env:
PY_TEST_EXTRA_ARGS: --cov-report=xml

- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v3.1.5

- run: mk pypi-upload-ci
env:
Expand All @@ -70,7 +70,7 @@ jobs:
- run: |
mk python-release owner=vkottler \
repo=vcorelib version=3.2.0
repo=vcorelib version=3.2.1
if: |
matrix.python-version == '3.11'
&& matrix.system == 'ubuntu-latest'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ coverage*.xml
tags
mklocal
docs
src
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
=====================================
generator=datazen
version=3.1.4
hash=6811e6f81dfb593ebc8f8888cc8b5e44
hash=9a58e54d587832ec916d3daf14642d4c
=====================================
-->

# vcorelib ([3.2.0](https://pypi.org/project/vcorelib/))
# vcorelib ([3.2.1](https://pypi.org/project/vcorelib/))

[![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
Expand Down
2 changes: 1 addition & 1 deletion local/variables/package.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
major: 3
minor: 2
patch: 0
patch: 1
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "vcorelib"
version = "3.2.0"
version = "3.2.1"
description = "A collection of core Python utilities."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
4 changes: 2 additions & 2 deletions vcorelib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.1.4
# hash=c534340676a353d859a13bc98ed36e98
# hash=39aedb9a5672f8c57741fb5465637ca6
# =====================================

"""
Expand All @@ -10,7 +10,7 @@

DESCRIPTION = "A collection of core Python utilities."
PKG_NAME = "vcorelib"
VERSION = "3.2.0"
VERSION = "3.2.1"

# vcorelib-specific content.
DEFAULT_INDENT = 2
Expand Down
9 changes: 2 additions & 7 deletions vcorelib/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ def setter(sig: int, _: _Optional[_FrameType]) -> None:
LOG.info("Received signal %s.", rep)

# Ensure scheduling 'stop_sig.set' is a nominal reaction to this
# signal. If not, raise an exception.
assert (
not stop_sig.is_set()
), "Stop signal is set but received signal {rep}!"

# signal.
normalize_eloop(eloop).call_soon_threadsafe(stop_sig.set)

return setter
Expand Down Expand Up @@ -177,8 +173,7 @@ def run_handle_stop(
return loop.run_until_complete(to_run)
except KeyboardInterrupt:
print("Keyboard interrupt.")
assert not stop_sig.is_set(), "Stop signal already set!"
loop.call_soon_threadsafe(stop_sig.set)
stop_sig.set()


@contextmanager
Expand Down
6 changes: 2 additions & 4 deletions vcorelib/io/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ def archive_candidates(
"""
for file_ext in FileExtension:
if file_ext.is_archive():
for candidate in file_ext.candidates(path, exists_only):
yield candidate
yield from file_ext.candidates(path, exists_only)

@staticmethod
def data_candidates(
Expand All @@ -149,8 +148,7 @@ def data_candidates(
"""
for file_ext in FileExtension:
if file_ext.is_data():
for candidate in file_ext.candidates(path, exists_only):
yield candidate
yield from file_ext.candidates(path, exists_only)


class LoadResult(NamedTuple):
Expand Down

0 comments on commit d768112

Please sign in to comment.