fix: declare packaging as an explicit dependency#1462
Open
dimitri-yatsenko wants to merge 1 commit into
Open
Conversation
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.
ttngu207
approved these changes
Jun 5, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/datajoint/migrate.pyimportsfrom packaging.version import Version, butpackagingis not declared inpyproject.tomldependencies. None of the declared deps pull it in transitively, so a freshpip install datajointinto a clean Python 3.12+ venv (where the venv no longer ships setuptools by default) leavespackaginguninstalled andimport datajointraises:Pre-existing bug — reproduces on 2.2.2 and 2.2.3 — but became user-visible with Python 3.12's leaner venvs.
Reproducer
Fix
Adds
packagingto the dependencies list inpyproject.toml. No version pin sincemigrate.pyuses only the basicVersionclass, which has been stable across the package's history.Release target
Candidate for 2.2.4 (patch fixing a real
import datajointregression in clean Python 3.12 venvs).Test plan
import datajointsucceeds in the same reproducer