Skip to content

Commit 75794f1

Browse files
authored
Merge branch 'master' into master
2 parents a1164f4 + bac9d3c commit 75794f1

File tree

7 files changed

+171
-3
lines changed

7 files changed

+171
-3
lines changed

.envrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# auto-update pre-commit versions (if > 1 week)
2+
if which runonce &> /dev/null; then
3+
DIR=`basename $(pwd)`
4+
runonce -b -n $DIR -d 7 pre-commit autoupdate
5+
fi

.github/workflows/bandit.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# Bandit is a security linter designed to find common security issues in Python code.
7+
# This action will run Bandit on your codebase.
8+
# The results of the scan will be found under the Security tab of your repository.
9+
10+
# https://github.com/marketplace/actions/bandit-scan is ISC licensed, by abirismyname
11+
# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA
12+
13+
name: Bandit
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '22 19 * * 3'
22+
23+
jobs:
24+
bandit:
25+
permissions:
26+
contents: read # for actions/checkout to fetch code
27+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
28+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29+
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Bandit Scan
34+
uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c
35+
with: # optional arguments
36+
# exit with 0, even with results found
37+
exit_zero: true # optional, default is DEFAULT
38+
# Github token of the repository (automatically created by Github)
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information.
40+
# File or directory to run bandit on
41+
# path: # optional, default is .
42+
# Report only issues of a given severity level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything)
43+
# level: # optional, default is UNDEFINED
44+
# Report only issues of a given confidence level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything)
45+
# confidence: # optional, default is UNDEFINED
46+
# comma-separated list of paths (glob patterns supported) to exclude from scan (note that these are in addition to the excluded paths provided in the config file) (default: .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg)
47+
# excluded_paths: # optional, default is DEFAULT
48+
# comma-separated list of test IDs to skip
49+
# skips: # optional, default is DEFAULT
50+
# path to a .bandit file that supplies command line arguments
51+
# ini_path: # optional, default is DEFAULT
52+

.github/workflows/pypi-publish.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# see https://github.com/marketplace/actions/publish-python-poetry-package
2+
3+
name: Upload Release to PyPi
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
deploy:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Build and publish to pypi
21+
uses: JRubics/poetry-publish@v1.17
22+
with:
23+
pypi_token: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-package.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Test Multiple Python Versions
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install flake8 pytest
31+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32+
- name: Lint with flake8
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
- name: Test with pytest
39+
run: |
40+
pytest

.github/workflows/python-publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

.pre-commit-config.yaml

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: pyupgrade
1111
args: [--py39-plus]
1212
- repo: https://github.com/psf/black
13-
rev: 23.12.0
13+
rev: 24.3.0
1414
hooks:
1515
- id: black
1616
args: [--config=pyproject.toml]
@@ -26,6 +26,15 @@ repos:
2626
files: "\\.(py)$"
2727
args: [--settings-path=pyproject.toml]
2828
- repo: https://github.com/dosisod/refurb
29-
rev: v1.25.0
29+
rev: v2.0.0
3030
hooks:
3131
- id: refurb
32+
- repo: https://github.com/asottile/pyupgrade
33+
rev: v3.15.2
34+
hooks:
35+
- id: pyupgrade
36+
- repo: https://github.com/charliermarsh/ruff-pre-commit
37+
rev: 'v0.3.4'
38+
hooks:
39+
- id: ruff
40+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Python client interface to the ADT Pulse security system.
99
## UNSUPPORTED
1010

1111
**This is an unsupported interface provided only as a basis for others to explore integrating
12-
their ADT system wtih their own tools.**
12+
their ADT system wtih their own tools.** PLEASE FEEL FREE TO CONTRIBUTE CHANGES! Pull requests are accepted.
1313

1414
While two or three Python clients to ADT Pulse existed, they generally only provided
1515
arm/disarm support and none provided support for ADT Pulse when multiple sites existed

0 commit comments

Comments
 (0)