jupyter-cache icon indicating copy to clipboard operation
jupyter-cache copied to clipboard

SQLAlchemy is pinned to 1.5.0, making it hard for dependent projects to upgrade to 2.0.x

Open jaapz opened this issue 2 years ago • 4 comments

Describe the bug

SQLAlchemy 2.0.3 has been released, and currently it's impossible to have both jupyter-cache and SQLAlchemy 2 as dependencies for a project, as jupyter-cache pins sqlalchemy to any version < 1.5 it seems like.

I already encountered this problem the previous time sqlalchemy was updated (https://github.com/executablebooks/jupyter-cache/issues/65#issuecomment-885611887)

Do you really need to pin this dependency so strictly? We're currently stuck upgrading a dependent project due to this.

Reproduce the bug

Use sqlalchemy 2.0 as a dependency on a project that also depends on jupyter-cache

List your environment

No response

jaapz avatar Feb 10 '23 14:02 jaapz

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Feb 10 '23 14:02 welcome[bot]

+1

kloczek avatar Feb 19 '23 15:02 kloczek

I've been tyng to build and use jupyter-cache with relaxed dependencies and on testing myst-nb pytest fails with

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-myst-nb-0.17.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-myst-nb-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/MyST-NB-0.17.1, configfile: tox.ini
plugins: anyio-3.6.2, datadir-1.4.1, regressions-2.4.2, pytest_param_files-0.3.4
collected 41 items / 2 errors

==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_docutils.py ____________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/MyST-NB-0.17.1/tests/test_docutils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_docutils.py:11: in <module>
    from myst_nb.docutils_ import Parser
../../BUILDROOT/python-myst-nb-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/docutils_.py:22: in <module>
    from myst_parser.parsers.docutils_ import (
E   ImportError: cannot import name 'DOCUTILS_EXCLUDED_ARGS' from 'myst_parser.parsers.docutils_' (/usr/lib/python3.8/site-packages/myst_parser/parsers/docutils_.py)
____________________ ERROR collecting tests/test_execute.py ____________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/MyST-NB-0.17.1/tests/test_execute.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_execute.py:9: in <module>
    from myst_nb.sphinx_ import NbMetadataCollector
../../BUILDROOT/python-myst-nb-0.17.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/myst_nb/sphinx_.py:16: in <module>
    from myst_parser.mdit_to_docutils.sphinx_ import SphinxRenderer, create_warning
E   ImportError: cannot import name 'create_warning' from 'myst_parser.mdit_to_docutils.sphinx_' (/usr/lib/python3.8/site-packages/myst_parser/mdit_to_docutils/sphinx_.py)
=============================== warnings summary ===============================
../../../../../usr/lib/python3.8/site-packages/jupyter_client/connect.py:27
  /usr/lib/python3.8/site-packages/jupyter_client/connect.py:27: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6
    from jupyter_core.paths import jupyter_data_dir

../../../../../usr/lib/python3.8/site-packages/jupyter_cache/cache/db.py:17
  /usr/lib/python3.8/site-packages/jupyter_cache/cache/db.py:17: MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
    OrmBase = declarative_base()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/test_docutils.py
ERROR tests/test_execute.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
======================== 2 warnings, 2 errors in 0.99s =========================

kloczek avatar Feb 19 '23 15:02 kloczek

+1

baron avatar Mar 19 '23 23:03 baron

SQLAlchemy upper limit has been bumped to <3, so this can be closed now.

Whether that upper limit is necessary or not may be a subject of a new issue.

bsipocz avatar Sep 13 '24 03:09 bsipocz