Skip to content

Guard dxpy imports so dnanexus and swift can actually be optional#143

Open
jtratner wants to merge 7 commits into
masterfrom
guard-dxpy-imports
Open

Guard dxpy imports so dnanexus and swift can actually be optional#143
jtratner wants to merge 7 commits into
masterfrom
guard-dxpy-imports

Conversation

@jtratner

@jtratner jtratner commented Jan 7, 2022

Copy link
Copy Markdown
Contributor

dxpy pulls in a wide array of (often legacy) packages, skipping the import means
we only need to pull it in as necessary which hopefully makes library
more useful to others.

Tests should just continue to pass so shouldn't be a big deal

Showing this works for now:

>>> import stor
>>> stor.Path("/whatever")
PosixPath('/whatever')
>>> stor.Path("dx://whatever")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jtratner/git/stor/stor/base.py", line 47, in __new__
    cls = utils.find_dx_class(path)
  File "/Users/jtratner/git/stor/stor/utils.py", line 272, in find_dx_class
    from stor.dx import DXPath, DXCanonicalPath, DXVirtualPath
  File "/Users/jtratner/git/stor/stor/dx.py", line 9, in <module>
    import dxpy
ModuleNotFoundError: No module named 'dxpy'
>>>

dxpy pulls in a wide array of (often legacy) packages, skipping the import means
we only need to pull it in as necessary which hopefully makes library
more useful to others.
@jtratner jtratner requested a review from srijyothsna January 7, 2022 06:34
@jtratner jtratner changed the title Guard dxpy imports so dnanexus can actually be optional Guard dxpy imports so dnanexus and swift can actually be optional Jan 7, 2022
@jtratner jtratner removed the request for review from srijyothsna April 23, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant