Skip to content

Commit d9f3ab3

Browse files
committed
Merge branch 'release/4.2.0'
2 parents 8c80645 + 7b16f46 commit d9f3ab3

Some content is hidden

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

73 files changed

+1269
-445
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
repos:
2-
- repo: https://github.com/ambv/black
2+
- repo: https://github.com/asottile/reorder_python_imports
3+
rev: v1.9.0
4+
hooks:
5+
- id: reorder-python-imports
6+
7+
- repo: https://github.com/ambv/black
38
rev: stable
49
hooks:
5-
- id: black
6-
language_version: python3.6
10+
- id: black
11+
language_version: python3.6
12+
13+
- repo: https://github.com/pre-commit/mirrors-pylint
14+
rev: v2.4.4
15+
hooks:
16+
- id: pylint
17+
files: pyapp/.*
18+
args: [
19+
--disable=import-error,
20+
]

.pylintrc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[MASTER]
2+
disable =
3+
bad-continuation,
4+
line-too-long,
5+
too-few-public-methods,
6+
no-self-use,
7+
duplicate-code,
8+
9+
good-names =
10+
logger, # Logger instances
11+
ex, # Exceptions
12+
fp, # File pointer
13+
app, # Application instance
14+
15+
ignore-patterns =
16+
test_.*py,
17+
conf\.py,
18+
19+
[SIMILARITIES]
20+
21+
# Minimum lines number of a similarity.
22+
min-similarity-lines=4
23+
24+
# Ignore comments when computing similarities.
25+
ignore-comments=yes
26+
27+
# Ignore docstrings when computing similarities.
28+
ignore-docstrings=yes
29+
30+
[DESIGN]
31+
32+
# Maximum number of arguments for function / method
33+
max-args=12

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ python:
55
- "3.6"
66
- "3.7"
77
- "3.8"
8-
- "3.7-dev"
98
- "3.8-dev"
9+
- "3.9-dev"
1010
- "nightly"
1111
- "pypy3"
1212

1313
matrix:
1414
fast_finish: true
1515
allow_failures:
16-
- python: "3.7-dev"
1716
- python: "3.8-dev"
17+
- python: "3.9-dev"
1818
- python: "nightly"
1919
- python: "pypy3"
2020

@@ -23,14 +23,15 @@ env:
2323
- CC_TEST_REPORTER_ID=767be575271677c6435197b16f142b6ded3332f4f5112ed30fcc760d02a7d762
2424

2525
install:
26-
- travis_retry pip install bandit coverage
26+
- travis_retry pip install bandit coverage pylint
2727

2828
before_script:
2929
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
3030
- chmod +x ./cc-test-reporter
3131
- ./cc-test-reporter before-build
3232

3333
script:
34+
- pylint pyapp --disable=import-error
3435
- bandit -ll -r pyapp
3536
- python setup.py test
3637

@@ -49,4 +50,3 @@ deploy:
4950
skip_existing: true
5051
on:
5152
branch: master
52-

CODE_OF_CONDUCT.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Our Pledge
88
In the interest of fostering an open and welcoming environment, we as
99
contributors and maintainers pledge to making participation in our project and
1010
our community a harassment-free experience for everyone, regardless of age, body
11-
size, disability, ethnicity, sex characteristics, gender identity and expression,
11+
size, disability, ethnicity, sex/genders, gender identity and expression,
1212
level of experience, education, socio-economic status, nationality, personal
13-
appearance, race, religion, or sexual identity and orientation.
13+
appearance, race, religion.
1414

1515
Our Standards
1616
=============

HISTORY

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
4.2.0
2+
=====
3+
4+
Features
5+
--------
6+
7+
- Added Object config loader, to aid in integration into other frameworks eg
8+
Django.
9+
10+
- Add argument action for handling Enums
11+
12+
- Add argument type for validation with regex
13+
14+
15+
Fixes
16+
-----
17+
18+
- Utilisation of pylint to improve and maintain code quality.
19+
20+
- Use `sys.exit` instead of the `exit`.
21+
22+
- Fix command aliases not being resolved at run-time bug.
23+
24+
25+
Backwards Compatibility
26+
-----------------------
27+
28+
- The ``inject_into`` decorator has been removed use the simpler ``inject``
29+
decorator in it's place.
30+
31+
132
4.1.0
233
=====
334

README.rst

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,35 @@ pyApp - A python application framework
44

55
*Let us handle the boring stuff!*
66

7-
.. image:: https://img.shields.io/travis/pyapp-org/pyapp.svg?style=flat
8-
:target: https://travis-ci.org/pyapp-org/pyapp
9-
:alt: Travis CI Status
10-
11-
.. image:: https://pyup.io/repos/github/pyapp-org/pyapp/shield.svg
12-
:target: https://pyup.io/repos/github/pyapp-org/pyapp/
13-
:alt: Updates
14-
15-
.. image:: https://img.shields.io/pypi/wheel/pyapp.svg
16-
:target: https://pypi.io/pypi/pyapp/
17-
18-
.. image:: https://api.codeclimate.com/v1/badges/58f9ffacb711c992610d/test_coverage
19-
:target: https://codeclimate.com/github/pyapp-org/pyapp/test_coverage
20-
:alt: Test Coverage
21-
22-
.. image:: https://api.codeclimate.com/v1/badges/58f9ffacb711c992610d/maintainability
23-
:target: https://codeclimate.com/github/pyapp-org/pyapp/maintainability
24-
:alt: Maintainability
25-
26-
.. image:: https://img.shields.io/pypi/v/pyapp.svg
27-
:target: https://pypi.io/pypi/pyapp/
28-
:alt: Latest Version
29-
30-
.. image:: https://img.shields.io/pypi/pyversions/pyapp.svg
31-
:target: https://pypi.io/pypi/pyapp/
32-
33-
.. image:: https://img.shields.io/pypi/l/pyapp.svg
34-
:target: https://pypi.io/pypi/pyapp/
35-
36-
.. image:: https://readthedocs.org/projects/pyapp/badge/?version=latest
37-
:target: https://docs.pyapp.info/
38-
:alt: ReadTheDocs
39-
40-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
41-
:target: https://github.com/ambv/black
42-
:alt: Once you go Black...
43-
7+
+---------+---------------------------------------------------------------------------------------+
8+
| Docs | .. image:: https://readthedocs.org/projects/pyapp/badge/?version=latest |
9+
| | :target: https://docs.pyapp.info/ |
10+
| | :alt: ReadTheDocs |
11+
+---------+---------------------------------------------------------------------------------------+
12+
| Build | .. image:: https://img.shields.io/travis/pyapp-org/pyapp.svg?style=flat |
13+
| | :target: https://travis-ci.org/pyapp-org/pyapp |
14+
| | :alt: Travis CI Status |
15+
+---------+---------------------------------------------------------------------------------------+
16+
| Quality | .. image:: https://api.codeclimate.com/v1/badges/58f9ffacb711c992610d/maintainability |
17+
| | :target: https://codeclimate.com/github/pyapp-org/pyapp/maintainability |
18+
| | :alt: Maintainability |
19+
| | .. image:: https://api.codeclimate.com/v1/badges/58f9ffacb711c992610d/test_coverage |
20+
| | :target: https://codeclimate.com/github/pyapp-org/pyapp/test_coverage |
21+
| | :alt: Test Coverage |
22+
| | .. image:: https://img.shields.io/badge/code%20style-black-000000.svg |
23+
| | :target: https://github.com/ambv/black |
24+
| | :alt: Once you go Black... |
25+
+---------+---------------------------------------------------------------------------------------+
26+
| Package | .. image:: https://img.shields.io/pypi/v/pyapp.svg |
27+
| | :target: https://pypi.io/pypi/pyapp/ |
28+
| | :alt: Latest Version |
29+
| | .. image:: https://img.shields.io/pypi/pyversions/pyapp.svg |
30+
| | :target: https://pypi.io/pypi/pyapp/ |
31+
| | .. image:: https://img.shields.io/pypi/l/pyapp.svg |
32+
| | :target: https://pypi.io/pypi/pyapp/ |
33+
| | .. image:: https://img.shields.io/pypi/wheel/pyapp.svg |
34+
| | :target: https://pypi.io/pypi/pyapp/ |
35+
+---------+---------------------------------------------------------------------------------------+
4436

4537
Many features inspired by Django, but modified to be more general for use
4638
outside of web applications.
@@ -52,42 +44,56 @@ So what do we handle?
5244
=====================
5345

5446
- Configuration - Loading, merging your settings from different sources
47+
5548
+ Python modules
5649
+ File and HTTP(S) endpoints for JSON and YAML files.
50+
5751
- Instance Factories - Configuration of plugins, database connections, or just
5852
implementations of an ``ABC``.
5953
Leveraging settings to make setup of your application easy and reduce coupling.
60-
- Checks - A framework for checking settings are correct and checking that your
61-
application connect to that API end point (your ops team will love you)?
62-
- Extensions - Extend the basic framework with extensions, the framework provides
63-
deterministic startup, addition of commands to the CLI and the ability to
64-
register checks and default settings.
65-
- Application - Provides a extensible and simple CLI interface for starting
66-
running commands, comes with built-in commands to support Checks, report
67-
settings/extensions.
68-
- Logging - Initialise and apply sane logging defaults (when using an Application).
69-
Defaults to logging to `stderr` so your application can write data to `stdout`
70-
for piping into other tools.
54+
55+
- Dependency Injection - Easy to use dependency injection without complicated setup.
56+
57+
- Checks - A framework for checking settings are correct and environment is
58+
operating correctly (your ops team will love you)?
59+
60+
- Extensions - Extend the basic framework with extensions. Provides deterministic
61+
startup, extension of the CLI and the ability to register checks and extension
62+
specific default settings.
63+
64+
- Application - Provides a extensible and simple CLI interface for running
65+
commands, comes with built-in commands to execute check, setting and extension
66+
reports.
67+
68+
- Logging - Initialise and apply sane logging defaults.
69+
70+
- Highly tested and ready for production use.
7171

7272

7373
Extensions
7474
==========
7575

76-
- SQLAlchemy - `pyapp.sqlalchemy <https://www.github.com/pyapp-org/pyapp.sqlalchemy>`_
77-
- Redis - `pyapp.redis <https://www.github.com/pyapp-org/pyapp.redis>`_
78-
- AIOBotocore - `pyapp.aiobotocore <https://www.github.com/pyapp-org/pyapp.aiobotocore>`_
76+
- SQLAlchemy - `pyapp.sqlalchemy`_
77+
- Redis - `pyapp.redis`_
78+
- AIOBotocore - `pyapp.aiobotocore`_
7979

8080
In development
8181
--------------
8282

83-
- SMTP - `pyapp.SMTP <https://www.github.com/pyapp-org/pyapp.SMTP>`_
84-
- Boto3 - `pyapp.boto3 <https://www.github.com/pyapp-org/pyapp.boto3>`_
83+
- SMTP - `pyapp.SMTP`_
84+
- Boto3 - `pyapp.boto3`_
8585

8686
Coming soon
8787
-----------
8888

8989
Extensions for LDAP, Paramiko.
9090

91+
.. _pyapp.sqlalchemy: https://www.github.com/pyapp-org/pyapp.sqlalchemy
92+
.. _pyapp.redis: https://www.github.com/pyapp-org/pyapp.redis
93+
.. _pyapp.aiobotocore: https://www.github.com/pyapp-org/pyapp.aiobotocore
94+
.. _pyapp.SMTP: https://www.github.com/pyapp-org/pyapp.SMTP
95+
.. _pyapp.boto3: https://www.github.com/pyapp-org/pyapp.boto3
96+
9197

9298
Contributions
9399
=============

docs/conf.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import sys
2-
import os
2+
from pathlib import Path
3+
4+
HERE = Path(__file__).parent
5+
36

47
# If extensions (or modules to document with autodoc) are in another directory,
58
# add these directories to sys.path here. If the directory is relative to the
69
# documentation root, use os.path.abspath to make it absolute, like shown here.
7-
sys.path.insert(0, os.path.abspath(".."))
10+
sys.path.insert(0, HERE.parent.as_posix())
11+
12+
about = {}
13+
exec((HERE.parent / "pyapp" / "__version__.py").read_text(), about)
814

9-
import pyapp
1015

1116
# -- General configuration ------------------------------------------------
1217

@@ -42,7 +47,7 @@
4247
# built documents.
4348
#
4449
# The short X.Y version.
45-
version = pyapp.__version__
50+
version = about["__version__"]
4651
# The full version, including alpha/beta/rc tags.
4752
release = version
4853

0 commit comments

Comments
 (0)