Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump django version and add linting to CI #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: API Lint
on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'

- name: Pip cache
id: pip-cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: api-lint-${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }}

- name: Install deps
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt

- name: Run linting
run: |
sh ./scripts/lint.sh
2 changes: 1 addition & 1 deletion requirements.in/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
django<4.0
django>=4.0<5.0
msgpack
pynacl
fastapi
Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements.txt requirements.in/base.txt
Expand All @@ -18,7 +18,7 @@ cffi==1.15.1
# via pynacl
click==8.1.3
# via uvicorn
django==3.2.16
django==4.1.13
# via -r requirements.in/base.txt
fastapi==0.88.0
# via -r requirements.in/base.txt
Expand All @@ -38,8 +38,6 @@ pynacl==1.5.0
# via -r requirements.in/base.txt
python-dotenv==0.21.0
# via uvicorn
pytz==2022.6
# via django
pyyaml==6.0.1
# via uvicorn
redis==4.4.0
Expand Down
8 changes: 8 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -ex

mypy .
npx -q [email protected] .
ruff check .
ruff format --check .
Loading