Skip to content

Commit

Permalink
Merge 73009ce into 3d85002
Browse files Browse the repository at this point in the history
  • Loading branch information
HazardDede committed May 5, 2020
2 parents 3d85002 + 73009ce commit 7f241ea
Show file tree
Hide file tree
Showing 21 changed files with 369 additions and 200 deletions.
4 changes: 4 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ tag = True
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:tasks/config.py]
search = VERSION = "{current_version}"
replace = VERSION = "{new_version}"

[bumpversion:file:Makefile]

[bumpversion:file:pnp/runner/pnp.py]
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ ENV/
*.logging

# ARM emulator
qemu-arm-static
qemu-arm-static

# Artifacts
requirements.dev
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install:
- pip install poetry
- poetry install -E "dropbox fitbit fritz fswatcher ftp gmail http-server miflora pushbullet sound"
script:
- poetry run make lint
- poetry run make test
- poetry run inv lint
- poetry run inv test
after_success:
- poetry run coveralls
1 change: 1 addition & 0 deletions Dockerfile.amd64
File renamed without changes.
143 changes: 0 additions & 143 deletions Makefile

This file was deleted.

11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,11 @@

pip install pnp

Optional extras

* dht: Enables `pnp.plugins.pull.sensor.DHT` (temperature and humidity sensor). Only works on ARM-based systems (like raspberry, arduino)
* fswatcher: Enables `pnp.plugins.pull.fs.FileSystemWatcher` (Watch file system for created, modified,
deleted, moved files)
* faceR: Enables `pnp.plugins.push.ml.FaceR` (Screen image files for known faces)

Installation with extras:

pip install pnp[fswatcher,faceR]
# In case of extra 'dht' you have to enable the option --process-dependency-links ...
# ... cause the required adafruit package is not on pypi.
pip install --process-dependency-links pnp[dht]

Please see the component documentation to see if a compponent requires an extra or not.

<a name="gettingstarted"></a>

Expand Down
11 changes: 1 addition & 10 deletions README.mdpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,11 @@

pip install pnp

Optional extras

* dht: Enables `pnp.plugins.pull.sensor.DHT` (temperature and humidity sensor). Only works on ARM-based systems (like raspberry, arduino)
* fswatcher: Enables `pnp.plugins.pull.fs.FileSystemWatcher` (Watch file system for created, modified,
deleted, moved files)
* faceR: Enables `pnp.plugins.push.ml.FaceR` (Screen image files for known faces)

Installation with extras:

pip install pnp[fswatcher,faceR]
# In case of extra 'dht' you have to enable the option --process-dependency-links ...
# ... cause the required adafruit package is not on pypi.
pip install --process-dependency-links pnp[dht]

Please see the component documentation to see if a compponent requires an extra or not.

## Getting started

Expand Down
15 changes: 14 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pytest-asyncio = "^0.11.0"
pytest-cov = "^2.8.1"
yamllint = "^1.23.0"
websockets = ">=6.0,<7.0"
invoke = "^1.4.1"

[tool.poetry.extras]
dht = ['Adafruit_DHT']
Expand Down
31 changes: 0 additions & 31 deletions scripts/process_docs.py

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/test-container
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function run() {
docker run -it --rm \
-v ${SOURCE}:/src \
${IMAGE} \
bash -c "poetry export --without-hashes --dev -f requirements.txt > requirements.dev && pip install --extra-index-url https://www.piwheels.hostedpi.com/simple -r requirements.dev && cd /src && make test || bash"
bash -c "cd /src; poetry export --without-hashes --dev -f requirements.txt > requirements.dev && pip install --extra-index-url https://www.piwheels.hostedpi.com/simple -r requirements.dev && invoke test || bash"
}

IMAGE=$1
Expand Down
32 changes: 32 additions & 0 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from invoke import Collection

from tasks import (
build,
config,
docker,
docs,
linting,
release,
testing
)

ns = Collection()

config = Collection.from_module(config, name="config")
docker = Collection.from_module(docker, name="docker")
docs = Collection.from_module(docs, name="docs")
linting = Collection.from_module(linting, name="lint")
release = Collection.from_module(release, name="release")
testing = Collection.from_module(testing, name="test")

# Subtasks
ns.add_collection(config)
ns.add_collection(docker)
ns.add_collection(docs)
ns.add_collection(linting)
ns.add_collection(release)
ns.add_collection(testing)

# Tasks
ns.add_task(build.version)
ns.add_task(build.clean)
20 changes: 20 additions & 0 deletions tasks/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from invoke import task

from tasks.config import VERSION


@task
def version(ctx):
"""Show the current version."""
print(VERSION)


@task
def clean(ctx):
"""Removes python build artifacts (*.pyc, *.pyo, caches, ...)"""
ctx.run(
"find . -type f -name '*.pyc' -delete && "
"find . -type f -name '*.pyo' -delete && "
"rm -rf .pytest_cache && "
"rm -rf .mypy_cache"
)
24 changes: 24 additions & 0 deletions tasks/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os

from invoke import task

# VERSION
VERSION = "0.22.0"


# PATH STUFF
PROJECT_ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
CONFIGS_PATH = os.path.join(PROJECT_ROOT_PATH, 'config')
DOCS_PATH = os.path.join(PROJECT_ROOT_PATH, 'docs')
SCRIPTS_PATH = os.path.join(PROJECT_ROOT_PATH, 'scripts')
SOURCE_PATH = os.path.join(PROJECT_ROOT_PATH, 'pnp')
TASKS_PATH = os.path.join(PROJECT_ROOT_PATH, 'tasks')
TEST_PATH = os.path.join(PROJECT_ROOT_PATH, 'tests')


@task(default=True)
def config(ctx):
"""Shows the general configuration."""
for k, v in globals().items():
if k.endswith("_PATH"):
print(k.ljust(20), v)

0 comments on commit 7f241ea

Please sign in to comment.