smart-on-fhir / client-py

Python SMART on FHIR client
http://docs.smarthealthit.org
Other
574 stars 209 forks source link

package level imports causing failures during pip install #171

Open dogversioning opened 1 month ago

dogversioning commented 1 month ago

As noted on #169 - an import like from fhirclient.models.bundle import Bundle is causing pip install .[tests] to throw a ModuleNotFound error. We should resolve this issue, and then optionally adjust relative module level imports to be package level imports.

mikix commented 3 weeks ago

and then optionally adjust relative module level imports to be package level imports

I actually have a soft spot for relative imports. And fhir-parser generates them for a good reason (it doesn't know the final package names you'll put the code into). But we could certainly tweak fhir-parser to take a config option for that. Or do a post-process ourselves.

But generally, I like relative imports inside a library. Makes everything more portable (in the moving files around sense) and more robust against odd PYTHONPATH situations. But I don't like it so much I'll fight for it.

dogversioning commented 3 weeks ago

I think I like package level imports as a form of documentation? but i also don't feel strongly, and the 'this goes into an unknown external package' is a pretty good case against.