Skip to content

Commit

Permalink
Fix up dependencies, mypy, linting and python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pyepye committed Jul 13, 2023
1 parent 62b37ee commit ae4d7d1
Show file tree
Hide file tree
Showing 6 changed files with 498 additions and 534 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
open-pull-requests-limit: 50
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

- name: Install tox and any other packages
run: pip install tox

- name: Run tox
# Run tox using the version of Python in `PATH`
run: tox -e python
6 changes: 3 additions & 3 deletions magiclink/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class AntiSpam(forms.Form):
)

def clean_url(self) -> str:
url = self.cleaned_data.get('url')
url: str = self.cleaned_data.get('url', '')
if url:
raise ValidationError('url should be empty')
return url

def clean_load_time(self) -> float:
load_time = self.cleaned_data.get('load_time')
cleaned_load_time: str = self.cleaned_data.get('load_time', '')
try:
load_time = float(load_time)
load_time = float(cleaned_load_time)
except ValueError:
raise ValidationError('Invalid value')

Expand Down
2 changes: 1 addition & 1 deletion magiclink/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
try:
from django.utils.http import url_has_allowed_host_and_scheme as safe_url
except ImportError: # pragma: no cover
from django.utils.http import is_safe_url as safe_url
from django.utils.http import is_safe_url as safe_url # type: ignore

from django.views.decorators.csrf import csrf_protect

Expand Down
Loading

0 comments on commit ae4d7d1

Please sign in to comment.