Skip to content

Commit

Permalink
Merge pull request #130 from da-h/v5-dev
Browse files Browse the repository at this point in the history
V5
  • Loading branch information
da-h authored Feb 14, 2023
2 parents 0795228 + dc7b4b5 commit f911057
Show file tree
Hide file tree
Showing 160 changed files with 2,096 additions and 718 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linting-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Static Analysis
run: |
flake8 src --count --ignore E501 --statistics
pylint -d W0511 -d C0114 -d C0116 -d C0115 -d C0301 -d C0302 -d C0303 -d C0103 -d C0209 -d C3001 -d R0913 -d R0914 -d R0902 -d R0912 -d R0801 -d R1702 -d W0212 -d W0223 -d E1101 -d W0221 -d E1102 src/miniflask
flake8 src --count --ignore 'E501,W503,C901' --statistics
pylint -d W0511 -d C0114 -d C0116 -d C0115 -d C0301 -d C0302 -d C0303 -d C0103 -d C0209 -d C3001 -d R0913 -d R0914 -d R0902 -d R0912 -d R0801 -d R1702 -d W0212 -d W0223 -d E1101 -d W0221 -d E1102 -d R0915 -d R1710 src/miniflask
pylint --exit-zero src/miniflask
- name: Syntax Check of Tests
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ jobs:
- name: Create Release
if: steps.autotag.outputs.tagsha
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.autotag.outputs.tagname }}
release_name: "Miniflask ${{ steps.autotag.outputs.tagname }}"
generate_release_notes: true
- name: Show version
if: steps.autotag.outputs.tagsha
run: echo ${{ steps.autotg.outputs.tagsha }}
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-yaml
- id: check-added-large-files
- id: flake8
args: [--count,--ignore,E501,--statistics,--exclude,.git]
- repo: local
- id: check-yaml
- id: check-added-large-files
- id: flake8
args: [--count, --ignore, 'E501,W503,C901', --statistics, --exclude, .git]
- repo: local
hooks:
- id: pylint
- id: pylint
name: pylint
entry: bash -c "PYTHONPATH=$(pwd)/src find tests -type d -exec test -e '{}'/.module \; -exec pylint -d W0511 -d C0114 -d C0116 -d C0115 -d C0301 -d C0103 -d C0209 -d C901 -d R0913 -d R0914 -d R0902 -d R0912 -d R0801 -d W0212 -d W0223 -d E1101 -d W0221 -d E1102 '{}' +"
entry: bash -c "PYTHONPATH=$(pwd)/src find tests -type d -exec test -e '{}'/.module \; -exec pylint -d W0511 -d C0114 -d C0116 -d C0115 -d C0301 -d C0103 -d C0209 -d C901 -d R0913 -d R0914 -d R0902 -d R0912 -d R0801 -d W0212 -d W0223 -d E1101 -d W0221 -d R0915 -d R1710 -d E1102 '{}' +"
language: system
types: [python]
args: [ ]
args: []
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Our main.py looks like this:
import miniflask

# initialize miniflask
mf = miniflask.init(module_dirs="./modules")
mf = miniflask.init(".modules")
mf.run()
```

Expand Down
2 changes: 1 addition & 1 deletion docs/01-Getting-Started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Our main.py looks like this:
import miniflask

# initialize miniflask
mf = miniflask.init(module_dirs="./modules")
mf = miniflask.init(".modules")
mf.parse_args()

# check if all requested modules are loaded
Expand Down
10 changes: 4 additions & 6 deletions docs/03-Modules/01-Module-Declaration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Telling MiniFlask what exists.
import miniflask

# tell miniflask where to look for modules
mf = miniflask.init(module_dirs="./modules")
mf = miniflask.init(".modules")

# parse CLI-args & run the main event
mf.run()
Expand Down Expand Up @@ -48,7 +48,7 @@ For instance, we could organize the folder `./modules` like this:
```shell
> ls
main.py
modules/
mods/
module1/__init__.py
... /.module
module2/__init__.py
Expand All @@ -63,11 +63,9 @@ modules/

Further, we initialized miniflask using the line
```py
mf = miniflask.init({
"mods": "./modules",
})
mf = miniflask.init(".mods")
```
by specifying the name `mods` for our main repository contained in the folder `./modules/`.
by specifying the name `mods` for our main repository contained in the folder `./mods/`.


Every module in this repository can now be referenced in two ways: \block[
Expand Down
4 changes: 2 additions & 2 deletions docs/03-Modules/03-Register-Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def register(mf):
import miniflask

# initialize miniflask
mf = miniflask.init(module_dirs="./modules")
mf = miniflask.init(".modules")
state, event = mf.state, mf.event
mf.parse_args()
mf.event.main()
Expand Down Expand Up @@ -96,7 +96,7 @@ def register(mf):
import miniflask

# initialize miniflask
mf = miniflask.init(module_dirs="./modules")
mf = miniflask.init(".modules")
state, event = mf.state, mf.event
mf.parse_args()
varA=42
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
Build an absolute path from *parts* and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
Expand Down
5 changes: 2 additions & 3 deletions src/miniflask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from .miniflask import miniflask as init, print_info, get_default_args
from .event import outervar
from .modules import *
from .state import like, optional
from .state import optional

# meta
__version__ = "4.3.2"
__version__ = "5.0.0"
__title__ = "miniflask"
__description__ = "Small research-oriented hook-based plugin engine."
__url__ = "https://github.com/da-h/miniflask"
Expand Down
Loading

0 comments on commit f911057

Please sign in to comment.