Skip to content

Commit 3cd2ef6

Browse files
committed
Merge branch 'development' into feature/enum-append-sequence
2 parents 884215e + b951249 commit 3cd2ef6

File tree

87 files changed

+1805
-1023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1805
-1023
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
asset_name: ${{ steps.build_package.outputs.source }}
6767
asset_content_type: application/x-tar+gzip
6868

69-
- name: Upload to PyPI
70-
id: upload_to_pypi
71-
run: |
72-
poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI"
73-
poetry publish
69+
- name: Publish to PyPI
70+
uses: pypa/[email protected]
71+
with:
72+
user: __token__
73+
password: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}

HISTORY

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,78 @@
1-
4.9.0
2-
=====
1+
4.12
2+
====
33

44
Changes
5-
--------
5+
-------
6+
7+
- Introduction of typed_settings, providing a cleaner way to access default settings
8+
that supports auto-completion and type inference. And preparing the way for more
9+
in-depth checks that ensure settings values match the expected types.
10+
11+
- Support ``Literal`` types in CLI. Maps str and int literals to choices.
612

713
- Support sequences of Enum values in the CLI. This is implemented via the
814
``AppendEnumValue`` and ``AppendEnumName`` actions.
915

16+
- Migrate from pkg_resources to the standardised builtin importlib.metadata.
17+
18+
- Fix for handling events/callbacks on classes where the parent has __slots__ defined.
19+
20+
21+
4.11.0
22+
======
23+
24+
Changes
25+
-------
26+
27+
- Self is now ignored in command handlers if it is the first argument. This covers
28+
the case where a non ``staticfunction`` is used as a handler when grouped as part
29+
of a command group.
30+
31+
- Allow CLI entry points to define an argument as a date, time or datetime type
32+
which will accept an valid ISO8601 string.
33+
34+
- Add pre_dispatch, post_dispatch and dispatch_error events to CliApplication
35+
36+
37+
4.10.1
38+
======
39+
40+
Changes
41+
-------
42+
43+
- Fix issue with docs build related to Poetry and RTD
44+
45+
46+
4.10.0
47+
======
48+
49+
Changes
50+
-------
51+
52+
- Add implementation of ``multiprocessing.Pool`` that ensures that settings are
53+
mirrored into any worker process.
54+
55+
- Include pytest plugin to provide fixtures
56+
57+
58+
4.9.0
59+
=====
60+
61+
Changes
62+
-------
63+
64+
- Changed settings to be support being pickled.
65+
66+
- Added feature to export and restore settings into a serialised form for
67+
use-cases where settings need to be duplicated (eg deploying tasks into a
68+
spark cluster where settings are required).
69+
1070

1171
4.8.2
1272
=====
1373

1474
Changes
15-
--------
75+
-------
1676

1777
- Extend change to RegexType to allow for any custom ArgumentType by extending
1878
the ArgumentType ABC.
@@ -25,7 +85,7 @@ Changes
2585
=====
2686

2787
Changes
28-
--------
88+
-------
2989

3090
- Fix bug with RegexType argument where regex searched input string not raising
3191
an invalid argument if the input _contained_ a valid string.
@@ -37,7 +97,7 @@ Changes
3797
=====
3898

3999
Changes
40-
--------
100+
-------
41101

42102
- Dropping official support for Python 3.6 and 3.7
43103

@@ -60,7 +120,7 @@ Changes
60120
=====
61121

62122
Changes
63-
--------
123+
-------
64124

65125
- Improve the settings reset to properly apply the base-settings after reset.
66126
These are the basic settings required for the application to operate

docs/reference/conf/base_settings.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. automodule:: pyapp.typed_settings

docs/reference/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Contents:
1010
app
1111
checks
1212
conf
13-
conf/base_settings
13+
conf/typed-settings
1414
conf/helpers
1515
events
1616
injection
1717
feature-flags
18+
multiprocessing
1819
extensions

docs/reference/multiprocessing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. automodule:: pyapp.multiprocessing

poetry.lock

Lines changed: 654 additions & 602 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["poetry>=1.0", "rtd-poetry-tmp"]
3-
build-backend = "rtd_poetry"
2+
requires = ["poetry-core>=1.0.0"]
3+
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pyapp"
7-
version = "4.9"
7+
version = "4.12.0"
88
description = "A Python application framework - Let us handle the boring stuff!"
99
authors = ["Tim Savage <[email protected]>"]
1010
license = "BSD-3-Clause"
@@ -37,20 +37,24 @@ python = "^3.8"
3737
argcomplete = "*"
3838
colorama = "*"
3939
yarl = "*"
40+
importlib_metadata = {version = "*", python = "<=3.9"}
4041

4142
pyyaml = {version = "*", optional = true }
4243
toml = {version = "*", optional = true }
4344

4445
[tool.poetry.dev-dependencies]
45-
pytest = "^7.1.2"
46-
pytest-cov = "^3.0.0"
47-
pytest-asyncio = "^0.18.3"
46+
pytest = "^7.2"
47+
pytest-cov = "^4.0"
48+
pytest-asyncio = "^0.20"
4849
nox = "*"
49-
sphinx = "^5.0.2"
50+
sphinx = "^6.0"
5051

5152
[tool.poetry.extras]
5253
yaml = ["pyyaml"]
5354
toml = ["toml"]
5455

5556
[tool.poetry.urls]
5657
"Bug Tracker" = "https://github.com/pyapp-org/pyapp/issues"
58+
59+
[tool.poetry.plugins."pytest11"]
60+
"pyapp-pytest" = "pyapp.testing.pytest_plugin"

samples/sample-single.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
"""
22
Single file sample
33
"""
4-
from pyapp.app import argument
54
from pyapp.app import CliApplication
6-
from pyapp.app import CommandOptions
7-
from pyapp.app import KeyValueAction
5+
from pyapp.events import listen_to
86

97
APP = CliApplication()
108

119

10+
@listen_to(APP.pre_dispatch)
11+
def pre_dispatch(opts):
12+
print(opts)
13+
14+
1215
@APP.default
1316
def helper(*, bar: dict):
1417
print(bar)
1518
# print(opts.bar)
1619

1720

21+
@listen_to(APP.post_dispatch)
22+
def pre_dispatch(result, opts):
23+
print(result, opts)
24+
25+
1826
if __name__ == "__main__":
1927
APP.dispatch()

0 commit comments

Comments
 (0)