-
Notifications
You must be signed in to change notification settings - Fork 6
Implement external plot-publisher package and Update Dependencies #62
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
Conversation
pyproject.toml
Outdated
| "h2>=4.3.0,<5", | ||
| ] | ||
| # urllib3 handles h2 as an indirect dependency | ||
| dependencies = ["toml>=0.10,<0.11", "urllib3>=2.5,<3"] |
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.
Did urllib3 move forward it's pin for h2 to avoid the security issue?
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.
If the specific issue you are mentioning is CVE-2025-57804 which had an HTTP request smuggling vulnerability due to illegal characters in headers, then this was patched in h2 v4.3.0+. This most current version of urlib3 has moved forward with it's pinned version of h2 to avoid the security issue.
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.
Can you modify the lower-bound on the urllib3 pin to specify that?
Related: I think you can drop toml from the run dependencies since it isn't used by finddata.
$ rg import src/finddata
src/finddata/cli.py
2:import json
3:import logging
4:import os
5:import sys
7:from urllib3 import PoolManager
9:from finddata import __version__
179: import argparse # for command line options
201: import argcomplete # for bash completion
src/finddata/__init__.py
3: from ._version import __version__ # noqa: F401
10: from plot_publisher import plot1d, plot_heatmap, publish_plot # noqa: F401
13: # but module will still import successfully
peterfpeterson
left a comment
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.
Looks good. Thanks for adding the adapter in.
Short description of the changes:
Remove local
publish_plot.pyand replace with conditional imports from the externalplot-publisherpackage to eliminate code duplication while maintaining backward compatibility.Long description of the changes:
This PR refactors finddata's plotting functionality by removing the local duplicate implementation of plotting functions and instead importing them from the external
plot-publisherpackage when available. The changes ensure that:plot-publisherdependency and provide full plotting functionalityKey Changes:
src/finddata/publish_plot.py(340 lines of duplicate code)__init__.pywith conditional imports fromplot_publisherpackagepyproject.toml:plotlydependency (handled by plot-publisher)h2pin (comes through urllib3 as indirect dependency)plot-publisher>=1.0,<2.0to conda runtime dependenciesCheck list for the pull request
Check list for the reviewer
Manual test for the reviewer
pixi run python -c "import finddata; finddata.publish_plot"``bash
pixi run build-conda # Should include plot-publisher dependency
pixi run build-sdist # Includes minimal dependencies
References
EWM # 11592