Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package level imports causing failures during pip install #171

Open
dogversioning opened this issue Aug 13, 2024 · 2 comments
Open

package level imports causing failures during pip install #171

dogversioning opened this issue Aug 13, 2024 · 2 comments

Comments

@dogversioning
Copy link
Contributor

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
Copy link
Contributor

mikix commented Aug 20, 2024

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
Copy link
Contributor Author

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.

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

No branches or pull requests

2 participants