Skip to content

Commit

Permalink
Enabled Travis and made a bit of cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
73VW committed Apr 15, 2018
1 parent c341103 commit 59b9c53
Show file tree
Hide file tree
Showing 17 changed files with 123 additions and 233 deletions.
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
language: python
python:
- '3.6'
cache: pip
git:
depth: 1
install: pip install -r requirements.txt
stages:
- prepare cache
- test
- deploy

jobs:
include:
- stage: prepare cache
script: true
- stage: test
script: chmod +x test.sh && ./test.sh
- stage: deploy
script: skip
skip_cleanup: true
deploy:
on:
tags: true
branch:
- master
- /?(\d+\.)?(\d+\.)?(\*|\d+)$/
provider: pypi
user: 73VW
password: $PYPI_PASSWORD
notifications:
email:
on_failure: never
4 changes: 0 additions & 4 deletions arduinozore/.config/card/QXJkdWlubyBNZWdh.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions arduinozore/.config/card/QXJkdWlubyBVbm8=.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions arduinozore/.config/sensor/RXNzYWk=.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions arduinozore/.config/sensor/S1ktMDI4.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion arduinozore/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from settings import ARDUINO_CODE_FILE_NAME
from settings import ARDUINO_FILE_PATH
from settings import CONFIG_FOLDER
from settings import PORT
from settings import SSL_PORT
from settings import path
from settings import settings
Expand Down Expand Up @@ -55,7 +56,7 @@ def main():
if os.path.exists(CONFIG_FOLDER):
rmtree(CONFIG_FOLDER)

http_port = 80 if args.http_port is None else args.http_port
http_port = PORT if args.http_port is None else args.http_port
ssl_port = SSL_PORT if args.https_port is None else args.https_port

check_config_folder()
Expand Down
3 changes: 2 additions & 1 deletion arduinozore/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def path(root, *a):
CERT_FOLDER = path(ROOT, 'certs/')
STATIC_PATH = path(ROOT, 'static/')

SSL_PORT = 443
PORT = 8000
SSL_PORT = 8001

ssl_opts = {
"certfile": path(CERT_FOLDER, "myserver.crt.pem"),
Expand Down
3 changes: 3 additions & 0 deletions install_cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

yes "" | openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout arduinozore/certs/myserver.crt.key -out arduinozore/certs/myserver.crt.pem
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flake8
flake8-docstrings
isort
rstcheck

# App
tornado
Expand Down
97 changes: 49 additions & 48 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
[flake8]
exclude = shit,test,os,__pycache__
jobs = 2
max-line-length = 119
builtins=__class__
[isort]
default_section = THIRDPARTY
include_trailing_comma = true
line_length = 79
force_single_line = true
not_skip = __init__.py
skip = test,os,__pycache__
[bdist_wheel]
universal=0

[metadata]
name = arduinozore

author = André Neto da Silva, Laurent Gander & Maël Pedretti

author_email = mael.pedretti@he-arc.ch

summary = Web server for arduino sensor visualization.

license = MIT

description-file =
README.rst

home-page = https://github.com/S-Amiral/arduinozore

python_requires = >=3.6

classifier =
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Education
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Topic :: Home Automation

[entry_points]
console_scripts =
automabot = arduinozore.__main__:main
[bdist_wheel]
universal=0

[metadata]
name = Arduinozore

author = André Neto da Silva, Laurent Gander & Maël Pedretti

author_email = mael.pedretti@he-arc.ch

summary = Web server for arduino sensor visualization.

license = MIT

description-file =
README.rst

home-page = https://github.com/S-Amiral/arduinozore

python_requires = >=3.6

classifier =
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Education
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Topic :: Home Automation

[entry_points]
console_scripts =
arduinozore = arduinozore.__main__:main

[flake8]
exclude = test,__pycache__
jobs = 2
max-line-length = 119
builtins=__class__
[isort]
default_section = THIRDPARTY
include_trailing_comma = true
line_length = 79
force_single_line = true
not_skip = __init__.py
skip = test,__pycache__
33 changes: 32 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
"""Arduinozore setup file."""

from subprocess import check_call

from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install

INSTALL_CMD = "sudo apt-get install openssl"
CERT_CMD = "./install_cert.sh"


class PostDevelopCommand(develop):
"""Post-installation for development mode."""

def run(self):
"""Run post install script."""
check_call(INSTALL_CMD.split())
check_call(CERT_CMD.split())
develop.run(self)


class PostInstallCommand(install):
"""Post-installation for installation mode."""

def run(self):
"""Run post install script."""
check_call(INSTALL_CMD.split())
check_call(CERT_CMD.split())
install.run(self)


setup(
setup_requires=['pbr'],
pbr=True
pbr=True,
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
},
)
3 changes: 0 additions & 3 deletions shit/ip.py

This file was deleted.

66 changes: 0 additions & 66 deletions shit/server.py

This file was deleted.

35 changes: 0 additions & 35 deletions shit/server_with_ssl.py

This file was deleted.

32 changes: 0 additions & 32 deletions shit/test_serial.py

This file was deleted.

Loading

0 comments on commit 59b9c53

Please sign in to comment.