···997997998998### Interpreters {#interpreters}
99999910001000-Versions 2.7, 3.8, 3.9, 3.10 and 3.11 of the CPython interpreter are available
10011001-as respectively `python27`, `python38`, `python39`, `python310` and `python311`.
10021002-The aliases `python2` and `python3` correspond to respectively `python27` and
10031003-`python310`. The attribute `python` maps to `python2`. The PyPy interpreters
10041004-compatible with Python 2.7 and 3 are available as `pypy27` and `pypy3`, with
10051005-aliases `pypy2` mapping to `pypy27` and `pypy` mapping to `pypy2`. The Nix
10061006-expressions for the interpreters can be found in
10001000+| Package | Aliases | Interpreter |
10011001+|------------|-----------------|-------------|
10021002+| python27 | python2, python | CPython 2.7 |
10031003+| python38 | | CPython 3.8 |
10041004+| python39 | | CPython 3.9 |
10051005+| python310 | python3 | CPython 3.10 |
10061006+| python311 | | CPython 3.11 |
10071007+| python312 | | CPython 3.12 |
10081008+| pypy27 | pypy2, pypy | PyPy2.7 |
10091009+| pypy39 | pypy3 | PyPy 3.9 |
10101010+10111011+The Nix expressions for the interpreters can be found in
10071012`pkgs/development/interpreters/python`.
1008101310091014All packages depending on any Python interpreter get appended
···3333 '';
34343535 meta = with lib; {
3636+ mainProgram = "stremio";
3637 description = "A modern media center that gives you the freedom to watch everything you want.";
3738 homepage = "https://www.stremio.com/";
3839 # (Server-side) web UI is closed source now, apparently they work on open-sourcing it.
···11+diff --git a/exputils/gui/jupyter/__init__.py b/exputils/gui/jupyter/__init__.py
22+index 6e9aefb..fdfdd28 100644
33+--- a/exputils/gui/jupyter/__init__.py
44++++ b/exputils/gui/jupyter/__init__.py
55+@@ -30,8 +30,8 @@ from exputils.gui.jupyter.misc import remove_children_from_widget
66+ from exputils.gui.jupyter.misc import set_children_of_widget
77+ from exputils.gui.jupyter.misc import generate_random_state_backup_name
88+99+-from exputils.gui.jupyter.ipynbname import get_notebook_name
1010+-from exputils.gui.jupyter.ipynbname import get_notebook_path
1111++from ipynbname import name as get_notebook_name
1212++from ipynbname import path as get_notebook_path
1313+1414+ DEFAULT_CONFIG_DIRECTORY = '.ipython_config'
1515+1616+diff --git a/exputils/gui/jupyter/ipynbname.py b/exputils/gui/jupyter/ipynbname.py
1717+deleted file mode 100644
1818+index 51e21b7..0000000
1919+--- a/exputils/gui/jupyter/ipynbname.py
2020++++ /dev/null
2121+@@ -1,86 +0,0 @@
2222+-##
2323+-## This file is part of the exputils package.
2424+-##
2525+-## Copyright: INRIA
2626+-## Year: 2022, 2023
2727+-## Contact: chris.reinke@inria.fr
2828+-##
2929+-## exputils is provided under GPL-3.0-or-later
3030+-##
3131+-# Taken from https://pypi.org/project/ipynbname/
3232+-# TODO: add them to licence
3333+-
3434+-from notebook import notebookapp
3535+-import urllib, json, os, ipykernel, ntpath
3636+-
3737+-FILE_ERROR = "Can't identify the notebook {}."
3838+-CONN_ERROR = "Unable to access server;\n \
3939+- + ipynbname requires either no security or token based security."
4040+-
4141+-def _get_kernel_id():
4242+- """ Returns the kernel ID of the ipykernel.
4343+- """
4444+- connection_file = os.path.basename(ipykernel.get_connection_file())
4545+- kernel_id = connection_file.split('-', 1)[1].split('.')[0]
4646+- return kernel_id
4747+-
4848+-
4949+-def _get_sessions(srv):
5050+- """ Given a server, returns sessions, or HTTPError if access is denied.
5151+- NOTE: Works only when either there is no security or there is token
5252+- based security. An HTTPError is raised if unable to connect to a
5353+- server.
5454+- """
5555+- try:
5656+- qry_str = ""
5757+- token = srv['token']
5858+- if token:
5959+- qry_str = f"?token={token}"
6060+- url = f"{srv['url']}api/sessions{qry_str}"
6161+- req = urllib.request.urlopen(url)
6262+- return json.load(req)
6363+- except:
6464+- raise urllib.error.HTTPError(CONN_ERROR)
6565+-
6666+-
6767+-def _get_nb_path(sess, kernel_id):
6868+- """ Given a session and kernel ID, returns the notebook path for the
6969+- session, or None if there is no notebook for the session.
7070+- """
7171+- if sess['kernel']['id'] == kernel_id:
7272+- return sess['notebook']['path']
7373+- return None
7474+-
7575+-
7676+-def get_notebook_name():
7777+- """ Returns the short name of the notebook w/o the .ipynb extension,
7878+- or raises a FileNotFoundError exception if it cannot be determined.
7979+- """
8080+- kernel_id = _get_kernel_id()
8181+- for srv in notebookapp.list_running_servers():
8282+- try:
8383+- sessions = _get_sessions(srv)
8484+- for sess in sessions:
8585+- nb_path = _get_nb_path(sess, kernel_id)
8686+- if nb_path:
8787+- return ntpath.basename(nb_path).replace('.ipynb', '')
8888+- except:
8989+- pass # There may be stale entries in the runtime directory
9090+- raise FileNotFoundError(FILE_ERROR.format('name'))
9191+-
9292+-
9393+-def get_notebook_path():
9494+- """ Returns the absolute path of the notebook,
9595+- or raises a FileNotFoundError exception if it cannot be determined.
9696+- """
9797+- kernel_id = _get_kernel_id()
9898+- for srv in notebookapp.list_running_servers():
9999+- try:
100100+- sessions = _get_sessions(srv)
101101+- for sess in sessions:
102102+- nb_path = _get_nb_path(sess, kernel_id)
103103+- if nb_path:
104104+- return os.path.join(srv['notebook_dir'], nb_path)
105105+- except:
106106+- pass # There may be stale entries in the runtime directory
107107+- raise FileNotFoundError(FILE_ERROR.format('path'))
108108+\ No newline at end of file
109109+diff --git a/setup.cfg b/setup.cfg
110110+index 9d9cbb0..6080ed6 100644
111111+--- a/setup.cfg
112112++++ b/setup.cfg
113113+@@ -25,3 +25,4 @@ install_requires =
114114+ tensorboard >= 1.15.0
115115+ fasteners >= 0.18
116116+ pyyaml >= 6.0
117117++ ipynbname