Skip to content

chore: project housekeeping, added missing packages, enabled typings …#1140

Open
hinogi wants to merge 9 commits into
roboflow:developfrom
hinogi:chore/housekeeping-missing-deps
Open

chore: project housekeeping, added missing packages, enabled typings …#1140
hinogi wants to merge 9 commits into
roboflow:developfrom
hinogi:chore/housekeeping-missing-deps

Conversation

@hinogi

@hinogi hinogi commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

…for modules with no source

What does this PR do?

  • Added missing modules to the dep lists
  • enabled generation of typing stubs for modules without sourcecode
  • enabled dependency checking

Related Issue(s):

Type of Change

  • Refactoring (no functional changes)

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

@socket-security

socket-security Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​opencv-python@​5.0.0.939810010010070
Addedpypi/​deptry@​0.25.1100100100100100

View full report

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.94937% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 83%. Comparing base (72337cf) to head (ecdd8c7).
⚠️ Report is 2 commits behind head on develop.

❌ 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.
❌ Your project check has failed because the head coverage (83%) is below the target coverage (95%). You can increase the head 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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
@Borda Borda added the enhancement New feature or request label Jun 22, 2026
Comment thread pyproject.toml Outdated
Comment on lines +47 to +51
"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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to list them explicitly? Are there any version changes?

@hinogi hinogi Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I did not pick the version myself I just did uv add

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dependencies list (e.g., Pillow, PyYAML, Rich, OpenCV).
  • Added a dev optional-dependency extra (deptry + pytest).
  • Added a [tool.deptry] configuration section and a [tool.uv] environments setting.

Comment thread pyproject.toml Outdated
Comment on lines +49 to +51
"rich>=15.0.0",
"opencv-python>=4.11.0.86",
"opencv-python-headless>=4.10.0.84",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hinogi ^^

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Borda Any advice on how to move forward?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ 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

hinogi and others added 4 commits June 23, 2026 17:47
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request has conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants