Skip to content
This repository was archived by the owner on Jun 26, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f89b6a2
Create setup.py
ctalkington Apr 4, 2020
f4476bc
Create MANIFEST.in
ctalkington Apr 4, 2020
0b7de7e
Create requirements.txt
ctalkington Apr 4, 2020
fb81f41
Create requirements_dev.txt
ctalkington Apr 4, 2020
6c79f76
Create requirements_test.txt
ctalkington Apr 4, 2020
603b54c
Create README.md
ctalkington Apr 4, 2020
f3ceb60
Create .isort.cfg
ctalkington Apr 4, 2020
b0bdfa4
Create pylintrc
ctalkington Apr 4, 2020
76f18ba
Create Dockerfile.dev
ctalkington Apr 4, 2020
cd53753
Create .yamllint
ctalkington Apr 4, 2020
8f1b3c9
Create .pre-commit-config.yaml
ctalkington Apr 4, 2020
2afeba9
Create .editorconfig
ctalkington Apr 4, 2020
6773627
Create .flake8
ctalkington Apr 4, 2020
3329587
Create devcontainer.json
ctalkington Apr 4, 2020
b35af3d
Create release-drafter.yml
ctalkington Apr 4, 2020
be21673
Create release-drafter.yml
ctalkington Apr 4, 2020
4dac62e
Create publish.yml
ctalkington Apr 4, 2020
789cef9
Create ci.yml
ctalkington Apr 4, 2020
e96191b
Create __init__.py
ctalkington Apr 4, 2020
50474df
Create __version__.py
ctalkington Apr 4, 2020
49e8fde
Create const.py
ctalkington Apr 4, 2020
a5675f1
Create exceptions.py
ctalkington Apr 4, 2020
fb73a1e
Create models.py
ctalkington Apr 4, 2020
9398fb7
Create sonarr.py
ctalkington Apr 4, 2020
643aecb
Create __init__.py
ctalkington Apr 4, 2020
c188f9f
Create test_sonarr.py
ctalkington Apr 4, 2020
4af0d47
Update sonarr.py
ctalkington Apr 4, 2020
e27e1d8
Update test_sonarr.py
ctalkington Apr 4, 2020
0a3f050
Update sonarr.py
ctalkington Apr 4, 2020
291e5d5
Create test_interface.py
ctalkington Apr 4, 2020
3abe932
Create test_models.py
ctalkington Apr 4, 2020
23904b2
Update test_interface.py
ctalkington Apr 4, 2020
41dc6e2
Create system-status.json
ctalkington Apr 4, 2020
1c4618a
Create diskspace.json
ctalkington Apr 4, 2020
24d2892
Update system-status.json
ctalkington Apr 4, 2020
1a0cd79
Update diskspace.json
ctalkington Apr 4, 2020
42d29ba
Update README.md
ctalkington Apr 4, 2020
87c9282
Update models.py
ctalkington Apr 4, 2020
d1025ea
Update sonarr.py
ctalkington Apr 4, 2020
ec1b524
Update sonarr.py
ctalkington Apr 4, 2020
632d2af
Update test_interface.py
ctalkington Apr 4, 2020
c0c3d2d
Update test_sonarr.py
ctalkington Apr 4, 2020
262baaf
Rename test_sonarr.py to test_client.py
ctalkington Apr 4, 2020
956183a
Update models.py
ctalkington Apr 4, 2020
adbe29c
Update test_models.py
ctalkington Apr 4, 2020
13513a4
Update test_models.py
ctalkington Apr 4, 2020
b4ef12c
Update test_models.py
ctalkington Apr 4, 2020
0e6f6aa
Update test_models.py
ctalkington Apr 4, 2020
c7a056e
Update test_models.py
ctalkington Apr 4, 2020
3949d3d
Update test_models.py
ctalkington Apr 4, 2020
dd8bd03
Update sonarr.py
ctalkington Apr 4, 2020
2b6c255
Update test_client.py
ctalkington Apr 4, 2020
70d5d10
Update test_client.py
ctalkington Apr 4, 2020
94f73a5
Update test_client.py
ctalkington Apr 4, 2020
cf50775
Update test_client.py
ctalkington Apr 4, 2020
8f122af
Update test_interface.py
ctalkington Apr 4, 2020
0d62d80
Update test_interface.py
ctalkington Apr 4, 2020
d92388e
Update test_client.py
ctalkington Apr 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Python Sonarr Dev",
"context": "..",
"dockerFile": "../Dockerfile.dev",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintPath": "/usr/local/bin/pylint",
"python.formatting.provider": "black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
},
"extensions": [
"ms-python.python",
"esbenp.prettier-vscode"
]
}
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
ident_size = 4

[*.md]
ident_size = 2
trim_trailing_whitespace = false

[*.json]
ident_size = 2

[{.gitignore,.gitkeep,.editorconfig}]
ident_size = 2

[Makefile]
ident_style = tab
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length=88
ignore=D202
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed

$CHANGES
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Continuous Integration

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checking out code from GitHub
uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements_test.txt
pip install -r requirements.txt
pip install pre-commit
pip list
pre-commit --version
- name: Run pre-commit on all files
run: |
pre-commit run --all-files --show-diff-on-failure
test:
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
needs: [linting]
strategy:
matrix:
os: [ubuntu]
python: [3.7, 3.8]
steps:
- name: Checking out code from GitHub
uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements_test.txt
pip install -r requirements.txt
pip list
- name: Pytest with coverage reporting
run: pytest --cov=sonarr --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.python == 3.8 && matrix.os == 'ubuntu'
uses: codecov/codecov-action@v1.0.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
name: Update Release Draft
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
multi_line_output=3
line_length=88
include_trailing_comma=True
project=sonarr
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
repos:
- repo: https://github.com/ambv/black
rev: 19.10b0
hooks:
- id: black
args: [--safe, --quiet, --target-version, py36]
- repo: https://github.com/asottile/blacken-docs
rev: v1.6.0
hooks:
- id: blacken-docs
additional_dependencies: [black==19.3b0]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: debug-statements
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: requirements-txt-fixer
- id: check-byte-order-marker
- id: check-case-conflict
- id: fix-encoding-pragma
args: ["--remove"]
- id: check-ast
- id: detect-private-key
- id: forbid-new-submodules
- repo: https://github.com/pre-commit/pre-commit
rev: v2.1.1
hooks:
- id: validate_manifest
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
hooks:
- id: pylint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
hooks:
- id: mypy
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies: ["flake8-docstrings"]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.20.0
hooks:
- id: yamllint
exclude: ^\.github/workflows/*\.yml$
- repo: https://github.com/asottile/pyupgrade
rev: v2.1.0
hooks:
- id: pyupgrade
args: [--py36-plus]
66 changes: 66 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
ignore: |
.github/
rules:
braces:
level: error
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
level: error
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
level: error
max-spaces-before: 0
max-spaces-after: 1
commas:
level: error
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
level: error
require-starting-space: true
min-spaces-from-content: 2
comments-indentation:
level: error
document-end:
level: error
present: false
document-start:
level: error
present: true
empty-lines:
level: error
max: 1
max-start: 0
max-end: 1
hyphens:
level: error
max-spaces-after: 1
indentation:
level: error
spaces: 2
indent-sequences: true
check-multi-line-strings: false
key-duplicates:
level: error
line-length:
level: warning
max: 120
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file:
level: error
new-lines:
level: error
type: unix
trailing-spaces:
level: error
truthy:
level: error
60 changes: 60 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM python:3

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Uncomment the following COPY line and the corresponding lines in the `RUN` command if you wish to
# include your requirements in the image itself. It is suggested that you only do this if your
# requirements rarely (if ever) change.
# COPY requirements.txt /tmp/pip-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git openssh-client iproute2 procps lsb-release \
#
# Install pylint
&& pip --disable-pip-version-check --no-cache-dir install pylint \
#
# Update Python environment based on requirements.txt
# && pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp \
#
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
&& groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support for the non-root user
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
&& chmod 0440 /etc/sudoers.d/$USERNAME \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

# Install Python dependencies from requirements
COPY requirements.txt requirements_test.txt requirements_dev.txt ./

RUN pip3 install -r requirements_test.txt; \
pip3 install -r requirements_dev.txt; \
pip install -Ur requirements.txt; \
rm -f requirements.txt requirements_test.txt requirements_dev.txt
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.md
include LICENSE.md
graft sonarr
recursive-exclude * *.py[co]
Loading