Skip to content

Remove undeclared dependency on past.builtins - #1253

Open
Abhayindia wants to merge 1 commit into
dronekit:masterfrom
Abhayindia:fix/past-module-import-error
Open

Remove undeclared dependency on past.builtins#1253
Abhayindia wants to merge 1 commit into
dronekit:masterfrom
Abhayindia:fix/past-module-import-error

Conversation

@Abhayindia

@Abhayindia Abhayindia commented Aug 25, 2026

Copy link
Copy Markdown

Fixes #1252.

dronekit/__init__.py imports basestring from past.builtins, but python-future (which provides past) was never listed as a dependency in setup.py. A fresh pip install dronekit fails immediately on import.

basestring is only needed for Python 2/3 compatibility, so this replaces the import with the same sys.version_info gating already used a few lines up for the collections.abc change - no new dependency needed.

Confirmed the module is genuinely gone and the import still works:

$ python -c "import past"
ModuleNotFoundError: No module named 'past'

$ python -c "import dronekit; print('import OK')"
import OK

dronekit/__init__.py imported basestring from past.builtins, but
python-future was never listed as an install dependency, so a fresh
`pip install dronekit` fails with ModuleNotFoundError: No module
named 'past' as soon as dronekit is imported (dronekit#1252).

basestring is only needed for Python 2/3 compatibility, so replace
the external import with the same sys.version_info gating already
used a few lines above for the collections.abc change.
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.

ModuleNotFoundError: No module named 'past'

1 participant