Skip to content

Commit 6f2b076

Browse files
authored
Merge pull request #215 from pyapp-org/development
Release 4.13
2 parents 7e9a476 + b7ede2a commit 6f2b076

File tree

21 files changed

+468
-427
lines changed

21 files changed

+468
-427
lines changed

.github/workflows/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
name: Test Python ${{ matrix.python-version }}
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3.5.2
1818
with:
1919
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2020

HISTORY

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
4.13
2+
====
3+
4+
Changes
5+
-------
6+
7+
- Added ext_block_list to allow for blocking of extensions to CliApplication.
8+
9+
- Allow ext_allow_list and ext_block_list to include glob patterns.
10+
11+
Pending Deprecations
12+
--------------------
13+
14+
- Deprecated the use of ``ext_white_list`` in favour of ``ext_allow_list``.
15+
16+
117
4.12
218
====
319

docs/developers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Developers
2-
==========
1+
Contribution Guide
2+
==================
33

44
We welcome contributions to the pyApp project (and sub projects).
55

@@ -16,8 +16,8 @@ met:
1616

1717
- Update the docs with the details if required.
1818

19-
- The API matters, ensure any features provide a nice API for end users.
20-
19+
- The API matters, ensure any features provide a nice API for both developers and
20+
end-users.
2121

2222
The core pyApp package is intended to be light and mainly made up of plumbing
2323
code. If you want to add support for a particular service or server an extension

docs/extensions.rst

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Extensions
33
##########
44

5+
Extensions are features that are not part of the core pyApp framework but extend
6+
it's functionality.
7+
58

69
Available Extensions
710
====================
@@ -75,12 +78,11 @@ A Basic Project
7578

7679
An extensions consists of a standard Python project structure eg::
7780

78-
├┬ my_extension
79-
│└ __init__.py
80-
├ README.rst
81-
├ pyproject.toml
82-
├ setup.cfg
83-
└ setup.py
81+
├📁 src
82+
│ └📁 my_extension
83+
│ └📄 __init__.py
84+
├📄 README.md
85+
└📄 pyproject.toml
8486

8587

8688

@@ -93,46 +95,42 @@ The contents of which are:
9395
.. code-block:: python
9496
9597
class Extension:
96-
"""
97-
My pyApp Extension
98-
"""
98+
"""My pyApp Extension."""
9999
100100
default_settings = ".default_settings"
101101
checks = ".checks"
102102
103103
@staticmethod
104104
def register_commands(root):
105-
"""
106-
Register custom commands with pyApp.
107-
"""
105+
"""Register custom commands with pyApp."""
108106
109107
@staticmethod
110108
def ready():
111-
"""
112-
Method called once pyApp has configured environment
113-
"""
109+
"""Method called once pyApp has configured environment."""
114110
115111
116112
.. tip::
117113
A gotcha when building extensions is attempting to access settings to early
118114
this is the reason for the ``ready`` event on the Extension class. Once ready
119115
has been called settings are setup and ready for use.
120116

121-
``README.rst``
117+
``README.md``
122118
While not strictly necessary a README document is *highly recommended* and is
123119
included in the package as the long description.
124120

125-
.. code-block:: rst
121+
.. code-block:: md
126122
127-
##################
128-
My pyApp Extension
129-
##################
123+
# My pyApp Extension
130124
131125
Information about my extension
132126
133127
134-
Using Setuptools
135-
~~~~~~~~~~~~~~~~
128+
Using Setuptools with ``pyproject.toml``
129+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130+
131+
132+
Using Setuptools with ``setup.cfg``
133+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136134

137135
``setup.cfg``
138136
Defines the metadata and configuration used to build a package, this is also

docs/getting-started.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Getting Started
55
In this section we will run through the processes of building an application with
66
``pyApp``.
77

8-
App Layout
9-
==========
8+
Application Layout
9+
==================
1010

1111
We'll start with a simple application that accepts input from the command line
1212
and combines it with a value from configuration.
@@ -28,12 +28,12 @@ Project Structure
2828

2929
The basic structure of a ``pyApp`` application package consists of the following::
3030

31-
- myapp
32-
|- __init__.py Python package initialisation
33-
|- __main__.py Python main entry point
34-
|- cli.py The CLI (referenced from __main__)
35-
|- default_settings.py Definition of default runtime configuration
36-
|- checks.py Application specific checks
31+
📁 myapp
32+
├📄 __init__.py Python package initialisation
33+
├📄 __main__.py Python main entry point
34+
├📄 cli.py The CLI (referenced from __main__)
35+
├📄 default_settings.py Definition of default runtime configuration
36+
└📄 checks.py Application specific checks
3737

3838

3939
``__init__.py``
@@ -45,9 +45,11 @@ uses this file to find information for the application.
4545

4646
``__version__``
4747
The version number of the application, it is recommended that this be a
48-
semantic version. ``pyApp`` also provides tools for this to be fetched from
48+
`semantic version`_. ``pyApp`` also provides tools for this to be fetched from
4949
the installed package list.
5050

51+
.. _semantic version: https://semver.org/
52+
5153

5254
``__main__.py``
5355
---------------

docs/index.rst

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
.. PyApp documentation master file, created by
2-
sphinx-quickstart on Thu Jan 12 12:26:34 2017.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
6-
7-
81
Welcome to PyApp's documentation!
92
=================================
103

11-
*Let us handle the boring stuff!*
4+
A simple python application framework *let pyApp handle the boring stuff!*
125

13-
As of pyApp 4.0, Python < 3.6 is no longer supported.
6+
As of pyApp 4.3, Python < 3.8 is no longer supported.
147

158
+---------+------------------------------------------------------------------------------------------------------------+
16-
| Docs | .. image:: https://readthedocs.org/projects/pyapp/badge/?version=latest |
9+
| Code | .. image:: https://img.shields.io/badge/GitHub-code-brightgreen |
10+
| | :target: https://github.com/pyapp-org/pyapp |
11+
| | :alt: GitHub |
12+
| | .. image:: https://readthedocs.org/projects/pyapp/badge/?version=latest |
1713
| | :target: https://docs.pyapp.info/ |
1814
| | :alt: ReadTheDocs |
1915
+---------+------------------------------------------------------------------------------------------------------------+
20-
| Build | .. image:: https://api.dependabot.com/badges/status?host=github&repo=pyapp-org/pyapp |
21-
| | :target: https://dependabot.com |
22-
| | :alt: Dependabot Status |
23-
+---------+------------------------------------------------------------------------------------------------------------+
2416
| Quality | .. image:: https://sonarcloud.io/api/project_badges/measure?project=pyapp-org_pyapp&metric=sqale_rating |
2517
| | :target: https://sonarcloud.io/dashboard?id=pyapp-org_pyapp |
2618
| | :alt: Maintainability |
@@ -46,41 +38,41 @@ As of pyApp 4.0, Python < 3.6 is no longer supported.
4638
| | :target: https://pypi.io/pypi/pyapp/ |
4739
+---------+------------------------------------------------------------------------------------------------------------+
4840

49-
pyApp takes care of the boring boilerplate code for building a CLI, managing
50-
settings and much more so you can focus on your business logic.
41+
pyApp takes care of the application framework code, managing settings and much
42+
more so you can focus on your business logic.
5143

5244

53-
So what do we handle?
54-
=====================
45+
Features
46+
========
5547

56-
- Configuration - Loading, merging your settings from different sources
48+
* Configuration - Loading, merging your settings from different sources
5749

58-
+ Python modules
59-
+ File and HTTP(S) endpoints for JSON and YAML files.
50+
* Python modules
51+
* File and HTTP(S) endpoints for JSON and YAML files.
6052

61-
- Instance Factories - Configuration of plugins, database connections, or just
62-
implementations of an ``ABC``.
63-
Leveraging settings to make setup of your application easy and reduce coupling.
53+
* Instance Factories - Configuration of plugins, database connections, or just
54+
implementations of an ``ABC``. Leveraging settings to make setup of your
55+
application easy and reduce coupling.
6456

65-
- Dependency Injection - Easy to use dependency injection without complicated setup.
57+
* Dependency Injection - Easy to use dependency injection without complicated setup.
6658

67-
- Feature Flags - Simple methods to enable and disable features in your application
59+
* Feature Flags - Simple methods to enable and disable features in your application
6860
at runtime.
6961

70-
- Checks - A framework for checking settings are correct and environment is
62+
* Checks - A framework for checking settings are correct and environment is
7163
operating correctly (your ops team will love you)?
7264

73-
- Extensions - Extend the basic framework with extensions. Provides deterministic
65+
* Extensions - Extend the basic framework with extensions. Provides deterministic
7466
startup, extension of the CLI and the ability to register checks and extension
7567
specific default settings.
7668

77-
- Application - Provides a extensible and simple CLI interface for running
69+
* Application - Provides a extensible and simple CLI interface for running
7870
commands (including async), comes with built-in commands to execute check, setting
7971
and extension reports.
8072

81-
- Logging - Initialise and apply sane logging defaults.
73+
* Logging - Initialise and apply sane logging defaults.
8274

83-
- Highly tested and ready for production use.
75+
* Highly tested and ready for production use.
8476

8577

8678
Installation

docs/recipes/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Recipes
22
=======
33

4+
Recipes are code snippets that show how to use the library in specific use cases.
5+
6+
.. tip:: Found a good use case that is not covered by the recipes? Suggest a new
7+
recipy or request one by opening an issue on the `pyApp issue tracker`_.
8+
9+
.. _pyApp issue tracker: https://github.com/pyapp-org/pyapp/issues/new
10+
411
.. toctree::
512
:maxdepth: 1
613

docs/recipes/integration-with-django.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Add to the ``ready`` method of your *App* class:
2424
pyapp_settings.load(ObjectLoader(django_settings))
2525
2626
``ObjectLoader`` is a special loader that reads configuration variable from an
27-
existing object or in this case a Django settings object.
27+
existing object; in this case the Django settings object.

docs/recipes/single-script.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ Example:
1414
1515
@app.command
1616
def adduser(username: str, *, email: str = None, is_admin: bool = False):
17-
"""
18-
Add a user
19-
"""
17+
"""Add a user"""
2018
...
2119
2220
if __name__ == "__main__":

0 commit comments

Comments
 (0)