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

Hyphen & underscore insensitive package resolution #210

Open
dlqqq opened this issue Dec 26, 2023 · 1 comment
Open

Hyphen & underscore insensitive package resolution #210

dlqqq opened this issue Dec 26, 2023 · 1 comment

Comments

@dlqqq
Copy link

dlqqq commented Dec 26, 2023

This is an awesome tool! I have a small feature suggestion.

I was using hyphens instead of underscores in my package name, which kept giving me "package not found" errors. I almost gave up on this tool before noticing that the root_package field needs to exactly match the package name.

pip is insensitive to whether hyphens or underscores are used. It would be awesome if import-linter did the same.

@seddonym
Copy link
Owner

seddonym commented Dec 28, 2023

Thanks for the issue! I think you're right that the documentation is potentially confusing. When the docs say this should contain 'the name of the Python package to validate', it's unclear whether it should be the pip-installable name on pypi (e.g. import-linter) or the name of the importable package (e.g. importlinter). In fact, it's the second, and has nothing to do with pip.

For that reason I don't think we should change the behaviour (if we were analyzing Import Linter itself, neither import-linter nor import_linter would work). Instead we should just clarify what we mean by package name.

Do you think if the docs clarified this in this section that would have helped you?

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