Skip to content

Commit

Permalink
Merge pull request #111 from Jylpah/dev-1.0
Browse files Browse the repository at this point in the history
CI/CD update
  • Loading branch information
Jylpah authored Dec 25, 2023
2 parents cc98de5 + 25dbde8 commit 888512c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install .
python -m pip install ".[dev]"
python -m pip install ".[dev]"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![CI](https://github.com/Jylpah/pyutils/actions/workflows/python-package.yml/badge.svg) [![codecov](https://codecov.io/gh/Jylpah/pyutils/graph/badge.svg?token=5EJ07RU78R)](https://codecov.io/gh/Jylpah/pyutils)

# pyutils

Misc Python utils
Expand All @@ -16,13 +18,14 @@ pip install --upgrade git+https://github.com/Jylpah/pyutils.git

# MODULES

* [AsyncQueue(asyncio.Queue, Generic[T])](asyncqueue.py): Implement `async.Queue()` interface for non-async queues using `asyncio.sleep()` and `get_nowait()` and `put_nowait()` methods. Handy when using async code with `multiprocessing`
* [BucketMapper(Generic[T])](bucketmapper.py): Class to map objects into fixed buckets according to an attribute (`float|int`). Uses `bisect` package.
* [CounterQueue(asyncio.Queue)](counterqueue.py): Async Queue that keeps count on `task_done()` completed
* [EventCounter()](eventcounter.py): Count / log statistics and merge different `EventCounter()` instances to provide aggregated stats of the events counted
* [FileQueue(asyncio.Queue)](filequeue.py): Class to build file queue to process from command line arguments or STDIN (`-`)
* [IterableQueue(Queue[T], AsyncIterable[T], Countable):](iterablequeue.py): Async queue that implements `AsyncIterable()`. The queue supports join(). Bit complex, but I could not figure how to simplify it while implenting both `join()` and `AsyncIterable()`
* [MultilevelFormatter(logging.Formatter)](multilevelformatter.py): Log using different formats per logging level
* [ThrottledClientSession(aiohttp.ClientSession)](throttledclientsession.py): Rate-throttled client session class inherited from aiohttp.ClientSession
* [utils](utils.py) module for ... utils of [pyutils](.)
* [AsyncQueue(asyncio.Queue, Generic[T])](src/pyutils/asyncqueue.py): Implement `async.Queue()` interface for non-async queues using `asyncio.sleep()` and `get_nowait()` and `put_nowait()` methods. Handy when using async code with `multiprocessing`
* [AsyncTyper(Typer)](src/pyutils/asynctyper.py): An wrapper for `Typer` to run `asyncio` commands.
* [BucketMapper(Generic[T])](src/pyutils/bucketmapper.py): Class to map objects into fixed buckets according to an attribute (`float|int`). Uses `bisect` package.
* [CounterQueue(asyncio.Queue)](src/pyutils/counterqueue.py): Async Queue that keeps count on `task_done()` completed
* [EventCounter()](src/pyutils/eventcounter.py): Count / log statistics and merge different `EventCounter()` instances to provide aggregated stats of the events counted
* [FileQueue(asyncio.Queue)](src/pyutils/filequeue.py): Class to build file queue to process from command line arguments or STDIN (`-`)
* [IterableQueue(Queue[T], AsyncIterable[T], Countable):](src/pyutils/iterablequeue.py): Async queue that implements `AsyncIterable()`. The queue supports join(). Bit complex, but I could not figure how to simplify it while implenting both `join()` and `AsyncIterable()`
* [MultilevelFormatter(logging.Formatter)](src/pyutils/multilevelformatter.py): Log using different formats per logging level
* [ThrottledClientSession(aiohttp.ClientSession)](src/pyutils/throttledclientsession.py): Rate-throttled client session class inherited from aiohttp.ClientSession
* [utils](src/pyutils/utils.py) module for ... utils of [pyutils](.)

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"aiohttp~=3.9.1",
"aiodns~=3.0.0",
"aioconsole~=0.6.1",
"alive-progress>=3.1.1",
"alive-progress~=3.1.1",
"Brotli~=1.1.0",
"Deprecated~=1.2.14",
"click~=8.1",
Expand All @@ -36,9 +36,9 @@ dev = [
"pytest-asyncio",
"pytest-datafiles",
"pytest-cov~=4.1",
"pytest-timeout",
"types-aiofiles>=23.1.0.1",
"types-Deprecated>=1.2.9.3",
"pytest-timeout~=2.2.0",
"types-aiofiles~=23.1.0.1",
"types-Deprecated~=1.2.9.3",
]


Expand Down

0 comments on commit 888512c

Please sign in to comment.