Skip to content

Commit

Permalink
fixing for 3.12 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Jun 20, 2024
1 parent e2e346a commit 2619568
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions aiscot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@
import logging
import os

_DEFAULT_MID_DB_FILE = (
"data/MaritimeIdentificationDigits-bb62983a-cf0e-40a1-9431-cd54eaeb1c85.csv"
)
_DEFAULT_SHIP_DB_FILE = "data/yadd_mmsi_ship_2023-02-11-001541.txt"

try:
from pkg_resources import resource_filename as find
from pkg_resources import resource_filename

DEFAULT_MID_DB_FILE = resource_filename(__name__, _DEFAULT_MID_DB_FILE)
DEFAULT_SHIP_DB_FILE = resource_filename(__name__, _DEFAULT_SHIP_DB_FILE)
except ImportError:
from importlib.resources import files as find
from importlib.resources import files

DEFAULT_MID_DB_FILE = files("aiscot.data").joinpath(_DEFAULT_MID_DB_FILE).name
DEFAULT_SHIP_DB_FILE = files("aiscot.data").joinpath(_DEFAULT_SHIP_DB_FILE).name


if bool(os.environ.get("DEBUG")):
Expand All @@ -50,9 +61,5 @@

DEFAULT_POLL_INTERVAL: int = 61

DEFAULT_MID_DB_FILE = find(
__name__,
"data/MaritimeIdentificationDigits-bb62983a-cf0e-40a1-9431-cd54eaeb1c85.csv",
)

DEFAULT_SHIP_DB_FILE = find(__name__, "data/yadd_mmsi_ship_2023-02-11-001541.txt")

0 comments on commit 2619568

Please sign in to comment.