Skip to content

Commit

Permalink
Delete unnecessary extra requirements (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtopper authored Jan 7, 2024
1 parent 48b8519 commit f529961
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 33 deletions.
17 changes: 8 additions & 9 deletions integration/test_azure_filesystem_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,15 @@ def test_csv_reader_from_azure(azure_create_csv):

@pytest.mark.skipif(not has_azure_credentials, reason="No azure credentials found")
def test_csv_reader_from_azure_error_on_file_not_found():
controller = build_flow(
[
CSVSource(
f'az:///{os.getenv("AZURE_BLOB_STORE")}/idontexist.csv',
storage_options=storage_options,
),
]
).run()

with pytest.raises(FileNotFoundError):
controller = build_flow(
[
CSVSource(
f'az:///{os.getenv("AZURE_BLOB_STORE")}/idontexist.csv',
storage_options=storage_options,
),
]
).run()
controller.await_termination()


Expand Down
11 changes: 5 additions & 6 deletions integration/test_s3_filesystem_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,12 @@ def test_csv_reader_from_s3(s3_create_csv):

@pytest.mark.skipif(not has_s3_credentials, reason="No s3 credentials found")
def test_csv_reader_from_s3_error_on_file_not_found():
controller = build_flow(
[
CSVSource(f's3://{os.getenv("AWS_BUCKET")}/idontexist.csv'),
]
).run()

with pytest.raises(FileNotFoundError):
controller = build_flow(
[
CSVSource(f's3://{os.getenv("AWS_BUCKET")}/idontexist.csv'),
]
).run()
controller.await_termination()


Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ def load_deps(file_name):
install_requires = load_deps("requirements.txt")
tests_require = load_deps("dev-requirements.txt")
extras_require = {
"s3": ["s3fs~=0.5"],
"az": ["adlfs~=0.5"],
"kafka": ["kafka-python~=2.0"],
"redis": ["redis~=4.3"],
"lupa": ["lupa~=1.13"],
"sqlalchemy": ["sqlalchemy~=1.3"],
}

Expand Down
15 changes: 0 additions & 15 deletions storey/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,13 @@ def url_to_file_system(url, storage_options):
scheme = parsed_url.password
else:
raise ValueError("Datastore profile URL is expected to have underlying scheme embedded as password")
if scheme:
load_fs_dependencies(scheme)

if storage_options:
return fsspec.filesystem(scheme, **storage_options), remaining_path
else:
return fsspec.filesystem(scheme), remaining_path


def load_fs_dependencies(schema):
if schema == "s3":
try:
import s3fs # noqa: F401
except ImportError:
raise StoreyMissingDependencyError("s3 packages are missing, use pip install storey[s3]")
if schema == "az":
try:
import adlfs # noqa: F401
except ImportError:
raise StoreyMissingDependencyError("azure packages are missing, use pip install storey[az]")


class StoreyMissingDependencyError(Exception):
pass

Expand Down

0 comments on commit f529961

Please sign in to comment.