Skip to content

Commit

Permalink
Merge pull request #313 from jamesvandyne/upgrade-deps
Browse files Browse the repository at this point in the history
Version bumps and reformatting
  • Loading branch information
jamesvandyne authored Oct 27, 2024
2 parents 8032175 + 0666935 commit 8ba4150
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
3 changes: 1 addition & 2 deletions apps/application/entry/_post_to_bridgy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from data.post import models as post_models


class AlreadySentWebmention(Exception):
...
class AlreadySentWebmention(Exception): ...


def post_to_mastodon(t_entry: entry_models.TEntry, entry_absolute_url: str):
Expand Down
3 changes: 1 addition & 2 deletions apps/domain/files/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from domain.images import images as image_ops


class UnprocessableFile(Exception):
...
class UnprocessableFile(Exception): ...


def get_file(
Expand Down
1 change: 1 addition & 0 deletions apps/domain/gis/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Mercator calculations used to fix the projection from geo-coordinate to x,y (flat) coordinates.
Adapted from: https://wiki.openstreetmap.org/wiki/Mercator
"""

import math

EARTH_RADIUS_KM = 6378137.0
Expand Down
5 changes: 2 additions & 3 deletions apps/domain/wordpress/extract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime
from datetime import datetime, timezone

import phpserialize
import pytz
from bs4 import BeautifulSoup
from django.contrib.gis.geos import Point
from django.utils.timezone import make_aware
Expand All @@ -27,7 +26,7 @@ def extract_post_status(soup: BeautifulSoup) -> str:
def extract_published_date(soup: BeautifulSoup) -> datetime | None:
try:
pub_date = datetime.strptime(soup.find("post_date_gmt").text, "%Y-%m-%d %H:%M:%S")
return make_aware(pub_date, pytz.utc)
return make_aware(pub_date, timezone.utc)
except ValueError:
# draft posts
return None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
API Views for interacting with Strava
"""

import logging
from urllib import parse as url_parse

Expand Down
10 changes: 5 additions & 5 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
arrow==1.2.3
asgiref==3.7.2
Django==4.2.7
pytz==2022.7
Django==4.2.16
sqlparse==0.4.1
django-webmention==3.0.0
django-taggit==5.0.1
djangorestframework==3.14.0
djangorestframework==3.15.2
beautifulsoup4==4.11.1
exif==1.4.2
Pillow==10.0.1
Expand All @@ -15,7 +14,7 @@ django-picklefield==3.1
ftfy==6.1.1
ronkyuu==0.9
ninka==0.3.4
extruct==0.14.0
extruct==0.17.0
django-turbo-response==0.0.48
phpserialize==1.3
django-debug-toolbar==3.2.1
Expand All @@ -25,11 +24,12 @@ types-requests==2.28.11.7
typing-extensions==4.4.0
mypy-extensions==0.4.3
mkdocs==1.2.2
isort==5.11.2
isort==5.13.2
django-meta==2.1.0
factory_boy==3.2.1
envparse==0.2.0
django-htmx==1.13.0
polyline==1.4.0
cairosvg==2.5.2
PyMuPDF==1.22.2
pytest<8
5 changes: 2 additions & 3 deletions tests/test_wordpress/test_extract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime
from datetime import datetime, timezone

import pytest
import pytz
from bs4 import BeautifulSoup
from django.contrib.gis.geos import Point

Expand Down Expand Up @@ -91,7 +90,7 @@ def target(self):
return extract_published_date

def test_extract_published_date(self, target, post_xml_soup):
assert datetime(year=2020, month=9, day=14, hour=20, minute=30, second=23, tzinfo=pytz.utc) == target(
assert datetime(year=2020, month=9, day=14, hour=20, minute=30, second=23, tzinfo=timezone.utc) == target(
post_xml_soup
)

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ commands =
mypy --config-file=tox.ini apps

[testenv:lint]
profile = black
deps =
{[testenv]deps}
commands =
Expand All @@ -56,7 +57,7 @@ commands =
exclude = migrations,urls.py,manage.py,settings.py,admin.py,.tox,venv
max-line-length = 120
max-complexity = 10
ignore = E203,W503,W504,I001
ignore = E203,W503,W504,I001,E203,E701
enable-extensions=G
per-file-ignores =
*/__init__.py: F401
Expand Down

0 comments on commit 8ba4150

Please sign in to comment.