Skip to content

Commit 4263852

Browse files
authored
Clean up pyproject and ci (#306)
1 parent d0e2334 commit 4263852

File tree

6 files changed

+23
-39
lines changed

6 files changed

+23
-39
lines changed

.github/workflows/tests.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ jobs:
9393
9494
check_release:
9595
runs-on: ubuntu-latest
96-
strategy:
97-
matrix:
98-
group: [check_release, link_check]
9996
steps:
10097
- name: Checkout
10198
uses: actions/checkout@v2
@@ -105,13 +102,9 @@ jobs:
105102
run: |
106103
pip install -e .
107104
- name: Check Release
108-
if: ${{ matrix.group == 'check_release' }}
109105
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
110106
with:
111107
token: ${{ secrets.GITHUB_TOKEN }}
112-
- name: Run Link Check
113-
if: ${{ matrix.group == 'link_check' }}
114-
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1
115108

116109
test_miniumum_verisons:
117110
name: Test Minimum Versions
@@ -188,3 +181,11 @@ jobs:
188181
python -m pytest -vv -raXs || python -m pytest -vv -raXs --lf
189182
# Ensure that the pytest plugin is importable.
190183
python -c "from jupyterlab_server import pytest_plugin"
184+
185+
check_links:
186+
runs-on: ubuntu-latest
187+
timeout-minutes: 10
188+
steps:
189+
- uses: actions/checkout@v2
190+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
191+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ repos:
5252
hooks:
5353
- id: flake8
5454
additional_dependencies:
55-
[
56-
"flake8-bugbear==20.1.4",
57-
"flake8-logging-format==0.6.0",
58-
"flake8-implicit-str-concat==0.2.0",
59-
]
55+
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
6056
stages: [manual]
6157

6258
- repo: https://github.com/sirosen/check-jsonschema

RELEASE.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The recommended way to make a release is to use [`jupyter_releaser`](https://git
99
### Set up
1010

1111
```
12-
pip install tbump twine build
12+
pip install pipx
1313
git pull origin $(git branch --show-current)
1414
git clean -dffx
1515
```
@@ -19,19 +19,20 @@ git clean -dffx
1919
```
2020
echo "Enter new version"
2121
read script_version
22-
tbump ${script_version}
22+
pipx run hatch version ${script_version}
23+
git tag -a ${script_version} -m ${script_version}
2324
```
2425

2526
### Build the artifacts
2627

2728
```
2829
rm -rf dist
29-
python -m build .
30+
pipx run build .
3031
```
3132

3233
### Publish the artifacts to pypi
3334

3435
```
35-
twine check dist/*
36-
twine upload dist/*
36+
pipx run twine check dist/*
37+
pipx run twine upload dist/*
3738
```

jupyterlab_server/handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def is_url(url):
6363
class LabHandler(ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterHandler):
6464
"""Render the JupyterLab View."""
6565

66-
@lru_cache()
66+
@lru_cache() # noqa
6767
def get_page_config(self):
6868
"""Construct the page config object"""
6969
self.application.store_id = getattr(self.application, "store_id", 0)
@@ -160,7 +160,7 @@ def get(self, mode=None, workspace=None, tree=None):
160160

161161

162162
class NotFoundHandler(LabHandler):
163-
@lru_cache()
163+
@lru_cache() # noqa
164164
def get_page_config(self):
165165
page_config = super().get_page_config()
166166
page_config["notFoundUrl"] = self.request.path

jupyterlab_server/workspaces_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _load_with_file_times(workspace_path: Path) -> dict:
6363
return workspace
6464

6565

66-
def slugify(raw, base="", sign=True, max_length=128 - len(WORKSPACE_EXTENSION)):
66+
def slugify(raw, base="", sign=True, max_length=128 - len(WORKSPACE_EXTENSION)): # noqa
6767
"""
6868
Use the common superset of raw and base values to build a slug shorter
6969
than max_length. By default, base value is an empty string.

pyproject.toml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["hatchling>=0.25"]
2+
requires = ["hatchling>=1.5"]
33
build-backend = "hatchling.build"
44

55
[project]
66
name = "jupyterlab_server"
7-
version = "2.16.0rc0"
7+
dynamic = ["version"]
88
license = { file = "LICENSE" }
99
description = "A set of server components for JupyterLab and JupyterLab like applications."
1010
keywords = ["jupyter", "jupyterlab"]
@@ -67,26 +67,12 @@ test = [
6767
"strict-rfc3339"
6868
]
6969

70+
[tool.hatch.version]
71+
path = "jupyterlab_server/_version.py"
72+
7073
[tool.jupyter-releaser]
7174
skip = ["check-links"]
7275

73-
[tool.tbump.version]
74-
current = "2.16.0rc0"
75-
regex = '''
76-
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
77-
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?
78-
'''
79-
80-
[tool.tbump.git]
81-
message_template = "Bump to {new_version}"
82-
tag_template = "v{new_version}"
83-
84-
[[tool.tbump.file]]
85-
src = "jupyterlab_server/_version.py"
86-
87-
[[tool.tbump.file]]
88-
src = "pyproject.toml"
89-
9076
[tool.pytest.ini_options]
9177
addopts = "-raXs --durations 10 --color=yes --doctest-modules"
9278
testpaths = [

0 commit comments

Comments
 (0)