Skip to content

Update dependencies to support Python 3.12#439

Open
Dipro-cyber wants to merge 6 commits into
chaoss:mainfrom
Dipro-cyber:fix/python312-dependency-support-163
Open

Update dependencies to support Python 3.12#439
Dipro-cyber wants to merge 6 commits into
chaoss:mainfrom
Dipro-cyber:fix/python312-dependency-support-163

Conversation

@Dipro-cyber

Copy link
Copy Markdown
Contributor

Description
Python 3.12+ installations were failing because several pinned
dependencies don't provide compatible wheels or use removed stdlib
modules (distutils).

Changes based on the investigation documented in #163:

  • tensorflow: ==2.15.0>=2.16.1 — first version with Python 3.12 wheels
  • scikit-image: ==0.19.1>=0.22.0 — fixes ModuleNotFoundError: No module named 'distutils'
  • protobuf: removed <3.22 upper cap — was blocking newer TensorFlow versions
  • pandas: ==1.5.3>=1.5.3 — relaxed to resolve cascading dependency conflicts
  • classifiers: added Python :: 3.12

Note: uv.lock will need to be regenerated after merging (uv lock).
Testing with the automated unit tests on Python 3.12 would be valuable.

This PR fixes #163

Notes for Reviewers
Only pyproject.toml changed. The lock file will need regenerating.
Would appreciate testing on Python 3.12 to confirm unit tests pass.

Signed commits

  • Yes, I signed my commits.

Generative AI disclosure

  • This contribution was assisted or created by Generative AI tools.
  • What tools were used? Kiro
  • How were these tools used? Helped identify the specific version constraints to update based on the issue discussion
  • Did you review these outputs before submitting this PR? Yes

@Dipro-cyber Dipro-cyber requested a review from MoralCode as a code owner July 6, 2026 16:55
@MoralCode

MoralCode commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

This PR contains changes from the user agent PR as well, please make sure you create a new branch from main for each new PR.

Youre also welcome to add 3.12 to the build matrix for the functional testing CI job if you want to enable the unit tests to run in a python 3.12 environment

Python 3.12+ installations were failing due to several pinned
dependencies not providing compatible wheels or builds.

Changes based on investigation in chaoss#163:
- tensorflow: 2.15.0 -> >=2.16.1 (first version with Python 3.12 wheels)
- scikit-image: 0.19.1 -> >=0.22.0 (fixes ModuleNotFoundError: distutils)
- protobuf: removed <3.22 upper cap (was blocking newer tensorflow)
- pandas: ==1.5.3 -> >=1.5.3 (relaxed to resolve dependency conflicts)
- classifiers: added Python 3.12 to supported versions

Fixes chaoss#163

Signed-off-by: Diptesh Roy <droy88333@gmail.com>
Signed-off-by: Diptesh Roy <droy88333@gmail.com>
@Dipro-cyber Dipro-cyber force-pushed the fix/python312-dependency-support-163 branch from 60ec9af to 8b4bc6e Compare July 7, 2026 11:49
@Dipro-cyber

Copy link
Copy Markdown
Contributor Author

Thanks for the contribution!

This PR contains changes from the user agent PR as well, please make sure you create a new branch from main for each new PR.

Youre also welcome to add 3.12 to the build matrix for the functional testing CI job if you want to enable the unit tests to run in a python 3.12 environment

Yes sir did the necessary changes.

Enables unit tests to run in a Python 3.12 environment as part of
validating the dependency updates in this PR.

Signed-off-by: Diptesh Roy <droy88333@gmail.com>
@MoralCode MoralCode changed the title Fix/python312 dependency support 163 Update dependencies to support Python 3.12 Jul 7, 2026
@MoralCode

Copy link
Copy Markdown
Contributor

CI is failing. i suspect because the pandas version is from 2023 and setuptools is likely using the latest version.

I think this maybe needs more testing to see what pandas version we need to bump to to fix this, without causing other things to fail

@MoralCode

Copy link
Copy Markdown
Contributor

oh wait pandas is unlocked - maybe we need to bump beyond 1.5? i think 1.5 was the last pandas version before 2.0 and i dont think >= will bump a major version when minor/patch versions are specified

@MoralCode MoralCode added the waiting This change is waiting for some other changes to land first label Jul 7, 2026
pandas 1.5.x does not support Python 3.12. >=1.5.3 was not sufficient
because uv resolves to the latest compatible minor version, and 1.5 was
the last series before 2.0. Bumping to >=2.0.0 ensures a Python 3.12
compatible version is resolved. Regenerated uv.lock accordingly.

Signed-off-by: Diptesh Roy <droy88333@gmail.com>
@Dipro-cyber

Copy link
Copy Markdown
Contributor Author

@MoralCode sir bumped pandas to >=2.0.0 and regenerated uv.lock.

On Python 3.12, celery -> dateutil -> six.moves fails with:
  ModuleNotFoundError: No module named 'six.moves'

python-dateutil depends on six but uv was not resolving six as a
transitive dependency on Python 3.12. Adding six>=1.5 explicitly
ensures it gets installed.

Signed-off-by: Diptesh Roy <droy88333@gmail.com>
six 1.15.0 has a known issue where six.moves fails to register properly
on Python 3.12, causing ModuleNotFoundError. six 1.16.0+ fixes this.
Updated uv.lock accordingly (resolves to six 1.17.0).

Signed-off-by: Diptesh Roy <droy88333@gmail.com>
@MoralCode

Copy link
Copy Markdown
Contributor

sounds good! because we made a major version bump, id like to read the release notes for pandas 2.0 and find some way to validate that our use of pandas is not affected by it.

We have plenty of time for that since I'd like to merge this after 1.1 comes out too

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

Labels

waiting This change is waiting for some other changes to land first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependencies wont install on Python 3.12+ due to tensorflow version

2 participants