-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 59545b6
Showing
12 changed files
with
266 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# pylint | ||
.pylint.d/ | ||
|
||
# VS Code | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ARG BUILD_FROM | ||
FROM BUILD_FROM | ||
|
||
# Install requirements | ||
COPY requirements.txt /usr/src/ | ||
RUN apk add --no-cache --virtual .build-dependencies \ | ||
make \ | ||
g++ \ | ||
openssl-dev \ | ||
libffi-dev \ | ||
musl-dev \ | ||
&& export MAKEFLAGS="-j$(nproc)" \ | ||
&& pip3 install --no-cache-dir -r /usr/src/requirements.txt \ | ||
&& apk del .build-dependencies \ | ||
&& rm -f /usr/src/requirements.txt | ||
|
||
# Install builder | ||
COPY . /usr/src/builder/ | ||
RUN apk add --no-cache /usr/src/builder \ | ||
&& rm -fr /usr/src/builder | ||
|
||
WORKDIR /data | ||
CMD [ "python3", "-m", "builder" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Hass.io Wheels builder | ||
|
||
## Supported file transfer | ||
|
||
- rsync | ||
|
||
## Config | ||
|
||
``` | ||
[builder] | ||
upload=rsync | ||
index=https://xxxx/ | ||
requirements= | ||
requirements_all.txt | ||
[rsync] | ||
path= | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Hass.io wheels builder for Home Assistant.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Hass.io Builder main application.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""Pip build commands.""" | ||
import subprocess | ||
from pathlib import Path | ||
|
||
|
||
def build_wheels(requirements: Path, index: str, output: Path) -> bool: | ||
"""Build wheels from a requirements file into output.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[MASTER] | ||
reports=no | ||
|
||
# Reasons disabled: | ||
# locally-disabled - it spams too much | ||
# duplicate-code - unavoidable | ||
# cyclic-import - doesn't test if both import on load | ||
# abstract-class-little-used - prevents from setting right foundation | ||
# abstract-class-not-used - is flaky, should not show up but does | ||
# unused-argument - generic callbacks and setup methods create a lot of warnings | ||
# global-statement - used for the on-demand requirement installation | ||
# redefined-variable-type - this is Python, we're duck typing! | ||
# too-many-* - are not enforced for the sake of readability | ||
# too-few-* - same as too-many-* | ||
# abstract-method - with intro of async there are always methods missing | ||
|
||
disable= | ||
abstract-class-little-used, | ||
abstract-class-not-used, | ||
abstract-method, | ||
cyclic-import, | ||
duplicate-code, | ||
global-statement, | ||
locally-disabled, | ||
not-context-manager, | ||
redefined-variable-type, | ||
too-few-public-methods, | ||
too-many-arguments, | ||
too-many-branches, | ||
too-many-instance-attributes, | ||
too-many-lines, | ||
too-many-locals, | ||
too-many-public-methods, | ||
too-many-return-statements, | ||
too-many-statements, | ||
unused-argument, | ||
line-too-long, | ||
bad-continuation, | ||
too-few-public-methods, | ||
no-self-use, | ||
not-async-context-manager, | ||
too-many-locals, | ||
too-many-branches, | ||
no-else-return | ||
|
||
[EXCEPTIONS] | ||
overgeneral-exceptions=Exception | ||
|
||
|
||
[TYPECHECK] | ||
ignored-modules = distutils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
click==7.0 | ||
requests==2.21.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
flake8==3.7.7 | ||
pylint==2.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[isort] | ||
multi_line_output = 3 | ||
include_trailing_comma=True | ||
force_grid_wrap=0 | ||
line_length=88 | ||
indent = " " | ||
not_skip = __init__.py | ||
force_sort_within_sections = true | ||
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER | ||
default_section = THIRDPARTY | ||
forced_separate = tests | ||
combine_as_imports = true | ||
use_parentheses = true | ||
|
||
[flake8] | ||
max-line-length = 88 | ||
ignore = E501, W503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from setuptools import setup | ||
|
||
VERSION=0.1 | ||
|
||
setup( | ||
name='builder', | ||
version=VERSION, | ||
license='Apache License 2.0', | ||
author='The Home Assistant Authors', | ||
author_email='[email protected]', | ||
url='https://home-assistant.io/', | ||
description="Hass.io wheels builder form Home Assistant.", | ||
long_description="", | ||
classifiers=[ | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: POSIX :: Linux', | ||
'Topic :: Home Automation' | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Topic :: Scientific/Engineering :: Atmospheric Science', | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'Programming Language :: Python :: 3.7', | ||
], | ||
keywords=['docker', 'home-assistant', 'hass.io'], | ||
zip_safe=False, | ||
platforms='any', | ||
packages=['builder'], | ||
include_package_data=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[tox] | ||
envlist = lint, tests | ||
|
||
[testenv] | ||
deps = | ||
-r{toxinidir}/requirements.txt | ||
-r{toxinidir}/requirements_tests.txt | ||
|
||
[testenv:lint] | ||
basepython = python3 | ||
ignore_errors = True | ||
commands = | ||
flake8 hassio | ||
pylint --rcfile pylintrc hassio | ||
|
||
[testenv:tests] | ||
basepython = python3 | ||
commands = | ||
pytest --duration=10 tests |