Skip to content

Drop Python 3.9 support and fix Python 3.12 compatibility#1890

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/fix-build-issues-drop-python-3-9
Draft

Drop Python 3.9 support and fix Python 3.12 compatibility#1890
Copilot wants to merge 8 commits intomainfrom
copilot/fix-build-issues-drop-python-3-9

Conversation

Copy link

Copilot AI commented Feb 4, 2026

  • Explore repository structure
  • Identify Python 3.9 references in configuration files
  • Remove Python 3.9 from setup.cfg (already set to >= 3.10)
  • Remove Python 3.9 from CI workflows (pythonapp.yml - 3 jobs updated)
  • Update pyproject.toml target versions from py36/py37/py38 to py310/py311/py312
  • Remove deprecated distutils usage (replaced with custom implementation in 4 files)
  • Fix flake8 linting issues (all files pass)
  • Test build locally (sdist builds successfully, no errors)
  • Update CVAT plugin runtime from Python 3.8 to 3.10 (8 plugin files)
  • Improve strtobool type safety based on code review feedback
  • Run security checks (CodeQL - no vulnerabilities found)
  • Add SimpleITK>=2.2.0 as explicit dependency to fix CI failures
  • Fix circular import issue by moving strtobool to standalone module
  • Wait for CI to validate all fixes

Latest Fix:

Fixed circular import error between config.py and generic.py by:

  1. Created new standalone module monailabel/utils/others/strtobool.py
  2. Updated all imports to use the new module
  3. Removed strtobool function from generic.py (now imports from strtobool.py)
  4. This eliminates the circular dependency: config.py → strtobool.py (no dependencies)
Original prompt

This section details on the original issue you should resolve

<issue_title>Fix all the build issues, test and verify all basic features and release a new version for monailabel</issue_title>
<issue_description>- Fix build

  • Drop python 3.9 version
  • Verify all good (models, ohif, 3d slicer extensions etc..)
  • Release new version to PIP
    </issue_description>

<agent_instructions>- Fix build issues

  • Drop python 3.9 support also remove it from CI
  • make sure all the CI tests are passed</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits February 4, 2026 16:24
Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build issues and release new version for MonaiLabel Drop Python 3.9 support and fix Python 3.12 compatibility Feb 4, 2026
Copilot AI requested a review from bhashemian February 4, 2026 16:38
@bhashemian
Copy link
Member

@copilot the CI tests are failing. Fix them all.

Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 4, 2026

@copilot the CI tests are failing. Fix them all.

Fixed in commit ec0d5c8. The CI failures were caused by a missing SimpleITK dependency. Added SimpleITK>=2.2.0 to both setup.cfg and requirements.txt. This should resolve all three types of failures: unit tests, build-docs, and packaging tests.

@bhashemian
Copy link
Member

@copilot CI still failing:

Properly fix them, please.

Co-authored-by: bhashemian <3968947+bhashemian@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 4, 2026

@copilot CI still failing:

Fixed in commit 6843287. The circular import was caused by config.py importing from generic.py, which in turn imported from config.py. Created a standalone strtobool.py module with no dependencies to break the circular dependency chain.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • results.pre-commit.ci
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix all the build issues, test and verify all basic features and release a new version for monailabel

2 participants