Skip to content

Commit

Permalink
try github workflows again since travis-ci costs money now...
Browse files Browse the repository at this point in the history
  • Loading branch information
SharpBit committed Oct 7, 2024
1 parent 3a7ba8f commit cb011af
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 10 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "master", "development" ]
pull_request:
branches: [ "master", "development" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test with pytest
env:
TOKEN: ${{ secrets.TOKEN }}
BASE_URL: ${{ secrets.BASE_URL }}
run: |
pytest
4 changes: 2 additions & 2 deletions tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class TestAsyncClient(unittest.IsolatedAsyncioTestCase):
async def asyncSetUp(self):
session = aiohttp.ClientSession(trust_env=True)
self.client = brawlstats.Client(
token=os.getenv('token'),
token=os.getenv('TOKEN'),
session=session,
base_url=os.getenv('base_url'),
base_url=os.getenv('BASE_URL'),
is_async=True
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class TestBlockingClient(unittest.TestCase):

def setUp(self):
self.client = brawlstats.Client(
token=os.getenv('token'),
base_url=os.getenv('base_url')
token=os.getenv('TOKEN'),
base_url=os.getenv('BASE_URL')
)

def tearDown(self):
Expand Down
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ ignore = E252,E302,E731,W605
[tox]
envlist = py39, py310, py311, py312

[pytest]
filterwarnings =
ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning

[testenv]
deps = -Ur{toxinidir}/requirements-dev.txt
commands =
flake8 .
pytest
passenv =
token
base_url
TOKEN
BASE_URL

0 comments on commit cb011af

Please sign in to comment.