Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__version__ attribute no longer available #384

Closed
joelostblom opened this issue Dec 28, 2023 · 8 comments · Fixed by #386
Closed

__version__ attribute no longer available #384

joelostblom opened this issue Dec 28, 2023 · 8 comments · Fixed by #386
Labels

Comments

@joelostblom
Copy link

It seems like __version__ has been removed from the main namespace in jupyter_core 3.6. I have noted that this had led to issues in at least two other applications that rely on being able to read the version number from __version__, see conda-forge/quarto-feedstock#34 (comment) and https://gitlab.com/joelostblom/session_info/-/issues/14 for details. Would it be possible to reintroduce the __version__ attribute (or at least mark it as deprecated for a while), or is there a reason for not using it any longer? From my understanding it is more common to have __version__ as an attribute on the main module rather than in a version.__version__ submodule, but there might very well be good reasons for the latter that I am not aware of.

I believe it happened in this PR #376 so cc @blink1073.

@mfisher87
Copy link

mfisher87 commented Dec 29, 2023

It does look to me like an accidental API change by a Ruff autofixer, as the commit message just indicates linter fixes, and the API change was mixed in with many other safe changes, making it hard to notice.

@blink1073
Copy link
Contributor

Yes, this was an oversight. I'm afk this week, will make a fix release early next week.

@mfisher87
Copy link

Wonderful, thank you!

@dlealv
Copy link

dlealv commented Dec 31, 2023

@mfisher87, @blink1073 it seems you fixed the issue, but I am not sure. What would be the process to reflect the changes? I ran pip install jupyter or pip install jupyterlab and then jupyter --version but the version that appears for jupyter core is 5.5.0:

(jupyter3) dleal:~$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.18.1
ipykernel        : 6.27.1
ipywidgets       : 8.1.1
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.12.1
jupyterlab       : 4.0.9
nbclient         : 0.9.0
nbconvert        : 7.12.0
nbformat         : 5.9.2
notebook         : 7.0.6
qtconsole        : 5.5.1
traitlets        : 5.14.0
(jupyter3) dleal:~$

Thanks

@mfisher87
Copy link

mfisher87 commented Dec 31, 2023

The fix is not in quite yet, it's in open PR #386. It also adds a test and some other config to avoid regression 💯

To test if you are impacted by this issue, run python -c "import jupyter_core; print(jupyter_core.__version__)"

Unimpacted

$ python -c "import jupyter_core; print(jupyter_core.__version__)"
5.3.2

Impacted (5.6.0)

$ python -c "import jupyter_core; print(jupyter_core.__version__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'jupyter_core' has no attribute '__version__'

@blink1073
Copy link
Contributor

blink1073 commented Dec 31, 2023

The bug was introduced in 5.5.1, and will be fixed in 5.6.1.

@dlealv
Copy link

dlealv commented Jan 4, 2024

It seems the issue was fixed. I usually do: pip install jupyterlab, but the current stable version is 4.0.9, so the change hasn't been propagated to jupyter lab yet, which requires jupyter-core, as it is indicated via pip show jupyterlab in the Requires section. I don't want to install the jupyter-core alone (version 5.7.0) in case some compatibility gets broken. Please advise how to proceed. Thanks

@blink1073
Copy link
Contributor

pip install --no-deps jupyter_core==5.6.1 would ensure that you only update jupyter_core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants