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

[Revise] pyproject.toml contains obsolete dependencies #1161

Closed
fpgmaas opened this issue Sep 5, 2022 · 6 comments · Fixed by #1162
Closed

[Revise] pyproject.toml contains obsolete dependencies #1161

fpgmaas opened this issue Sep 5, 2022 · 6 comments · Fixed by #1162
Assignees
Labels
enhancement New feature or request

Comments

@fpgmaas
Copy link

fpgmaas commented Sep 5, 2022

Summary of request

Not all dependencies listed in pyproject.toml are still actively used. I used deptry to scan the repository, and it returned the following output:

Output:

Warning: Failed to find corresponding package name for import `mpl_toolkits` in current environment.
pyproject.toml contains obsolete dependencies: ['better-exceptions', 'descartes', 'funcparserlib', 'mapclassify', 'scikit-learn', 'tabulate']

scikit-learn is incorrectly marked, which I have added as a bug report to the deptry project. The others indeed seem to be no longer actively required.

@fpgmaas fpgmaas added the enhancement New feature or request label Sep 5, 2022
@fpgmaas
Copy link
Author

fpgmaas commented Sep 5, 2022

better-exceptions was also marked as obsolete erroneously, since deptry does not support try-catch blocks yet, and it's only imported within a try-catch block. Added as a bug report to deptry as well.

@lisphilar lisphilar added this to the Release v2.27.0 milestone Sep 5, 2022
@lisphilar
Copy link
Owner

Thank you for your contribution to this project!!
Could you add deptry to "[tool.poetry.dev-dependencies]"?
(With #1144, I plan to rename it to "[tool.poetry.group.dev.dependencies]" per poetry version 1.2.0.)

Additionally, could you add the followings to pyproject.toml?

[tool.deptry]
ignore_dependencies = [
'tabulate'
]

Yes, scikit-learn and better-exceptions are used in our project actively and I will follow the discussion in your repository.

tabulate:
Please continue to include this because some covsirphy users need pandas.DataFrame.to_markdown functionarity which requires explicit tabulate installation.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_markdown.html

Discussion of pip install pandas["table"] is still ongoing.
pandas-dev/pandas#39164

descartes:
Yes, we can remove it as your pull request. It was necessary for geopandas version 0.8.2, but is un-necessary now because we use geopandas >= 0.9 and geopandas vendors it.
geopandas/geopandas#1039

mapclassify:
Removal is acceptable because tests passed, but I could not clarify the reason under the following instruction.
Geopandas needs explicit installation of this package for chropleth map functionality (of covsirphy), but explicit importing of it is un-necessary.
https://geopandas.org/en/latest/getting_started/install.html#dependencies

funcparserlib:
Removal is acceptable! This was introduced to fix version control of some other removed dependencies, but unnecessary now.

@lisphilar lisphilar changed the title pyproject.toml contains obsolete dependencies. [Revise] pyproject.toml contains obsolete dependencies. Sep 5, 2022
@lisphilar lisphilar changed the title [Revise] pyproject.toml contains obsolete dependencies. [Revise] pyproject.toml contains obsolete dependencies Sep 5, 2022
@fpgmaas
Copy link
Author

fpgmaas commented Sep 5, 2022

Thanks for your extensive feedback, and thanks for considering to add deptry as a development dependency!

I have processed your proposed changes, and I have added the deptry configuration to pyproject.toml. In addition, I have added scikit-learn to the list of dependencies to ignore, since I have no solution for that problem yet, so this is now the advised workaround.

The parsing of try/except blocks is now added in deptry 0.2.1, so it no longer erroneously marks better-exceptions as a obsolete dependency.

@lisphilar lisphilar linked a pull request Sep 5, 2022 that will close this issue
@lisphilar lisphilar reopened this Sep 5, 2022
@lisphilar
Copy link
Owner

Thank you for updating and I merged your pull request. This will be included in the next stable release.

I ran deptry . and I got the following message.

Warning: Failed to find corresponding package name for import `mpl_toolkits` in current environment.
Succes! No obsolete dependencies found.

I created a issue for the warning fpgmaas/deptry#34
"Succes" could be changed with "Success"?

@lisphilar
Copy link
Owner

With #1163, this was included in the test workflow.

lisphilar added a commit that referenced this issue Sep 6, 2022
config: #1161. use deptry 0.2.3 to remove warning
@lisphilar
Copy link
Owner

With fpgmaas/deptry#34, the warning was removed at deptry version 0.2.3. We will use version 0.2.3 with #1170.

@fpgmaas ,
Thank you a lot for your support!! :)
We can close this issue and I will contiue to follow the releases of your package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants