Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-jupyter-server-terminals for
openSUSE:Factory checked in at 2023-12-25 19:05:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jupyter-server-terminals (Old)
and /work/SRC/openSUSE:Factory/.python-jupyter-server-terminals.new.28375
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jupyter-server-terminals"
Mon Dec 25 19:05:36 2023 rev:4 rq:1134930 version:0.5.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-jupyter-server-terminals/python-jupyter-server-terminals.changes
2023-11-08 22:20:09.772540322 +0100
+++
/work/SRC/openSUSE:Factory/.python-jupyter-server-terminals.new.28375/python-jupyter-server-terminals.changes
2023-12-25 19:05:49.830643221 +0100
@@ -1,0 +2,7 @@
+Sat Dec 23 19:46:19 UTC 2023 - Ben Greiner <[email protected]>
+
+- Update to 0.5.0
+ * Fix respecting serverapp.terminals_enabled #91 (@danielzgtg)
+ * code maintenance
+
+-------------------------------------------------------------------
Old:
----
jupyter_server_terminals-0.4.4.tar.gz
New:
----
jupyter_server_terminals-0.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jupyter-server-terminals.spec ++++++
--- /var/tmp/diff_new_pack.Od7Cpj/_old 2023-12-25 19:05:50.422664825 +0100
+++ /var/tmp/diff_new_pack.Od7Cpj/_new 2023-12-25 19:05:50.422664825 +0100
@@ -25,8 +25,9 @@
%bcond_with test
%endif
+%define distversion 0.5
Name: python-jupyter-server-terminals%{psuffix}
-Version: 0.4.4
+Version: 0.5.0
Release: 0
Summary: A Jupyter Server Extension Providing Terminals
License: BSD-3-Clause
@@ -56,7 +57,7 @@
%package -n jupyter-server-terminals
Summary: Jupyter Server Extension registration for
python*-jupyter-server-terminals
-Requires: python3dist(jupyter-server-terminals)
+Requires: python3dist(jupyter-server-terminals) = %{distversion}
%description -n jupyter-server-terminals
A Jupyter Server Extension Providing Terminals.
++++++ jupyter_server_terminals-0.4.4.tar.gz ->
jupyter_server_terminals-0.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/.github/workflows/test.yml
new/jupyter_server_terminals-0.5.0/.github/workflows/test.yml
--- old/jupyter_server_terminals-0.4.4/.github/workflows/test.yml
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/.github/workflows/test.yml
2020-02-02 01:00:00.000000000 +0100
@@ -16,12 +16,12 @@
name: Test Lint
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- - name: Run Linters
- run: |
+ - name: Run Linters
+ run: |
hatch run typing:test
- hatch run lint:style
+ hatch run lint:build
pipx run interrogate .
pipx run doc8 --max-line-length=200
@@ -32,17 +32,19 @@
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
- python-version: ["3.8", "3.11"]
+ python-version: ["3.8", "3.12"]
include:
- os: windows-latest
python-version: "3.9"
- os: ubuntu-latest
- python-version: "pypy-3.8"
+ python-version: "pypy-3.9"
- os: macos-latest
python-version: "3.10"
+ - os: ubuntu-latest
+ python-version: "3.11"
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Run the tests on pypy
@@ -53,16 +55,21 @@
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
run: |
hatch run cov:test --cov-fail-under 75 || hatch run test:test --lf
- - name: Coverage
- run: |
- pip install codecov coverage[toml]
- codecov
+ - uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1
+
+ coverage:
+ runs-on: ubuntu-latest
+ needs:
+ - test
+ steps:
+ - uses: actions/checkout@v4
+ - uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1
test_docs:
name: Test Docs
runs-on: windows-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- run: hatch run docs:build
@@ -71,7 +78,7 @@
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
dependency_type: minimum
@@ -84,7 +91,7 @@
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
dependency_type: pre
@@ -97,7 +104,7 @@
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1
@@ -116,7 +123,7 @@
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install Dependencies
@@ -131,14 +138,14 @@
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
tests_check: # This job does nothing and is only used for the branch
protection
if: always()
needs:
- - test
+ - coverage
- test_lint
- test_docs
- test_minimum_versions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/.pre-commit-config.yaml
new/jupyter_server_terminals-0.5.0/.pre-commit-config.yaml
--- old/jupyter_server_terminals-0.4.4/.pre-commit-config.yaml 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/.pre-commit-config.yaml 2020-02-02
01:00:00.000000000 +0100
@@ -1,9 +1,10 @@
ci:
autoupdate_schedule: monthly
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-ast
@@ -15,28 +16,66 @@
- id: check-json
- id: check-toml
- id: check-yaml
+ - id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
- rev: 0.19.2
+ rev: 0.27.3
hooks:
- id: check-github-workflows
- repo: https://github.com/executablebooks/mdformat
- rev: 0.7.16
+ rev: 0.7.17
hooks:
- id: mdformat
- additional_dependencies:
- [mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
- - repo: https://github.com/psf/black
- rev: 22.12.0
+ - repo: https://github.com/pre-commit/mirrors-prettier
+ rev: "v3.1.0"
+ hooks:
+ - id: prettier
+ types_or: [yaml, html, json]
+
+ - repo: https://github.com/adamchainz/blacken-docs
+ rev: "1.16.0"
+ hooks:
+ - id: blacken-docs
+ additional_dependencies: [black==23.7.0]
+
+ - repo: https://github.com/codespell-project/codespell
+ rev: "v2.2.6"
+ hooks:
+ - id: codespell
+ args: ["-L", "sur,nd"]
+
+ - repo: https://github.com/pre-commit/pygrep-hooks
+ rev: "v1.10.0"
+ hooks:
+ - id: rst-backticks
+ - id: rst-directive-colons
+ - id: rst-inline-touching-normal
+
+ - repo: https://github.com/pre-commit/mirrors-mypy
+ rev: "v1.7.1"
hooks:
- - id: black
+ - id: mypy
+ files: "^jupyter_server_terminals"
+ stages: [manual]
+ args: ["--install-types", "--non-interactive"]
+ additional_dependencies:
+ ["traitlets>=5.13", "jupyter_server>=2.10.1", "terminado>=0.18"]
- - repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.206
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.1.7
hooks:
- id: ruff
- args: ["--fix"]
+ types_or: [python, jupyter]
+ args: ["--fix", "--show-fixes"]
+ - id: ruff-format
+ types_or: [python, jupyter]
+
+ - repo: https://github.com/scientific-python/cookie
+ rev: "2023.11.17"
+ hooks:
+ - id: sp-repo-review
+ additional_dependencies: ["repo-review[cli]"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/.readthedocs.yaml
new/jupyter_server_terminals-0.5.0/.readthedocs.yaml
--- old/jupyter_server_terminals-0.4.4/.readthedocs.yaml 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/.readthedocs.yaml 2020-02-02
01:00:00.000000000 +0100
@@ -2,10 +2,13 @@
sphinx:
configuration: docs/source/conf.py
python:
- version: 3.8
install:
# install itself with pip install .
- method: pip
path: .
extra_requirements:
- docs
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.11"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/CHANGELOG.md
new/jupyter_server_terminals-0.5.0/CHANGELOG.md
--- old/jupyter_server_terminals-0.4.4/CHANGELOG.md 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/CHANGELOG.md 2020-02-02
01:00:00.000000000 +0100
@@ -4,6 +4,42 @@
<!-- <START NEW CHANGELOG ENTRY> -->
+## 0.5.0
+
+([Full
Changelog](https://github.com/jupyter-server/jupyter_server_terminals/compare/v0.4.4...00eb4ee20b8d5838e44de7a756823e4cf02949fa))
+
+### Bugs fixed
+
+- Fix respecting serverapp.terminals_enabled
[#91](https://github.com/jupyter-server/jupyter_server_terminals/pull/91)
([@danielzgtg](https://github.com/danielzgtg))
+
+### Maintenance and upkeep improvements
+
+- Update ruff config
[#101](https://github.com/jupyter-server/jupyter_server_terminals/pull/101)
([@blink1073](https://github.com/blink1073))
+- Update typings for Server 2.10.1 and mypy 1.7 #425
[#99](https://github.com/jupyter-server/jupyter_server_terminals/pull/99)
([@blink1073](https://github.com/blink1073))
+- Update types for terminado 0.18
[#98](https://github.com/jupyter-server/jupyter_server_terminals/pull/98)
([@blink1073](https://github.com/blink1073))
+- Update ruff config
[#97](https://github.com/jupyter-server/jupyter_server_terminals/pull/97)
([@blink1073](https://github.com/blink1073))
+- Update typings for server 2.10
[#96](https://github.com/jupyter-server/jupyter_server_terminals/pull/96)
([@blink1073](https://github.com/blink1073))
+- chore: update pre-commit hooks
[#95](https://github.com/jupyter-server/jupyter_server_terminals/pull/95)
([@pre-commit-ci](https://github.com/pre-commit-ci))
+- Clean up lint handling
[#94](https://github.com/jupyter-server/jupyter_server_terminals/pull/94)
([@blink1073](https://github.com/blink1073))
+- Adopt ruff format
[#93](https://github.com/jupyter-server/jupyter_server_terminals/pull/93)
([@blink1073](https://github.com/blink1073))
+- Update ruff and typing
[#92](https://github.com/jupyter-server/jupyter_server_terminals/pull/92)
([@blink1073](https://github.com/blink1073))
+- chore: update pre-commit hooks
[#90](https://github.com/jupyter-server/jupyter_server_terminals/pull/90)
([@pre-commit-ci](https://github.com/pre-commit-ci))
+- Fix typings for traitlets 5.10.1
[#89](https://github.com/jupyter-server/jupyter_server_terminals/pull/89)
([@blink1073](https://github.com/blink1073))
+- Bump actions/checkout from 3 to 4
[#88](https://github.com/jupyter-server/jupyter_server_terminals/pull/88)
([@dependabot](https://github.com/dependabot))
+- Adopt sp-repo-review
[#87](https://github.com/jupyter-server/jupyter_server_terminals/pull/87)
([@blink1073](https://github.com/blink1073))
+- Update mistune requirement from \<3.0 to \<4.0
[#83](https://github.com/jupyter-server/jupyter_server_terminals/pull/83)
([@dependabot](https://github.com/dependabot))
+- Use local coverage
[#80](https://github.com/jupyter-server/jupyter_server_terminals/pull/80)
([@blink1073](https://github.com/blink1073))
+- Clean up license
[#77](https://github.com/jupyter-server/jupyter_server_terminals/pull/77)
([@dcsaba89](https://github.com/dcsaba89))
+- Add more linting
[#75](https://github.com/jupyter-server/jupyter_server_terminals/pull/75)
([@blink1073](https://github.com/blink1073))
+
+### Contributors to this release
+
+([GitHub contributors page for this
release](https://github.com/jupyter-server/jupyter_server_terminals/graphs/contributors?from=2023-01-09&to=2023-12-11&type=c))
+
+[@blink1073](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Ablink1073+updated%3A2023-01-09..2023-12-11&type=Issues)
|
[@codecov](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Acodecov+updated%3A2023-01-09..2023-12-11&type=Issues)
|
[@danielzgtg](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Adanielzgtg+updated%3A2023-01-09..2023-12-11&type=Issues)
|
[@dcsaba89](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Adcsaba89+updated%3A2023-01-09..2023-12-11&type=Issues)
|
[@dependabot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Adependabot+updated%3A2023-01-09..2023-12-11&type=Issues)
|
[@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Apre-commit-ci+updated%3A2023-01-09..2023-12-11&type=Issues)
| [@welcome](https://github.com/search?
q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Awelcome+updated%3A2023-01-09..2023-12-11&type=Issues)
+
+<!-- <END NEW CHANGELOG ENTRY> -->
+
## 0.4.4
([Full
Changelog](https://github.com/jupyter-server/jupyter_server_terminals/compare/v0.4.3...6791413888e45d2aeab5d9d154c98ca9dbd828d8))
@@ -19,8 +55,6 @@
[@blink1073](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Ablink1073+updated%3A2022-12-19..2023-01-09&type=Issues)
|
[@codecov](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Acodecov+updated%3A2022-12-19..2023-01-09&type=Issues)
|
[@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Apre-commit-ci+updated%3A2022-12-19..2023-01-09&type=Issues)
-<!-- <END NEW CHANGELOG ENTRY> -->
-
## 0.4.3
([Full
Changelog](https://github.com/jupyter-server/jupyter_server_terminals/compare/v0.4.2...b1f2a99b062192e809d770c517ce02988d32d121))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/LICENSE
new/jupyter_server_terminals-0.5.0/LICENSE
--- old/jupyter_server_terminals-0.4.4/LICENSE 2020-02-02 01:00:00.000000000
+0100
+++ new/jupyter_server_terminals-0.5.0/LICENSE 2020-02-02 01:00:00.000000000
+0100
@@ -1,59 +1,30 @@
-# Licensing terms
-
-This project is licensed under the terms of the Modified BSD License
-(also known as New or Revised or 3-Clause BSD), as follows:
+BSD 3-Clause License
- Copyright (c) 2021-, Jupyter Development Team
-All rights reserved.
-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer.
+All rights reserved.
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this
-list of conditions and the following disclaimer in the documentation and/or
-other materials provided with the distribution.
-
-Neither the name of the Jupyter Development Team nor the names of its
-contributors may be used to endorse or promote products derived from this
-software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-## About the Jupyter Development Team
-
-The Jupyter Development Team is the set of all contributors to the Jupyter
project.
-This includes all of the Jupyter subprojects.
-
-The core team that coordinates development on GitHub can be found here:
-https://github.com/jupyter/.
-
-## Our Copyright Policy
-
-Jupyter uses a shared copyright model. Each contributor maintains copyright
-over their contributions to Jupyter. But, it is important to note that these
-contributions are typically only changes to the repositories. Thus, the Jupyter
-source code, in its entirety is not the copyright of any single person or
-institution. Instead, it is the collective copyright of the entire Jupyter
-Development Team. If individual contributors want to maintain a record of what
-changes/contributions they have specific copyright on, they should indicate
-their copyright in the commit message of the change, when they commit the
-change to one of the Jupyter repositories.
-
-With this in mind, the following banner should be used in any source code file
-to indicate the copyright and license terms:
-
- # Copyright (c) Jupyter Development Team.
- # Distributed under the terms of the Modified BSD License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/PKG-INFO
new/jupyter_server_terminals-0.5.0/PKG-INFO
--- old/jupyter_server_terminals-0.4.4/PKG-INFO 2020-02-02 01:00:00.000000000
+0100
+++ new/jupyter_server_terminals-0.5.0/PKG-INFO 2020-02-02 01:00:00.000000000
+0100
@@ -1,68 +1,39 @@
Metadata-Version: 2.1
Name: jupyter_server_terminals
-Version: 0.4.4
+Version: 0.5.0
Summary: A Jupyter Server Extension Providing Terminals.
Project-URL: Homepage, https://jupyter.org
Author-email: Jupyter Development Team <[email protected]>
-License: # Licensing terms
-
- This project is licensed under the terms of the Modified BSD License
- (also known as New or Revised or 3-Clause BSD), as follows:
+License: BSD 3-Clause License
- Copyright (c) 2021-, Jupyter Development Team
- All rights reserved.
-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright notice,
this
- list of conditions and the following disclaimer.
+ All rights reserved.
+
+ 1. Redistributions of source code must retain the above copyright
notice, this
+ list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this
- list of conditions and the following disclaimer in the documentation
and/or
- other materials provided with the distribution.
-
- Neither the name of the Jupyter Development Team nor the names of its
- contributors may be used to endorse or promote products derived from
this
- software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE
+ 2. Redistributions in binary form must reproduce the above copyright
notice,
+ this list of conditions and the following disclaimer in the
documentation
+ and/or other materials provided with the distribution.
+
+ 3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- ## About the Jupyter Development Team
-
- The Jupyter Development Team is the set of all contributors to the
Jupyter project.
- This includes all of the Jupyter subprojects.
-
- The core team that coordinates development on GitHub can be found here:
- https://github.com/jupyter/.
-
- ## Our Copyright Policy
-
- Jupyter uses a shared copyright model. Each contributor maintains
copyright
- over their contributions to Jupyter. But, it is important to note that
these
- contributions are typically only changes to the repositories. Thus,
the Jupyter
- source code, in its entirety is not the copyright of any single person
or
- institution. Instead, it is the collective copyright of the entire
Jupyter
- Development Team. If individual contributors want to maintain a record
of what
- changes/contributions they have specific copyright on, they should
indicate
- their copyright in the commit message of the change, when they commit
the
- change to one of the Jupyter repositories.
-
- With this in mind, the following banner should be used in any source
code file
- to indicate the copyright and license terms:
-
- # Copyright (c) Jupyter Development Team.
- # Distributed under the terms of the Modified BSD License.
License-File: LICENSE
Keywords: ipython,jupyter
Classifier: Intended Audience :: Developers
@@ -70,17 +41,17 @@
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Requires-Dist: pywinpty>=2.0.3; os_name == 'nt'
Requires-Dist: terminado>=0.8.3
Provides-Extra: docs
Requires-Dist: jinja2; extra == 'docs'
Requires-Dist: jupyter-server; extra == 'docs'
-Requires-Dist: mistune<3.0; extra == 'docs'
+Requires-Dist: mistune<4.0; extra == 'docs'
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: nbformat; extra == 'docs'
Requires-Dist: packaging; extra == 'docs'
@@ -91,9 +62,7 @@
Requires-Dist: sphinxemoji; extra == 'docs'
Requires-Dist: tornado; extra == 'docs'
Provides-Extra: test
-Requires-Dist: coverage; extra == 'test'
Requires-Dist: jupyter-server>=2.0.0; extra == 'test'
-Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-jupyter[server]>=0.5.3; extra == 'test'
Requires-Dist: pytest-timeout; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
@@ -102,7 +71,6 @@
# Jupyter Server Terminals
[](https://github.com/jupyter-server/jupyter_server_terminals/actions?query=branch%3Amain++)
-[](https://codecov.io/gh/jupyter-server/jupyter_server_terminals)
[](http://jupyter-server-terminals.readthedocs.io/en/latest/?badge=latest)
Jupyter Server Terminals is a Jupyter Server Extension providing support for
terminals.
@@ -125,3 +93,31 @@
## Contributing
If you are interested in contributing to the project, see
[CONTRIBUTING](./CONTRIBUTING.rst).
+
+## About the Jupyter Development Team
+
+The Jupyter Development Team is the set of all contributors to the Jupyter
project.
+This includes all of the Jupyter subprojects.
+
+The core team that coordinates development on GitHub can be found here:
+https://github.com/jupyter/.
+
+## Our Copyright Policy
+
+Jupyter uses a shared copyright model. Each contributor maintains copyright
+over their contributions to Jupyter. But, it is important to note that these
+contributions are typically only changes to the repositories. Thus, the Jupyter
+source code, in its entirety is not the copyright of any single person or
+institution. Instead, it is the collective copyright of the entire Jupyter
+Development Team. If individual contributors want to maintain a record of what
+changes/contributions they have specific copyright on, they should indicate
+their copyright in the commit message of the change, when they commit the
+change to one of the Jupyter repositories.
+
+With this in mind, the following banner should be used in any source code file
+to indicate the copyright and license terms:
+
+```
+# Copyright (c) Jupyter Development Team.
+# Distributed under the terms of the Modified BSD License.
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/README.md
new/jupyter_server_terminals-0.5.0/README.md
--- old/jupyter_server_terminals-0.4.4/README.md 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/README.md 2020-02-02
01:00:00.000000000 +0100
@@ -1,7 +1,6 @@
# Jupyter Server Terminals
[](https://github.com/jupyter-server/jupyter_server_terminals/actions?query=branch%3Amain++)
-[](https://codecov.io/gh/jupyter-server/jupyter_server_terminals)
[](http://jupyter-server-terminals.readthedocs.io/en/latest/?badge=latest)
Jupyter Server Terminals is a Jupyter Server Extension providing support for
terminals.
@@ -24,3 +23,31 @@
## Contributing
If you are interested in contributing to the project, see
[CONTRIBUTING](./CONTRIBUTING.rst).
+
+## About the Jupyter Development Team
+
+The Jupyter Development Team is the set of all contributors to the Jupyter
project.
+This includes all of the Jupyter subprojects.
+
+The core team that coordinates development on GitHub can be found here:
+https://github.com/jupyter/.
+
+## Our Copyright Policy
+
+Jupyter uses a shared copyright model. Each contributor maintains copyright
+over their contributions to Jupyter. But, it is important to note that these
+contributions are typically only changes to the repositories. Thus, the Jupyter
+source code, in its entirety is not the copyright of any single person or
+institution. Instead, it is the collective copyright of the entire Jupyter
+Development Team. If individual contributors want to maintain a record of what
+changes/contributions they have specific copyright on, they should indicate
+their copyright in the commit message of the change, when they commit the
+change to one of the Jupyter repositories.
+
+With this in mind, the following banner should be used in any source code file
+to indicate the copyright and license terms:
+
+```
+# Copyright (c) Jupyter Development Team.
+# Distributed under the terms of the Modified BSD License.
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/codecov.yml
new/jupyter_server_terminals-0.5.0/codecov.yml
--- old/jupyter_server_terminals-0.4.4/codecov.yml 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/codecov.yml 1970-01-01
01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-coverage:
- status:
- project:
- default:
- target: auto
- threshold: 1
- patch:
- default:
- target: 0%
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/docs/source/conf.py
new/jupyter_server_terminals-0.5.0/docs/source/conf.py
--- old/jupyter_server_terminals-0.4.4/docs/source/conf.py 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/docs/source/conf.py 2020-02-02
01:00:00.000000000 +0100
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-#
# Jupyter Server documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 13 09:51:11 2015.
#
@@ -68,7 +66,7 @@
]
try:
- import enchant # type:ignore # noqa
+ import enchant # type:ignore[import] # noqa: F401
extensions += ["sphinxcontrib.spelling"]
except ImportError:
@@ -181,7 +179,7 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-# html_theme_options = {}
+html_theme_options = {"navigation_with_keys": False}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/docs/source/index.rst
new/jupyter_server_terminals-0.5.0/docs/source/index.rst
--- old/jupyter_server_terminals-0.4.4/docs/source/index.rst 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/docs/source/index.rst 2020-02-02
01:00:00.000000000 +0100
@@ -1,7 +1,7 @@
.. jupyter_server_terminals documentation master file, created by
sphinx-quickstart.
You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
+ contain the root ``toctree``` directive.
Welcome to Jupyter Server Terminals documentation!
==================================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/__init__.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/__init__.py
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/__init__.py
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/__init__.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,17 +1,21 @@
+from typing import Any, Dict, List
+
from ._version import __version__ # noqa:F401
try:
from jupyter_server._version import version_info
except ModuleNotFoundError:
- raise ModuleNotFoundError("Jupyter Server must be installed to use this
extension.") from None
+ msg = "Jupyter Server must be installed to use this extension."
+ raise ModuleNotFoundError(msg) from None
-if int(version_info[0]) < 2: # type:ignore
- raise RuntimeError("Jupyter Server Terminals requires Jupyter Server 2.0+")
+if int(version_info[0]) < 2: # type:ignore[call-overload]
+ msg = "Jupyter Server Terminals requires Jupyter Server 2.0+"
+ raise RuntimeError(msg)
from .app import TerminalsExtensionApp
-def _jupyter_server_extension_points(): # pragma: no cover
+def _jupyter_server_extension_points() -> List[Dict[str, Any]]: # pragma: no
cover
return [
{
"module": "jupyter_server_terminals.app",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/_version.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/_version.py
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/_version.py
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/_version.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,2 +1,2 @@
"""Version info for jupyter_server_terminals."""
-__version__ = "0.4.4"
+__version__ = "0.5.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/api_handlers.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/api_handlers.py
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/api_handlers.py
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/api_handlers.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,7 +1,9 @@
"""API handlers for terminals."""
+from __future__ import annotations
+
import json
from pathlib import Path
-from typing import Optional
+from typing import Any
from jupyter_server.auth.decorator import authorized
from jupyter_server.base.handlers import APIHandler
@@ -23,14 +25,14 @@
@web.authenticated
@authorized
- def get(self):
+ def get(self) -> None:
"""Get the list of terminals."""
models = self.terminal_manager.list()
self.finish(json.dumps(models))
@web.authenticated
@authorized
- def post(self):
+ def post(self) -> None:
"""POST /terminals creates a new terminal and redirects to it"""
data = self.get_json_body() or {}
@@ -38,7 +40,7 @@
# but if we pass it as relative, it will we be considered as relative
to
# the path jupyter_server was started in
if "cwd" in data:
- cwd: Optional[Path] = Path(data["cwd"])
+ cwd: Path | None = Path(data["cwd"])
assert cwd is not None
if not cwd.resolve().exists():
cwd = Path(self.settings["server_root_dir"]).expanduser() / cwd
@@ -48,12 +50,14 @@
if cwd is None:
server_root_dir = self.settings["server_root_dir"]
self.log.debug(
- f"Failed to find requested terminal cwd:
{data.get('cwd')}\n"
- f" It was not found within the server root neither:
{server_root_dir}."
+ "Failed to find requested terminal cwd: %s\n"
+ " It was not found within the server root neither: %s.",
+ data.get("cwd"),
+ server_root_dir,
)
del data["cwd"]
else:
- self.log.debug(f"Opening terminal in: {cwd.resolve()!s}")
+ self.log.debug("Opening terminal in: %s", cwd.resolve())
data["cwd"] = str(cwd.resolve())
model = self.terminal_manager.create(**data)
@@ -67,21 +71,21 @@
@web.authenticated
@authorized
- def get(self, name):
+ def get(self, name: str) -> None:
"""Get a terminal by name."""
model = self.terminal_manager.get(name)
self.finish(json.dumps(model))
@web.authenticated
@authorized
- async def delete(self, name):
+ async def delete(self, name: str) -> None:
"""Remove a terminal by name."""
await self.terminal_manager.terminate(name, force=True)
self.set_status(204)
self.finish()
-default_handlers = [
+default_handlers: list[tuple[str, type[Any]]] = [
(r"/api/terminals", TerminalRootHandler),
(r"/api/terminals/(\w+)", TerminalHandler),
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/app.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/app.py
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/app.py
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/app.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,7 +1,10 @@
"""A terminals extension app."""
+from __future__ import annotations
+
import os
import shlex
import sys
+import typing as t
from shutil import which
from jupyter_core.utils import ensure_async
@@ -18,7 +21,7 @@
name = "jupyter_server_terminals"
- terminal_manager_class = Type(
+ terminal_manager_class: type[TerminalManager] = Type( #
type:ignore[assignment]
default_value=TerminalManager, help="The terminal manager class to
use."
).tag(config=True)
@@ -31,19 +34,19 @@
# service's initialization still fails. As a result, this variable holds
the truth.
terminals_available = False
- def initialize_settings(self):
+ def initialize_settings(self) -> None:
"""Initialize settings."""
+ if not self.serverapp or not self.serverapp.terminals_enabled:
+ return
self.initialize_configurables()
self.settings.update(
{"terminals_available": True, "terminal_manager":
self.terminal_manager}
)
- def initialize_configurables(self):
+ def initialize_configurables(self) -> None:
"""Initialize configurables."""
- if os.name == "nt":
- default_shell = "powershell.exe"
- else:
- default_shell = which("sh") # type:ignore[assignment]
+ default_shell = "powershell.exe" if os.name == "nt" else which("sh")
+ assert self.serverapp is not None
shell_override = self.serverapp.terminado_settings.get("shell_command")
if isinstance(shell_override, str):
shell_override = shlex.split(shell_override)
@@ -68,8 +71,11 @@
)
self.terminal_manager.log = self.serverapp.log
- def initialize_handlers(self):
+ def initialize_handlers(self) -> None:
"""Initialize handlers."""
+ if not self.serverapp or not self.serverapp.terminals_enabled:
+ # Checking self.terminals_available instead breaks enabling
terminals
+ return
self.handlers.append(
(
r"/terminals/websocket/(\w+)",
@@ -78,19 +84,21 @@
)
)
self.handlers.extend(api_handlers.default_handlers)
+ assert self.serverapp is not None
self.serverapp.web_app.settings["terminal_manager"] =
self.terminal_manager
self.serverapp.web_app.settings["terminals_available"] = self.settings[
"terminals_available"
]
- def current_activity(self):
+ def current_activity(self) -> dict[str, t.Any] | None:
"""Get current activity info."""
if self.terminals_available:
terminals = self.terminal_manager.terminals
if terminals:
return terminals
+ return None
- async def cleanup_terminals(self):
+ async def cleanup_terminals(self) -> None:
"""Shutdown all terminals.
The terminals will shutdown themselves when this process no longer
exists,
@@ -104,9 +112,9 @@
terminal_msg = trans.ngettext(
"Shutting down %d terminal", "Shutting down %d terminals",
n_terminals
)
- self.log.info(terminal_msg % n_terminals)
- await ensure_async(terminal_manager.terminate_all())
+ self.log.info("%s %% %s", terminal_msg, n_terminals)
+ await ensure_async(terminal_manager.terminate_all()) #
type:ignore[arg-type]
- async def stop_extension(self):
+ async def stop_extension(self) -> None:
"""Stop the extension."""
await self.cleanup_terminals()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/base.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/base.py
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/base.py
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/base.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,10 +1,17 @@
"""Base classes."""
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
from jupyter_server.extension.handler import ExtensionHandlerMixin
+if TYPE_CHECKING:
+ from jupyter_server_terminals.terminalmanager import TerminalManager
+
class TerminalsMixin(ExtensionHandlerMixin):
"""An extension mixin for terminals."""
@property
- def terminal_manager(self):
- return self.settings["terminal_manager"] # type:ignore[attr-defined]
+ def terminal_manager(self) -> TerminalManager:
+ return self.settings["terminal_manager"] # type:ignore[no-any-return]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/handlers.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/handlers.py
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/handlers.py
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/handlers.py
2020-02-02 01:00:00.000000000 +0100
@@ -1,10 +1,15 @@
"""Tornado handlers for the terminal emulator."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
+from __future__ import annotations
+
+import typing as t
+
from jupyter_server._tz import utcnow
from jupyter_server.auth.utils import warn_disabled_authorization
from jupyter_server.base.handlers import JupyterHandler
from jupyter_server.base.websocket import WebSocketMixin
+from terminado.management import NamedTermManager
from terminado.websocket import TermSocket as BaseTermSocket
from tornado import web
@@ -18,18 +23,20 @@
auth_resource = AUTH_RESOURCE
- def initialize(self, name, term_manager, **kwargs):
+ def initialize( # type:ignore[override]
+ self, name: str, term_manager: NamedTermManager, **kwargs: t.Any
+ ) -> None:
"""Initialize the socket."""
BaseTermSocket.initialize(self, term_manager, **kwargs)
TerminalsMixin.initialize(self, name)
- def origin_check(self):
+ def origin_check(self, origin: t.Any = None) -> bool:
"""Terminado adds redundant origin_check
Tornado already calls check_origin, so don't do anything here.
"""
return True
- def get(self, *args, **kwargs):
+ async def get(self, *args: t.Any, **kwargs: t.Any) -> None:
"""Get the terminal socket."""
user = self.current_user
@@ -37,28 +44,30 @@
raise web.HTTPError(403)
# authorize the user.
- if not self.authorizer:
+ if self.authorizer is None:
# Warn if an authorizer is unavailable.
- warn_disabled_authorization()
+ warn_disabled_authorization() # type:ignore[unreachable]
elif not self.authorizer.is_authorized(self, user, "execute",
self.auth_resource):
raise web.HTTPError(403)
- if args[0] not in self.term_manager.terminals:
+ if args[0] not in self.term_manager.terminals: #
type:ignore[attr-defined]
raise web.HTTPError(404)
- return super().get(*args, **kwargs)
-
- def on_message(self, message):
- """Handle a socket mesage."""
- super().on_message(message)
+ resp = super().get(*args, **kwargs)
+ if resp is not None:
+ await resp
+
+ async def on_message(self, message: t.Any) -> None: #
type:ignore[override]
+ """Handle a socket message."""
+ await super().on_message(message)
self._update_activity()
- def write_message(self, message, binary=False):
+ def write_message(self, message: t.Any, binary: bool = False) -> None: #
type:ignore[override]
"""Write a message to the socket."""
super().write_message(message, binary=binary)
self._update_activity()
- def _update_activity(self):
+ def _update_activity(self) -> None:
self.application.settings["terminal_last_activity"] = utcnow()
# terminal may not be around on deletion/cull
if self.term_name in self.terminal_manager.terminals:
- self.terminal_manager.terminals[self.term_name].last_activity =
utcnow()
+ self.terminal_manager.terminals[self.term_name].last_activity =
utcnow() # type:ignore[attr-defined]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/rest-api.yml
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/rest-api.yml
--- old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/rest-api.yml
2020-02-02 01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/rest-api.yml
2020-02-02 01:00:00.000000000 +0100
@@ -35,7 +35,7 @@
summary: Create a new terminal
responses:
200:
- description: Succesfully created a new terminal
+ description: Successfully created a new terminal
content:
application/json:
schema:
@@ -84,7 +84,7 @@
type: string
responses:
204:
- description: Succesfully deleted terminal session
+ description: Successfully deleted terminal session
content: {}
403:
description: Forbidden to access
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/terminalmanager.py
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/terminalmanager.py
---
old/jupyter_server_terminals-0.4.4/jupyter_server_terminals/terminalmanager.py
2020-02-02 01:00:00.000000000 +0100
+++
new/jupyter_server_terminals-0.5.0/jupyter_server_terminals/terminalmanager.py
2020-02-02 01:00:00.000000000 +0100
@@ -4,17 +4,22 @@
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
+from __future__ import annotations
+
+import typing as t
from datetime import timedelta
from jupyter_server._tz import isoformat, utcnow
from jupyter_server.prometheus import metrics
-from terminado.management import NamedTermManager
+from terminado.management import NamedTermManager, PtyWithClients
from tornado import web
from tornado.ioloop import IOLoop, PeriodicCallback
from traitlets import Integer
from traitlets.config import LoggingConfigurable
-RUNNING_TOTAL = metrics.TERMINAL_CURRENTLY_RUNNING_TOTAL #
type:ignore[attr-defined]
+RUNNING_TOTAL = metrics.TERMINAL_CURRENTLY_RUNNING_TOTAL
+
+MODEL = t.Dict[str, t.Any]
class TerminalManager(LoggingConfigurable, NamedTermManager): #
type:ignore[misc]
@@ -41,13 +46,13 @@
# -------------------------------------------------------------------------
# Methods for managing terminals
# -------------------------------------------------------------------------
- def create(self, **kwargs):
+ def create(self, **kwargs: t.Any) -> MODEL:
"""Create a new terminal."""
name, term = self.new_named_terminal(**kwargs)
# Monkey-patch last-activity, similar to kernels. Should we need
# more functionality per terminal, we can look into possible sub-
# classing or containment then.
- term.last_activity = utcnow()
+ term.last_activity = utcnow() # type:ignore[attr-defined]
model = self.get_terminal_model(name)
# Increase the metric by one because a new terminal was created
RUNNING_TOTAL.inc()
@@ -55,12 +60,11 @@
self._initialize_culler()
return model
- def get(self, name):
+ def get(self, name: str) -> MODEL:
"""Get terminal 'name'."""
- model = self.get_terminal_model(name)
- return model
+ return self.get_terminal_model(name)
- def list(self):
+ def list(self) -> list[MODEL]:
"""Get a list of all running terminals."""
models = [self.get_terminal_model(name) for name in self.terminals]
@@ -68,7 +72,7 @@
RUNNING_TOTAL.set(len(models))
return models
- async def terminate(self, name, force=False):
+ async def terminate(self, name: str, force: bool = False) -> None:
"""Terminate terminal 'name'."""
self._check_terminal(name)
await super().terminate(name, force=force)
@@ -77,34 +81,33 @@
# because a terminal has been shutdown
RUNNING_TOTAL.dec()
- async def terminate_all(self):
+ async def terminate_all(self) -> None:
"""Terminate all terminals."""
terms = list(self.terminals)
for term in terms:
await self.terminate(term, force=True)
- def get_terminal_model(self, name):
+ def get_terminal_model(self, name: str) -> MODEL:
"""Return a JSON-safe dict representing a terminal.
For use in representing terminals in the JSON APIs.
"""
self._check_terminal(name)
term = self.terminals[name]
- model = {
+ return {
"name": name,
- "last_activity": isoformat(term.last_activity),
+ "last_activity": isoformat(term.last_activity), #
type:ignore[attr-defined]
}
- return model
- def _check_terminal(self, name):
+ def _check_terminal(self, name: str) -> None:
"""Check a that terminal 'name' exists and raise 404 if not."""
if name not in self.terminals:
raise web.HTTPError(404, "Terminal not found: %s" % name)
- def _initialize_culler(self):
+ def _initialize_culler(self) -> None:
"""Start culler if 'cull_inactive_timeout' is greater than zero.
Regardless of that value, set flag that we've been here.
"""
- if not self._initialized_culler and self.cull_inactive_timeout > 0:
+ if not self._initialized_culler and self.cull_inactive_timeout > 0: #
noqa: SIM102
if self._culler_callback is None:
_ = IOLoop.current()
if self.cull_interval <= 0: # handle case where user set
invalid value
@@ -126,7 +129,7 @@
self._initialized_culler = True
- async def _cull_terminals(self):
+ async def _cull_terminals(self) -> None:
self.log.debug(
"Polling every %s seconds for terminals inactive for > %s
seconds...",
self.cull_interval,
@@ -139,16 +142,18 @@
except Exception as e:
self.log.exception(
"The following exception was encountered while checking
the "
- "activity of terminal {}: {}".format(name, e)
+ "activity of terminal %s: %s",
+ name,
+ e,
)
- async def _cull_inactive_terminal(self, name):
+ async def _cull_inactive_terminal(self, name: str) -> None:
try:
term = self.terminals[name]
except KeyError:
return # KeyErrors are somewhat expected since the terminal can
be terminated as the culling check is made.
- self.log.debug("name=%s, last_activity=%s", name, term.last_activity)
+ self.log.debug("name=%s, last_activity=%s", name, term.last_activity)
# type:ignore[attr-defined]
if hasattr(term, "last_activity"):
dt_now = utcnow()
dt_inactive = dt_now - term.last_activity
@@ -162,6 +167,6 @@
)
await self.terminate(name, force=True)
- def pre_pty_read_hook(self, ptywclients):
+ def pre_pty_read_hook(self, ptywclients: PtyWithClients) -> None:
"""The pre-pty read hook."""
- ptywclients.last_activity = utcnow()
+ ptywclients.last_activity = utcnow() # type:ignore[attr-defined]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/pyproject.toml
new/jupyter_server_terminals-0.5.0/pyproject.toml
--- old/jupyter_server_terminals-0.4.4/pyproject.toml 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/pyproject.toml 2020-02-02
01:00:00.000000000 +0100
@@ -15,10 +15,10 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
- "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
- "Programming Language :: Python :: 3.10"
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11"
]
requires-python = ">=3.8"
dependencies = [
@@ -35,17 +35,15 @@
[project.optional-dependencies]
test = [
- "coverage",
"jupyter_server>=2.0.0",
"pytest-jupyter[server]>=0.5.3",
"pytest>=7.0",
- "pytest-cov",
"pytest-timeout",
]
docs = [
"jinja2",
"jupyter_server",
-"mistune<3.0", # https://github.com/jupyter/nbconvert/issues/1685"
+"mistune<4.0", # https://github.com/jupyter/nbconvert/issues/1685"
"myst-parser",
"nbformat",
"packaging",
@@ -76,39 +74,34 @@
[tool.hatch.envs.cov]
features = ["test"]
-dependencies = ["coverage", "pytest-cov"]
+dependencies = ["coverage[toml]", "pytest-cov"]
[tool.hatch.envs.cov.scripts]
test = "python -m pytest -vv --cov jupyter_server_terminals --cov-branch
--cov-report term-missing:skip-covered {args}"
nowarn = "test -W default {args}"
-[tool.hatch.envs.typing]
-features = ["test"]
-dependencies = ["mypy>=0.990"]
-[tool.hatch.envs.typing.scripts]
-test = "mypy --install-types --non-interactive {args:jupyter_server_terminals
tests}"
-
[tool.hatch.envs.lint]
-dependencies = [
- "black[jupyter]==22.12.0",
- "mdformat>0.7",
- "mdformat-gfm>=0.3.5",
- "ruff==0.0.206"
-]
detached = true
+dependencies = ["pre-commit"]
[tool.hatch.envs.lint.scripts]
-style = [
- "ruff {args:.}",
- "black --check --diff {args:.}",
- "mdformat --check {args:docs *.md}"
-]
-fmt = [
- "black {args:.}",
- "ruff --fix {args:.}",
- "mdformat {args:docs *.md}"
+build = [
+ "pre-commit run --all-files ruff",
+ "pre-commit run --all-files ruff-format"
]
+[tool.hatch.envs.typing]
+dependencies = [ "pre-commit"]
+detached = true
+[tool.hatch.envs.typing.scripts]
+test = "pre-commit run --all-files --hook-stage manual mypy"
+
[tool.pytest.ini_options]
-addopts = "-raXs --durations 10 --color=yes --doctest-modules"
+minversion = "6.0"
+xfail_strict = true
+log_cli_level = "info"
+addopts = [
+ "-ra", "--durations=10", "--color=yes", "--doctest-modules",
+ "--showlocals", "--strict-markers", "--strict-config",
+]
testpaths = [
"tests/"
]
@@ -121,66 +114,53 @@
"ignore:unclosed <socket.socket:ResourceWarning",
# From juypter core
"module:Jupyter is migrating its paths to use standard
platformdirs:DeprecationWarning",
+ "module:datetime.datetime.utc:DeprecationWarning",
]
+[tool.coverage.run]
+relative_files = true
+source = ["jupyter_server_terminals"]
+
[tool.mypy]
-check_untyped_defs = true
-disallow_any_generics = true
-disallow_incomplete_defs = true
-disallow_untyped_decorators = true
-no_implicit_optional = true
-no_implicit_reexport = true
-pretty = true
-show_error_context = true
-show_error_codes = true
-strict_equality = true
-strict_optional = true
-warn_unused_configs = true
-warn_redundant_casts = true
-warn_return_any = true
-warn_unused_ignores = true
+files = "jupyter_server_terminals"
+python_version = "3.8"
+strict = true
+enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
+warn_unreachable = true
-[tool.black]
-line-length = 100
-skip-string-normalization = true
-target-version = ["py37"]
[tool.ruff]
-target-version = "py37"
line-length = 100
-select = [
- "A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T",
- "UP", "W", "YTT",
+
+[tool.ruff.lint]
+extend-select = [
+ "B", # flake8-bugbear
+ "I", # isort
+ "C4", # flake8-comprehensions
+ "EM", # flake8-errmsg
+ "ICN", # flake8-import-conventions
+ "G", # flake8-logging-format
+ "PGH", # pygrep-hooks
+ "PIE", # flake8-pie
+ "PL", # pylint
+ "PTH", # flake8-use-pathlib
+ "PT", # flake8-pytest-style
+ "RET", # flake8-return
+ "RUF", # Ruff-specific
+ "SIM", # flake8-simplify
+ "T20", # flake8-print
+ "UP", # pyupgrade
+ "YTT", # flake8-2020
+ "EXE", # flake8-executable
+ "PYI", # flake8-pyi
+ "S", # flake8-bandit
]
ignore = [
- # Allow non-abstract empty methods in abstract base classes
- "B027",
- # Ignore McCabe complexity
- "C901",
- # Allow boolean positional values in function calls, like `dict.get(...
True)`
- "FBT003",
- # Use of `assert` detected
- "S101",
- # Line too long
- "E501",
- # Relative imports are banned
- "TID252",
- # Boolean ... in function definition
- "FBT001", "FBT002",
- # Module level import not at top of file
- "E402",
- # A001/A002/A003 .. is shadowing a python builtin
- "A001", "A002", "A003",
- # Possible hardcoded password
- "S105", "S106",
- # Q000 Single quotes found but double quotes preferred
- "Q000",
- # N806 Variable `B` in function should be lowercase
- "N806",
- # T201 `print` found
- "T201",
- # N802 Function name `CreateWellKnownSid` should be lowercase
- "N802", "N803"
+ "PLR", # Design related pylint codes
+ "E501", # Line too long (158 > 100 characters)
+ "SIM105", # Use `contextlib.suppress(...)`
+ "T201", # `print` found
+ "S101", # Use of `assert` detected
]
unfixable = [
# Don't touch print statements
@@ -189,10 +169,12 @@
"RUF100",
]
-[tool.ruff.per-file-ignores]
+[tool.ruff.lint.per-file-ignores]
# B011: Do not call assert False since python -O removes these calls
# F841 local variable 'foo' is assigned to but never used
+# S101 Use of `assert` detected
"tests/*" = ["B011", "F841"]
+"docs/*" = ["PTH"]
[tool.interrogate]
ignore-init-module=true
@@ -203,3 +185,6 @@
ignore-nested-classes=true
fail-under=100
exclude = ["tests", "docs"]
+
+[tool.repo-review]
+ignore = ["GH102"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_server_terminals-0.4.4/tests/test_auth.py
new/jupyter_server_terminals-0.5.0/tests/test_auth.py
--- old/jupyter_server_terminals-0.4.4/tests/test_auth.py 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/tests/test_auth.py 2020-02-02
01:00:00.000000000 +0100
@@ -11,11 +11,10 @@
class AuthorizerforTesting(Authorizer):
-
# Set these class attributes from within a test
# to verify that they match the arguments passed
# by the REST API.
- permissions: Dict[str, str] = {}
+ permissions: Dict[str, str] = {} # noqa: RUF012
def normalize_url(self, path):
"""Drop the base URL and make sure path leads with a /"""
@@ -30,10 +29,7 @@
def is_authorized(self, handler, user, action, resource):
# Parse Request
- if isinstance(handler, WebSocketHandler):
- method = "WEBSOCKET"
- else:
- method = handler.request.method
+ method = "WEBSOCKET" if isinstance(handler, WebSocketHandler) else
handler.request.method
url = self.normalize_url(handler.request.path)
# Map request parts to expected action and resource.
@@ -54,7 +50,7 @@
)
[email protected]
[email protected]()
def jp_server_config():
return Config(
{
@@ -66,15 +62,12 @@
)
[email protected]
[email protected]()
def send_request(jp_fetch, jp_ws_fetch):
"""Send to Jupyter Server and return response code."""
async def _(url, **fetch_kwargs):
- if url.endswith("channels") or "/websocket/" in url:
- fetch = jp_ws_fetch
- else:
- fetch = jp_fetch
+ fetch = jp_ws_fetch if url.endswith("channels") or "/websocket/" in
url else jp_fetch
try:
r = await fetch(url, **fetch_kwargs,
allow_nonstandard_methods=True)
@@ -116,8 +109,8 @@
# -------- Test scenarios -----------
[email protected]("method, url, body", HTTP_REQUESTS_PARAMETRIZED)
[email protected]("allowed", (True, False))
[email protected]("method, url, body", HTTP_REQUESTS_PARAMETRIZED) #
noqa: PT006
[email protected]("allowed", (True, False)) # noqa: PT007
async def test_authorized_requests(
request,
io_loop,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_server_terminals-0.4.4/tests/test_terminal.py
new/jupyter_server_terminals-0.5.0/tests/test_terminal.py
--- old/jupyter_server_terminals-0.4.4/tests/test_terminal.py 2020-02-02
01:00:00.000000000 +0100
+++ new/jupyter_server_terminals-0.5.0/tests/test_terminal.py 2020-02-02
01:00:00.000000000 +0100
@@ -3,13 +3,14 @@
import os
import shutil
import sys
+from pathlib import Path
import pytest
from tornado.httpclient import HTTPClientError
from traitlets.config.loader import Config
[email protected]
[email protected]()
def terminal_path(tmp_path):
subdir = tmp_path.joinpath("terminal_path")
subdir.mkdir()
@@ -19,7 +20,7 @@
shutil.rmtree(str(subdir), ignore_errors=True)
[email protected]
[email protected]()
def terminal_root_dir(jp_root_dir):
subdir = jp_root_dir.joinpath("terminal_path")
subdir.mkdir()
@@ -33,7 +34,7 @@
CULL_INTERVAL = 3
[email protected]
[email protected]()
def jp_server_config():
return Config(
{
@@ -148,7 +149,7 @@
ws.close()
- assert os.path.basename(terminal_path) in message_stdout
+ assert Path(terminal_path).name in message_stdout
async def test_terminal_create_with_relative_cwd(
@@ -195,7 +196,7 @@
async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch):
- non_existing_path = "/tmp/path/to/nowhere"
+ non_existing_path = "/tmp/path/to/nowhere" # noqa: S108
resp = await jp_fetch(
"api",
"terminals",
@@ -268,7 +269,7 @@
allow_nonstandard_methods=True,
)
except HTTPClientError as e:
- assert e.code == 404
+ assert e.code == 404 # noqa: PT017
culled = True
break
else: