-
Notifications
You must be signed in to change notification settings - Fork 23
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
A way to pre-configure a map of package names to module names #333
Conversation
Codecov Report
@@ Coverage Diff @@
## main #333 +/- ##
=======================================
- Coverage 91.8% 91.1% -0.8%
=======================================
Files 29 29
Lines 955 991 +36
Branches 201 212 +11
=======================================
+ Hits 877 903 +26
- Misses 50 56 +6
- Partials 28 32 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks for opening the PR! I think the added functionality looks good. I was not able yet to test is locally successfully. Do you have a good example package that can be used for testing? I recall encountering this issue in the past, but I do not recall with which package. For now, I tried cheating a bit and just switching [tool.deptry.package_module_name_map]
click = [
"tomli",
]
tomli = [
"click",
] But because we also still look for metadata, this results in:
so my hacky local test that does not really work :) If you would be so kind to add unit tests and documentation, I would be happy to review and merge! |
Good examples are packages that have a prefix |
I think it's OK to look for metedata for other uses. As far as I can see the only use case is the 'publicly' available property |
A small formatting issue in the CI/CD, otherwise; looks good to me! I really appreciate you taking the time to add this feature! |
There you go! Pre-commit found some more stuff. |
PR Checklist
docs
is updatedDescription of changes
Adding a pre-configured map between package names and module names, so not installed modules don't produce errors when a package name doesn't auto-convert to the module name. E.g. package name
foo-python
is translated to modulefoo_python
, but it's actually calledfoo
.Fixes #332
Before adding tests & docs, let's see if this is an acceptable problem & solution direction.