chore: project housekeeping, added missing packages, enabled typings …#1140
chore: project housekeeping, added missing packages, enabled typings …#1140hinogi wants to merge 9 commits into
Conversation
…for modules with no source
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (76%) is below the target coverage (95%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #1140 +/- ##
=======================================
Coverage 82% 83%
=======================================
Files 111 111
Lines 11972 12011 +39
=======================================
+ Hits 9856 9914 +58
+ Misses 2116 2097 -19 🚀 New features to boost your workflow:
|
| "pillow>=12.2.0", | ||
| "pyyaml>=6.0.3", | ||
| "rich>=15.0.0", | ||
| "opencv-python>=4.11.0.86", | ||
| "opencv-python-headless>=4.10.0.84", |
There was a problem hiding this comment.
Why do you need to list them explicitly? Are there any version changes?
There was a problem hiding this comment.
if you remove
"opencv-python>=4.11.0.86",
"opencv-python-headless>=4.10.0.84",
you get this for example
❯ uv run pytest .\tests\evaluation\test_coco_eval.py
ImportError while loading conftest 'C:\Users\Stefan\code\rf-detr-workin\tests\conftest.py'.
tests\conftest.py:12: in <module>
from rfdetr.datasets.synthetic import DatasetSplitRatios, generate_coco_dataset
src\rfdetr\datasets\synthetic.py:20: in <module>
from supervision import Color, Detections, box_iou_batch, draw_filled_polygon
.venv\Lib\site-packages\supervision\__init__.py:9: in <module>
from supervision.annotators.core import (
.venv\Lib\site-packages\supervision\annotators\core.py:40: in <module>
from supervision.draw.utils import draw_polygon, draw_rounded_rectangle, draw_text
.venv\Lib\site-packages\supervision\draw\utils.py:226: in <module>
text_font: int = cv2.FONT_HERSHEY_SIMPLEX,
^^^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: module 'cv2' has no attribute 'FONT_HERSHEY_SIMPLEX'
There was a problem hiding this comment.
My MO was to check all import and try to find them in the pyproject.toml and if they do not exist add them to make the tooling happy.
I don't know if it is dependent on the arch or the IDE if such things come up but there seem to be a lot of caveats that I triggered.
There was a problem hiding this comment.
Also I did not pick the version myself I just did uv add
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s packaging and tooling configuration in pyproject.toml to support dependency hygiene (deptry), add “missing” runtime dependencies, and introduce a dev extra.
Changes:
- Added several packages to the core
dependencieslist (e.g., Pillow, PyYAML, Rich, OpenCV). - Added a
devoptional-dependency extra (deptry + pytest). - Added a
[tool.deptry]configuration section and a[tool.uv]environmentssetting.
| "rich>=15.0.0", | ||
| "opencv-python>=4.11.0.86", | ||
| "opencv-python-headless>=4.10.0.84", |
There was a problem hiding this comment.
I do not know what is the best approach for what are actual dependencies that are necessary at runtime or development or just testing so I moved/added this to testing since that obviously does not work without them, but also maybe @Borda you can put those in the correct group or tell me how to find out where they should go since I also did only did execute a single test and got all that errors already.
if opencv is missing in test
ImportError while loading conftest 'C:\Users\Stefan\code\rf-detr-workin\tests\conftest.py'.
tests\conftest.py:12: in <module>
from rfdetr.datasets.synthetic import DatasetSplitRatios, generate_coco_dataset
src\rfdetr\datasets\synthetic.py:20: in <module>
from supervision import Color, Detections, box_iou_batch, draw_filled_polygon
.venv\Lib\site-packages\supervision\__init__.py:9: in <module>
from supervision.annotators.core import (
.venv\Lib\site-packages\supervision\annotators\core.py:40: in <module>
from supervision.draw.utils import draw_polygon, draw_rounded_rectangle, draw_text
.venv\Lib\site-packages\supervision\draw\utils.py:226: in <module>
text_font: int = cv2.FONT_HERSHEY_SIMPLEX,
^^^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: module 'cv2' has no attribute 'FONT_HERSHEY_SIMPLEX'
when faster_coco_eval is missing in test
__________________________________________ ERROR collecting tests/evaluation/test_coco_eval.py ______________________________________________
tests\evaluation\test_coco_eval.py:16: in <module>
from faster_coco_eval import COCO
E ModuleNotFoundError: No module named 'faster_coco_eval'
______________________________________________ ERROR collecting tests/evaluation/test_coco_eval.py ______________________________________________
ImportError while importing test module 'C:\Users\Stefan\code\rf-detr-workin\tests\evaluation\test_coco_eval.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\AppData\Roaming\uv\python\cpython-3.12.10-windows-x86_64-none\Lib\importlib\__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests\evaluation\test_coco_eval.py:16: in <module>
from faster_coco_eval import COCO
E ModuleNotFoundError: No module named 'faster_coco_eval'
if pycocotools is missing in test
______________________________________________ ERROR collecting tests/evaluation/test_coco_eval.py ______________________________________________
tests\evaluation\test_coco_eval.py:13: in <module>
import pycocotools.coco as pycoco
E ModuleNotFoundError: No module named 'pycocotools'
______________________________________________ ERROR collecting tests/evaluation/test_coco_eval.py ______________________________________________
ImportError while importing test module 'C:\Users\Stefan\code\rf-detr-workin\tests\evaluation\test_coco_eval.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\AppData\Roaming\uv\python\cpython-3.12.10-windows-x86_64-none\Lib\importlib\__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests\evaluation\test_coco_eval.py:13: in <module>
import pycocotools.coco as pycoco
E ModuleNotFoundError: No module named 'pycocotools'
There was a problem hiding this comment.
@Borda Any advice on how to move forward?
There was a problem hiding this comment.
❯ Get-ChildItem "C:\Users\Stefan\code\rf-detr-workin\.venv\Lib\site-packages\cv2"
Directory: C:\Users\Stefan\code\rf-detr-workin\.venv\Lib\site-packages\cv2
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 19.06.2026 12:25 27954688 opencv_videoio_ffmpeg4110_64.dll
guess I found another reason, corrupt package installation
- Fixed prediction, export, deploy, and benchmarking behavior, including safer URL loading, correct return typing, optimized-model guards, second-training warnings, dynamic input/query handling, and clamped benchmark top-k. - Fixed dataset loading and augmentation edge cases, including bounded large-image handling, seeded DataLoader workers, configurable Albumentations strictness, corrected non-square resize-crop jitter, GaussianBlur sigma passthrough, and asymmetric blur-range warnings. - Fixed training and model stability issues, including graph-connected zero mask losses for empty matches, preserved process RNG during training, corrected MultiScaleProjector survival-drop behavior, and removal of obsolete torchvision compatibility logic. - Fixed box IoU/GIoU NaNs for degenerate boxes while preserving exact IoU for normal boxes. - Improved mask postprocessing memory usage by chunking interpolation and storing thresholded boolean masks. - Updated documentation for export, migration, training, installation extras, benchmarks, references, and LLM metadata to match shipped behavior. - Fixed tests and smoke coverage for checkpoint errors, optimized-model state, mask memory handling, box degeneracy, worker seeding, CLI execution, and updated resize-crop behavior. --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
…ork consider --reinstall of the package not working
…for modules with no source
What does this PR do?
Related Issue(s):
Type of Change
Testing
Test details:
Checklist
Additional Context