Unify the way the imports work #9

Merged
alexander merged 21 commits from unify-imports into develop 2026-11-30 20:30:54 +01:00
3 changed files with 5 additions and 4 deletions
Showing only changes of commit 07660ecff9 - Show all commits

Import geopy.distance as geo_distance everywhere

Alexander Hess 2026-11-30 19:55:34 +01:00
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -545,6 +545,7 @@ banned-from = [
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"collections.abc" = "cabc"
"geopy.distance" = "geo_distance"
"googlemaps" = "gm"
"sqlalchemy" = "sa"
"sqlalchemy.dialects.postgresql" = "psql"

View file

@ -5,7 +5,7 @@ import random
import factory
from factory import alchemy
from geopy import distance
from geopy import distance as geo_distance
from tests import config as test_config
from tests.db.fake_data.factories import utils
@ -204,7 +204,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
# Statistical attributes -> calculate realistic stats
logged_delivery_distance = factory.LazyAttribute(
lambda obj: (
distance.great_circle(
geo_distance.great_circle(
(obj.pickup_address.latitude, obj.pickup_address.longitude),
(obj.delivery_address.latitude, obj.delivery_address.longitude),
).meters

View file

@ -5,7 +5,7 @@ import json
import googlemaps as gm
import pytest
import sqlalchemy as sa
from geopy import distance
from geopy import distance as geo_distance
from sqlalchemy import exc as sa_exc
from velofy import db
@ -21,7 +21,7 @@ def another_address(make_address):
@pytest.fixture
def path(address, another_address, make_address):
"""A `Path` from `address` to `another_address`."""
air_distance = distance.great_circle(
air_distance = geo_distance.great_circle(
address.location.lat_lng,
another_address.location.lat_lng,
).meters