Skip to content

Commit

Permalink
Merge pull request #1637 from praw-dev/actions_python_version
Browse files Browse the repository at this point in the history
Actually use the python version matrix
  • Loading branch information
bboe authored Feb 3, 2021
2 parents 95f406c + bb0e006 commit 42f4b6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 49 deletions.
43 changes: 1 addition & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,47 +49,6 @@ jobs:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]

lint-multi-python:
name: Lint Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.x
- uses: actions/cache@v1
with:
key: v0-${{ runner.os }}-pip-lint-${{ hashFiles('setup.py') }}
path: ~/.cache/pip
restore-keys: |
v0-${{ runner.os }}-pip-lint-
v0-${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
- name: Check other phrase usages
run: python ./tools/static_word_checks.py
- name: Check documentation
run: python ./tools/check_documentation.py
- name: Check docstrings
run: python ./tools/check_docstring.py
- name: Run black
run: black --check --verbose .
- name: Run flake8
run: flake8 --exclude docs --statistics
- name: Run flynt
run: flynt -vdf -tc -ll 1000 .
- name: Run isort
run: isort -cv .
- name: Run pydocstyle
run: pydocstyle praw
- name: Run sphinx
run: sphinx-build --keep-going docs/ /tmp/foo
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

test-multi-os:
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -122,7 +81,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.x
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
with:
key: v0-${{ runner.os }}-pip-test-${{ hashFiles('setup.py') }}
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
default_language_version:
python: python3.7
fail_fast: true
repos:
- hooks:
- id: black
repo: https://github.com/ambv/black
rev: stable
- hooks:
- id: black
language_version: python3
repo: https://github.com/psf/black
rev: stable
2 changes: 1 addition & 1 deletion praw/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def request(self, *args, **kwargs):
def _check_for_async(self):
if self.config.check_for_async:
in_async = False
if sys.version_info >= (3, 7, 0):
if sys.version_info >= (3, 7, 0): # pragma: no cover
try:
asyncio.get_running_loop()
in_async = True
Expand Down

0 comments on commit 42f4b6c

Please sign in to comment.