-
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
Correctly detect transitive dependencies with different module names #1033
Conversation
…ongl Added another check method to verify whether a package exists in the environment, if can't be found by _get_package_name_from_metadata. Also updated the test cases to include bs4 for testing in test_cli_requirement_in.
…ments.in I revised module.py as per the change requests and added beautifulsoup4==4.12.3 to requirements.in. With this change, the test_cli_single_requirements_files test now passes without any DEP003 issues related to bs4. Additionally, since soupsieve is added to requirements.txt during the uvx --from pip-tools pip-compile process as a dependency of bs4, this causes a DEP002 issue in test_cli_multiple_requirements_files. Therefore, I also revised these two parts of the test case.
…equest Add a unit test to test the new function _is_package_installed in module.py, also revise the test case in project_requirements_in to verify the use of the new function.
--index-url https://pypi.nuwainfo.com/nuwa/dev/+simple/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--index-url https://pypi.nuwainfo.com/nuwa/dev/+simple/ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1033 +/- ##
=====================================
Coverage 93.0% 93.1%
=====================================
Files 37 37
Lines 994 1000 +6
Branches 99 99
=====================================
+ Hits 925 931 +6
Misses 55 55
Partials 14 14 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Could you merge main
into your branch, as we require branches to be up-to-date before merging (or allowing changes from maintainers so that I can do it, alternatively)?
81f872c
to
ee36e32
Compare
Co-authored-by: Mathieu Kniewallner <[email protected]>
Done, so sorry I missed that part |
Branch is again outdated. Can you please enable edit from maintainers so that we avoid both losing more time on this? |
Since there's no edit from maintainers button (I guess that's because the fork is on a team repository, but I don't have the authority to manage access authority), hence I fork a same repository on my own account and I already add you into it. Hope this works, so sorry for the inconvenience and really thank you for your help. |
Hi again, I just added you into the https://github.com/nuwainfo/deptry/tree/nuwainfo/main (the original fork) so you can edit on both the repository(the nuwainfo or the one on my account). And sorry again for the inconvenience, I am really not good at using GitHub, and I truly appreciate your patience. |
Ha, did not know about this limitation! If you merge |
I added another check method to verify whether a package exists in the environment, if can't be found by _get_package_name_from_metadata. Also updated the test cases to include bs4 for testing in test_cli_requirement_in.
PR Checklist
docs
is updatedDescription of changes
Hello, I made a small change to fix the issue where some packages might not have the same name when import, which caused them to be incorrectly reported as missing instead of transitive, as described in in #827.
To ensure the correct package name is retrieved in module.py, I added an additional approach to check if the package is in the development environment:
`
`
This ensures that the package name can always be retrieved if it is in the environment, regardless of whether the package name and import name match. I also updated the test in test_module so that the package name for bs4 can now be detected.
I'm not sure if this adheres to your program framework or design logic, but I hope it helps. Thanks!
Description of changes