Skip to content

Commit e15dd9b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into telemetry_client
2 parents c67401d + 678878f commit e15dd9b

File tree

14 files changed

+236
-485
lines changed

14 files changed

+236
-485
lines changed

.github/workflows/check-release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["master"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Install Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.9
18+
architecture: "x64"
19+
- name: Get pip cache dir
20+
id: pip-cache
21+
run: |
22+
echo "::set-output name=dir::$(pip cache dir)"
23+
- name: Cache pip
24+
uses: actions/cache@v2
25+
with:
26+
path: ${{ steps.pip-cache.outputs.dir }}
27+
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-
30+
${{ runner.os }}-pip-
31+
- name: Cache checked links
32+
uses: actions/cache@v2
33+
with:
34+
path: ~/.cache/pytest-link-check
35+
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
36+
restore-keys: |
37+
${{ runner.os }}-linkcheck-
38+
- name: Upgrade packaging dependencies
39+
run: |
40+
pip install --upgrade pip setuptools wheel --user
41+
- name: Install Dependencies
42+
run: |
43+
pip install -e .
44+
- name: Check Release
45+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python-linux.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,3 @@ jobs:
7474
pushd test_install
7575
./bin/pytest --pyargs jupyter_server
7676
popd
77-
- name: Check the Manifest
78-
run: |
79-
pip install check-manifest
80-
git clean -dfx
81-
check-manifest -v
82-
- name: Check Version Bump
83-
run: |
84-
pip install tbump
85-
tbump --non-interactive --only-patch 100.1.1
86-
git checkout .

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,38 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
<!-- <START NEW CHANGELOG ENTRY> -->
6+
7+
## 1.7.0a0
8+
9+
([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v1.6.4...afae85a7bb8c45f7610cd38b60d6075bb623490b))
10+
11+
### Bugs fixed
12+
13+
- Fix for recursive symlink - (port Notebook 4670) [#497](https://github.com/jupyter-server/jupyter_server/pull/497) ([@kevin-bates](https://github.com/kevin-bates))
14+
15+
### Maintenance and upkeep improvements
16+
17+
- Prep for Release Helper Usage [#494](https://github.com/jupyter-server/jupyter_server/pull/494) ([@jtpio](https://github.com/jtpio))
18+
- Typo in shutdown with answer_yes [#491](https://github.com/jupyter-server/jupyter_server/pull/491) ([@kiendang](https://github.com/kiendang))
19+
- Remove some of ipython_genutils no-op. [#440](https://github.com/jupyter-server/jupyter_server/pull/440) ([@Carreau](https://github.com/Carreau))
20+
21+
### Documentation improvements
22+
23+
- DOC: Autoreformat docstrings. [#493](https://github.com/jupyter-server/jupyter_server/pull/493) ([@Carreau](https://github.com/Carreau))
24+
25+
### Other merged PRs
26+
27+
- Add Appropriate Token Permission for CodeQL Workflow [#489](https://github.com/jupyter-server/jupyter_server/pull/489) ([@afshin](https://github.com/afshin))
28+
29+
### Contributors to this release
30+
31+
([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_server/graphs/contributors?from=2021-04-21&to=2021-05-01&type=c))
32+
33+
[@afshin](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Aafshin+updated%3A2021-04-21..2021-05-01&type=Issues) | [@blink1073](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Ablink1073+updated%3A2021-04-21..2021-05-01&type=Issues) | [@Carreau](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3ACarreau+updated%3A2021-04-21..2021-05-01&type=Issues) | [@codecov-commenter](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Acodecov-commenter+updated%3A2021-04-21..2021-05-01&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Ajtpio+updated%3A2021-04-21..2021-05-01&type=Issues) | [@kevin-bates](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Akevin-bates+updated%3A2021-04-21..2021-05-01&type=Issues) | [@kiendang](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Akiendang+updated%3A2021-04-21..2021-05-01&type=Issues)
34+
35+
<!-- <END NEW CHANGELOG ENTRY> -->
36+
537
## 1.6.4
638

739
([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v1.6.3...68a64ea13be5d0d86460f04e0c47eb0b6662a0af))
@@ -31,7 +63,6 @@ All notable changes to this project will be documented in this file.
3163

3264
[@kevin-bates](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Akevin-bates+updated%3A2021-04-16..2021-04-21&type=Issues)
3365

34-
3566
## 1.6.2
3667

3768
### Enhancements made

MANIFEST.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ prune docs/dist
2828
global-exclude *~
2929
global-exclude *.pyc
3030
global-exclude *.pyo
31-
global-exclude .git
32-
global-exclude .ipynb_checkpoints
33-
global-exclude .pytest_cache
34-
global-exclude .coverage
31+
prune .git
32+
prune **/.ipynb_checkpoints
33+
prune **/.pytest_cache
34+
prune **/.coverage
35+
prune **/.pytest_cache

RELEASE.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
11
# Making a Jupyter Server Release
2-
To create a release, perform the following steps...
32

4-
## Set up
5-
```
3+
## Using `jupyter_releaser`
4+
5+
The recommended way to make a release is to use [`jupyter_releaser`](https://github.com/jupyter-server/jupyter_releaser#checklist-for-adoption).
6+
7+
## Manual Release
8+
9+
To create a manual release, perform the following steps:
10+
11+
### Set up
12+
13+
```bash
614
pip install tbump twine build
715
git pull origin $(git branch --show-current)
816
git clean -dffx
917
```
1018

11-
## Update the version and apply the tag
12-
```
19+
### Update the version and apply the tag
20+
21+
```bash
1322
echo "Enter new version"
1423
read script_version
1524
tbump ${script_version}
1625
```
1726

18-
## Build the artifacts
19-
```
27+
### Build the artifacts
28+
29+
```bash
2030
rm -rf dist
2131
python -m build .
2232
```
2333

24-
## Update the version back to dev
25-
```
34+
### Update the version back to dev
35+
36+
```bash
2637
echo "Enter dev version"
2738
read dev_version
2839
tbump ${dev_version} --no-tag
2940
git push origin $(git branch --show-current)
3041
```
3142

32-
## Publish the artifacts to pypi
33-
```
43+
### Publish the artifacts to pypi
44+
45+
```bash
3446
twine check dist/*
3547
twine upload dist/*
3648
```

jupyter_server/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
from jupyter_packaging import get_version_info
66

77
# Version string must appear intact for tbump versioning
8-
__version__ = '1.7.0.dev0'
8+
__version__ = '1.8.0.dev0'
99
version_info = get_version_info(__version__)

jupyter_server/services/contents/filecheckpoints.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
)
1515
from .fileio import AsyncFileManagerMixin, FileManagerMixin
1616

17-
from anyio import run_sync_in_worker_thread
17+
try:
18+
from anyio.to_thread import run_sync
19+
except ImportError:
20+
# fallback on anyio v2 for python version < 3.7
21+
from anyio import run_sync_in_worker_thread as run_sync
22+
1823
from jupyter_core.utils import ensure_dir_exists
1924
from traitlets import Unicode
2025

@@ -156,7 +161,7 @@ async def restore_checkpoint(self, contents_mgr, checkpoint_id, path):
156161

157162
async def checkpoint_model(self, checkpoint_id, os_path):
158163
"""construct the info dict for a given checkpoint"""
159-
stats = await run_sync_in_worker_thread(os.stat, os_path)
164+
stats = await run_sync(os.stat, os_path)
160165
last_modified = tz.utcfromtimestamp(stats.st_mtime)
161166
info = dict(
162167
id=checkpoint_id,
@@ -176,7 +181,7 @@ async def rename_checkpoint(self, checkpoint_id, old_path, new_path):
176181
new_cp_path,
177182
)
178183
with self.perm_to_403():
179-
await run_sync_in_worker_thread(shutil.move, old_cp_path, new_cp_path)
184+
await run_sync(shutil.move, old_cp_path, new_cp_path)
180185

181186
async def delete_checkpoint(self, checkpoint_id, path):
182187
"""delete a file's checkpoint"""
@@ -187,7 +192,7 @@ async def delete_checkpoint(self, checkpoint_id, path):
187192

188193
self.log.debug("unlinking %s", cp_path)
189194
with self.perm_to_403():
190-
await run_sync_in_worker_thread(os.unlink, cp_path)
195+
await run_sync(os.unlink, cp_path)
191196

192197
async def list_checkpoints(self, path):
193198
"""list the checkpoints for a given file

jupyter_server/services/contents/fileio.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
import os
1313
import shutil
1414

15-
from anyio import run_sync_in_worker_thread
15+
try:
16+
from anyio.to_thread import run_sync
17+
except ImportError:
18+
# fallback on anyio v2 for python version < 3.7
19+
from anyio import run_sync_in_worker_thread as run_sync
20+
1621
from tornado.web import HTTPError
1722

1823
from jupyter_server.utils import (
@@ -36,7 +41,7 @@ def replace_file(src, dst):
3641
async def async_replace_file(src, dst):
3742
""" replace dst with src asynchronously
3843
"""
39-
await run_sync_in_worker_thread(os.replace, src, dst)
44+
await run_sync(os.replace, src, dst)
4045

4146
def copy2_safe(src, dst, log=None):
4247
"""copy src to dst
@@ -55,9 +60,9 @@ async def async_copy2_safe(src, dst, log=None):
5560
5661
like shutil.copy2, but log errors in copystat instead of raising
5762
"""
58-
await run_sync_in_worker_thread(shutil.copyfile, src, dst)
63+
await run_sync(shutil.copyfile, src, dst)
5964
try:
60-
await run_sync_in_worker_thread(shutil.copystat, src, dst)
65+
await run_sync(shutil.copystat, src, dst)
6166
except OSError:
6267
if log:
6368
log.debug("copystat on %s failed", dst, exc_info=True)
@@ -355,7 +360,7 @@ async def _read_notebook(self, os_path, as_version=4):
355360
"""Read a notebook from an os path."""
356361
with self.open(os_path, 'r', encoding='utf-8') as f:
357362
try:
358-
return await run_sync_in_worker_thread(partial(nbformat.read, as_version=as_version), f)
363+
return await run_sync(partial(nbformat.read, as_version=as_version), f)
359364
except Exception as e:
360365
e_orig = e
361366

@@ -379,7 +384,7 @@ async def _read_notebook(self, os_path, as_version=4):
379384
async def _save_notebook(self, os_path, nb):
380385
"""Save a notebook to an os_path."""
381386
with self.atomic_writing(os_path, encoding='utf-8') as f:
382-
await run_sync_in_worker_thread(partial(nbformat.write, version=nbformat.NO_CONVERT), nb, f)
387+
await run_sync(partial(nbformat.write, version=nbformat.NO_CONVERT), nb, f)
383388

384389
async def _read_file(self, os_path, format):
385390
"""Read a non-notebook file.
@@ -394,7 +399,7 @@ async def _read_file(self, os_path, format):
394399
raise HTTPError(400, "Cannot read non-file %s" % os_path)
395400

396401
with self.open(os_path, 'rb') as f:
397-
bcontent = await run_sync_in_worker_thread(f.read)
402+
bcontent = await run_sync(f.read)
398403

399404
if format is None or format == 'text':
400405
# Try to interpret as unicode if format is unknown or if unicode
@@ -429,4 +434,4 @@ async def _save_file(self, os_path, content, format):
429434
) from e
430435

431436
with self.atomic_writing(os_path, text=False) as f:
432-
await run_sync_in_worker_thread(f.write, bcontent)
437+
await run_sync(f.write, bcontent)

0 commit comments

Comments
 (0)