Skip to content

Commit

Permalink
release: 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
metaist committed May 10, 2023
1 parent b823640 commit 5a9c1cf
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 27 deletions.
72 changes: 54 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,62 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning].

Sections order is: `Fixed`, `Changed`, `Added`, `Deprecated`, `Removed`, `Security`.

[keep a changelog]: http://keepachangelog.com/en/1.0.0/
[semantic versioning]: http://semver.org/spec/v2.0.0.html

---

[unreleased]: https://github.com/metaist/ezq/compare/prod...main

## [Unreleased]

[unreleased]: https://github.com/metaist/ezq/compare/production...main
These are changes that are on `main` that are not yet in `prod`.

---

[#1]: https://github.com/metaist/ezq/issues/1
[#3]: https://github.com/metaist/ezq/issues/3
[#4]: https://github.com/metaist/ezq/issues/4
[#6]: https://github.com/metaist/ezq/issues/6
[2.0.3]: https://github.com/metaist/ezq/compare/2.0.2...2.0.3

These are changes that are on `main` that are not yet in `production`.
## [2.0.3] - 2023-05-10T03:44:15Z

This version introduced a new class-based API via the `Q` object.
The function-based API is officially deprecated and will be removed
in v3.

**Changed**

- `sortiter` now sorts the list of waiting messages in place to improve performance (~50%).
- replaced `pylint` with [`ruff`](https://github.com/charliermarsh/ruff)
- [#6]: supported python versions: removed 3.6, 3.7; added 3.10, 3.11

---
**Added**

## [2.0.2] - 2021-08-24T17:25:52Z
- build badge
- [#1]: support for `threading`
- [#3]: `map` function for simple use-cases
- [#4]: `Q` class wrapper for the queue

[2.0.2]: https://github.com/metaist/ezq/compare/2.0.1...2.0.2
**Deprecated**

**Removed**
Most of the function-based API is now deprecated.

- `put_msg`: use `Q.put()` instead
- `iter_msg`: use `iter(Q)` instead
- `iter_q`: use `Q.items()` instead
- `sortiter`: use `Q.sorted()` instead
- `endq`: use `Q.end()` instead
- `endq_and_wait`: use `Q.stop()` instead

---

[2.0.2]: https://github.com/metaist/ezq/compare/2.0.1...2.0.2

- `count` parameter for `endq`; it was only used interally and was confusing
## [2.0.2] - 2021-08-24T17:25:52Z

**Changed**

Expand All @@ -36,31 +68,30 @@ These are changes that are on `main` that are not yet in `production`.

**Added**

- [Documention](https://metaist.github.io/ezq)
- [Documentation](https://metaist.github.io/ezq)
- `sortiter` which is a more general form of `iter_sortq`
- `iter_q` for iterating over current contents of a queue

---
**Removed**

## [2.0.1] - 2021-08-22T20:20:53Z
- `count` parameter for `endq`; it was only used internally and was confusing

---

[2.0.1]: https://github.com/metaist/ezq/compare/2.0.0...2.0.1

## [2.0.1] - 2021-08-22T20:20:53Z

**Fixed**

- README link to license.
- `setup.py` to contain a better `long_description`.

---

## [2.0.0] - 2021-08-22T19:56:48Z

[2.0.0]: https://github.com/metaist/ezq/compare/1.0.0...2.0.0

**Removed**

- `IS_ALIVE`, `stop_iter_msg()`: Originally, these were to stop `iter_msg()` from continuing when there was a `SIGINT`. However, this didn't really work properly and so was removed.
- `Daemon`, `start_processes()`, `start()`, `start_numbered()`: these have all been replaced with a simpler `run()` function.
## [2.0.0] - 2021-08-22T19:56:48Z

**Changed**

Expand All @@ -73,10 +104,15 @@ These are changes that are on `main` that are not yet in `production`.
- `iter_sortq()`: iterates over the contents of a queue in a sorted way. Useful for collating results in a single process at the end of a pipeline.
- `endq()`: adds the special `END_MSG` to the queue. This makes the API cleaner in terms of ending queues that don't require waiting.

---
**Removed**

## [1.0.0] - 2021-08-20T19:50Z
- `IS_ALIVE`, `stop_iter_msg()`: Originally, these were to stop `iter_msg()` from continuing when there was a `SIGINT`. However, this didn't really work properly and so was removed.
- `Daemon`, `start_processes()`, `start()`, `start_numbered()`: these have all been replaced with a simpler `run()` function.

---

[1.0.0]: https://github.com/metaist/ezq/commits/1.0.0

## [1.0.0] - 2021-08-20T19:50Z

Initial release.
88 changes: 88 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Contributing

This document describes the process of making a release.

## Checkout `prod`

```bash
git checkout prod
git merge --no-ff --no-edit main
```

## Update `__about__.py`

Get the current UTC date+time:

```bash
python -c"from datetime import datetime; print(datetime.utcnow().isoformat()[:19] + 'Z')"
```

Update `__about__.py` with the correct values:

```python
__version__ = "<<NEW VERSION>>"
__pubdate__ = "<<DATE+TIME IN UTC>>"
```

Take the time to also update the `__copyright__` line, if needed.

Example:

```python
__version__ = "2.0.3"
__pubdate__ = "2023-05-10T03:44:41Z"
```

## Update `CHANGELOG.md`

Sections order is: `Fixed`, `Changed`, `Added`, `Deprecated`, `Removed`, `Security`.

```text
---
[2.0.3]: https://github.com/metaist/ezq/compare/2.0.2...2.0.3
## [2.0.3] - 2023-05-10T03:45:10Z
**Fixed**
**Changed**
**Added**
**Deprecated**
**Removed**
**Security**
```

## Update docs

```bash
pdoc --html --output-dir docs --force src/ezq
mv docs/ezq/* docs/
```

## Check build

```bash
python setup.py build
twine check dist/*
```

## Push

```bash
git tag 2.0.3
git push
git push --tags
git checkout main
git merge --no-ff --no-edit production
```

## Create Release

Visit: https://github.com/metaist/ezq/releases/new
12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
</details>
</dd>
<dt id="ezq.endq"><code class="name flex">
<span>def <span class="ident">endq</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>>) ‑> <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>></span>
<span>def <span class="ident">endq</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>>) ‑> <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>></span>
</code></dt>
<dd>
<div class="desc"><p>Add a message to a queue to indicate its end.</p>
Expand Down Expand Up @@ -802,7 +802,7 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="ezq.endq_and_wait"><code class="name flex">
<span>def <span class="ident">endq_and_wait</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>>, workers: Union[threading.Thread, multiprocessing.context.Process, Sequence[threading.Thread], Sequence[multiprocessing.context.Process]]) ‑> Union[Sequence[threading.Thread], Sequence[multiprocessing.context.Process]]</span>
<span>def <span class="ident">endq_and_wait</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>>, workers: Union[threading.Thread, multiprocessing.context.Process, Sequence[threading.Thread], Sequence[multiprocessing.context.Process]]) ‑> Union[Sequence[threading.Thread], Sequence[multiprocessing.context.Process]]</span>
</code></dt>
<dd>
<div class="desc"><p>Notify a list of workers to end and wait for them to join.</p>
Expand Down Expand Up @@ -855,7 +855,7 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="ezq.iter_msg"><code class="name flex">
<span>def <span class="ident">iter_msg</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>>, block: bool = True, timeout: Optional[float] = 0.05) ‑> Iterator[<a title="ezq.Msg" href="#ezq.Msg">Msg</a>]</span>
<span>def <span class="ident">iter_msg</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>>, block: bool = True, timeout: Optional[float] = 0.05) ‑> Iterator[<a title="ezq.Msg" href="#ezq.Msg">Msg</a>]</span>
</code></dt>
<dd>
<div class="desc"><p>Iterate over messages in a queue.</p>
Expand Down Expand Up @@ -917,7 +917,7 @@ <h2 id="yields">Yields</h2>
</details>
</dd>
<dt id="ezq.iter_q"><code class="name flex">
<span>def <span class="ident">iter_q</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>>) ‑> Iterator[<a title="ezq.Msg" href="#ezq.Msg">Msg</a>]</span>
<span>def <span class="ident">iter_q</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>>) ‑> Iterator[<a title="ezq.Msg" href="#ezq.Msg">Msg</a>]</span>
</code></dt>
<dd>
<div class="desc"><p>End a queue and iterate over its current messages.</p>
Expand Down Expand Up @@ -1026,7 +1026,7 @@ <h2 id="yields">Yields</h2>
</details>
</dd>
<dt id="ezq.put_msg"><code class="name flex">
<span>def <span class="ident">put_msg</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>>, kind: str = '', data: Any = None, order: int = 0) ‑> <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>></span>
<span>def <span class="ident">put_msg</span></span>(<span>q: <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>>, kind: str = '', data: Any = None, order: int = 0) ‑> <bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>></span>
</code></dt>
<dd>
<div class="desc"><p>Put a message into a queue.</p>
Expand Down Expand Up @@ -1404,7 +1404,7 @@ <h2 id="args">Args</h2>
</details>
<h3>Class variables</h3>
<dl>
<dt id="ezq.Q.q"><code class="name">var <span class="ident">q</span><bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fa786a6ba30>></code></dt>
<dt id="ezq.Q.q"><code class="name">var <span class="ident">q</span><bound method BaseContext.Queue of <multiprocessing.context.DefaultContext object at 0x7fdd10ecba30>></code></dt>
<dd>
<div class="desc"><p>Wrapped queue.</p></div>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions src/ezq/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"""Simple wrapper for python multiprocessing."""

__url__ = "https://github.com/metaist/ezq"
__version__ = "2.0.2"
__pubdate__ = "2021-08-24T17:25:52Z" # date/time in UTC
__version__ = "2.0.3"
__pubdate__ = "2023-05-10T03:44:15Z" # date/time in UTC
__author__ = "Metaist LLC"
__email__ = "[email protected]"
__copyright__ = "Copyright 2021 by Metaist LLC"
__copyright__ = "Copyright 2023 by Metaist LLC"
__license__ = "MIT"

0 comments on commit 5a9c1cf

Please sign in to comment.