Skip to content

Commit

Permalink
fix dependency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fpgmaas authored and rlouf committed Jun 15, 2024
1 parent 320af22 commit 502bfdd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
8 changes: 1 addition & 7 deletions outlines/types/airports.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
"""Generate valid airport codes."""
from enum import Enum

try:
from pyairports.airports import AIRPORT_LIST
except ImportError:
raise ImportError(
'The `airports` module requires "pyairports" to be installed. You can install it with "pip install pyairports"'
)

from pyairports.airports import AIRPORT_LIST

AIRPORT_IATA_LIST = list(
{(airport[3], airport[3]) for airport in AIRPORT_LIST if airport[3] != ""}
Expand Down
7 changes: 1 addition & 6 deletions outlines/types/countries.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
"""Generate valid country codes and names."""
from enum import Enum

try:
import pycountry
except ImportError:
raise ImportError(
'The `countries` module requires "pycountry" to be installed. You can install it with "pip install pycountry"'
)
import pycountry

ALPHA_2_CODE = [(country.alpha_2, country.alpha_2) for country in pycountry.countries]
Alpha2 = Enum("Alpha_2", ALPHA_2_CODE) # type:ignore
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies = [
"requests",
"tqdm",
"datasets",
"typing_extensions",
"pycountry",
"pyairports",
]
Expand Down Expand Up @@ -64,7 +65,6 @@ test = [
]
serve = [
"vllm>=0.3.0",
"ray==2.9.0",
"uvicorn",
"fastapi",
"pydantic>=2.0",
Expand Down

0 comments on commit 502bfdd

Please sign in to comment.