Skip to content

fix: declare packaging as an explicit dependency#1462

Open
dimitri-yatsenko wants to merge 1 commit into
masterfrom
fix/missing-packaging-dep
Open

fix: declare packaging as an explicit dependency#1462
dimitri-yatsenko wants to merge 1 commit into
masterfrom
fix/missing-packaging-dep

Conversation

@dimitri-yatsenko
Copy link
Copy Markdown
Member

Summary

src/datajoint/migrate.py imports from packaging.version import Version, but packaging is not declared in pyproject.toml dependencies. None of the declared deps pull it in transitively, so a fresh pip install datajoint into a clean Python 3.12+ venv (where the venv no longer ships setuptools by default) leaves packaging uninstalled and import datajoint raises:

ModuleNotFoundError: No module named 'packaging'

Pre-existing bug — reproduces on 2.2.2 and 2.2.3 — but became user-visible with Python 3.12's leaner venvs.

Reproducer

python3.12 -m venv /tmp/dj-test
/tmp/dj-test/bin/pip install datajoint==2.2.3
/tmp/dj-test/bin/python -c "import datajoint as dj; print(dj.__version__)"
# ModuleNotFoundError: No module named 'packaging'

Fix

Adds packaging to the dependencies list in pyproject.toml. No version pin since migrate.py uses only the basic Version class, which has been stable across the package's history.

Release target

Candidate for 2.2.4 (patch fixing a real import datajoint regression in clean Python 3.12 venvs).

Test plan

  • Reproduce the failure on 2.2.3 in a clean Python 3.12 venv
  • After this PR's wheel is built: confirm import datajoint succeeds in the same reproducer
  • Pre-commit hooks pass

src/datajoint/migrate.py imports ``packaging.version.Version`` but
``packaging`` is not listed in pyproject.toml dependencies. None of the
declared deps pull it in transitively, so a fresh ``pip install datajoint``
into a clean Python 3.12+ venv (where the venv no longer ships setuptools
by default) leaves ``packaging`` uninstalled and ``import datajoint``
raises::

    ModuleNotFoundError: No module named 'packaging'

This is a pre-existing bug — same failure reproduces on 2.2.2 and 2.2.3
— but only became user-visible with Python 3.12's leaner venvs.

Adds ``packaging`` to the dependencies list. No version pin since
``migrate.py`` uses only the basic ``Version`` class, which has been
stable across the package's history.
@dimitri-yatsenko dimitri-yatsenko added the bug Indicates an unexpected problem or unintended behavior label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Indicates an unexpected problem or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants