Skip to content

Commit ad18d62

Browse files
committed
restric dependency import error only to DBC
1 parent cdbdc21 commit ad18d62

3 files changed

Lines changed: 16 additions & 21 deletions

File tree

poetry.lock

Lines changed: 9 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ python-magic = "^0.4.27"
3636
chardet = "^7.4.0.post2"
3737
anyio = "^4.13.0"
3838
humanize = "^4.8.0"
39+
aioftp = "^0.21.4"
40+
dbfread = "2.0.7"
41+
bigtree = "^0.12.2"
3942

40-
dbfread = { version = "2.0.7", optional = true }
4143
pyreaddbc = { version = ">=1.1.0", optional = true }
4244
pycparser = { version = "2.21", optional = true }
43-
bigtree = { version = "^0.12.2", optional = true }
44-
aioftp = { version = "^0.21.4", optional = true }
4545

4646
[tool.poetry.extras]
47-
ftp = ["dbfread", "pyreaddbc", "pycparser", "bigtree", "aioftp"]
47+
dbc = ["pyreaddbc", "pycparser"]
4848

4949
[tool.poetry.group.dev.dependencies]
5050
pytest = ">=6.1.0"

pysus/api/extensions.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,10 +606,8 @@ def _extract():
606606

607607
class FTPNotImported(BaseTabularFile):
608608
type: FileType = Field(None)
609-
import_err: ClassVar[
610-
str
611-
] = """
612-
run "pip install pysus[ftp]" to handle DBC or DBF files
609+
import_err: ClassVar[str] = """
610+
run "pip install pysus[dbc]" to handle DBC files
613611
"""
614612

615613
@property
@@ -648,7 +646,7 @@ class ExtensionFactory:
648646
".tar.gz": Tar,
649647
".csv": CSV,
650648
".parquet": Parquet,
651-
".dbf": DBF if FTP_IMPORT else FTPNotImported,
649+
".dbf": DBF,
652650
".dbc": DBC if FTP_IMPORT else FTPNotImported,
653651
".pdf": PDF,
654652
".json": JSON,

0 commit comments

Comments
 (0)