Skip to content

Commit

Permalink
Merge pull request #14 from themoosman/fix-python-package-build
Browse files Browse the repository at this point in the history
Update python versions to supported versions
  • Loading branch information
avryhof committed Jun 20, 2024
2 parents a5cd478 + 00fa881 commit 6411904
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
[bandit]
exclude = test.py
14 changes: 7 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -29,8 +28,9 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Scan with Bandit
run: |
pip install bandit
bandit -r .
- name: Test with pytest
run: |
pip install pytest
pytest
pytest test.py
10 changes: 10 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@

weather = AmbientAPI(log_level='CONSOLE')


def test_endpoint():
assert weather.endpoint == 'https://rt.ambientweather.net/v1'


devices = weather.get_devices()


def test_devices():
assert len(devices) == 0


for device in devices:
# Wait two seconds between requests so we don't get a 429 response.
# https://ambientweather.docs.apiary.io/#introduction/rate-limiting
Expand Down

0 comments on commit 6411904

Please sign in to comment.