Skip to content

Commit 1d6ea50

Browse files
authored
Upgrade packaging (#178)
1 parent 8bcdf52 commit 1d6ea50

File tree

8 files changed

+118
-154
lines changed

8 files changed

+118
-154
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defaults:
77
shell: bash -l {0}
88

99
jobs:
10-
linux:
10+
test:
1111
name: ${{ matrix.PLATFORM }} py${{ matrix.PYTHON_VERSION }}
1212
runs-on: ${{ matrix.PLATFORM }}-latest
1313
env:
@@ -59,6 +59,12 @@ jobs:
5959
# See `setup.cfg` for full test options
6060
run: |
6161
pytest --pyargs jupyterlab_server
62+
- name: Check manifest
63+
run: |
64+
set -eux
65+
pip install check-manifest
66+
git clean -dfx
67+
check-manifest -v
6268
- name: Upload coverage
6369
run: |
6470
codecov
@@ -67,7 +73,8 @@ jobs:
6773
run: |
6874
set -eux
6975
pip uninstall -y jupyterlab_server
70-
python setup.py sdist
76+
pip install build
77+
python -m build --sdist .
7178
cd dist
7279
pip install *.tar.gz
7380
pytest --pyargs jupyterlab_server
@@ -81,3 +88,9 @@ jobs:
8188
make html
8289
conda deactivate
8390
popd
91+
- name: Check Version Bump
92+
run: |
93+
set -eux
94+
pip install tbump
95+
tbump --non-interactive --only-patch 100.1.1
96+
git checkout .

MANIFEST.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
include README.md
1+
include *.md
22
include LICENSE
3-
include setupbase.py
43
include jupyterlab_server/rest-api.yml
54
include jupyterlab_server/templates/*.html
65
recursive-include jupyterlab_server/tests *.json *.json.orig *.jupyterlab-workspace
6+
recursive-include docs *.*
7+
include docs/Makefile
8+
9+
prune docs/build
710

811
# prune translation test data to avoid long path limits on Windows
912
prune jupyterlab_server/tests/translations

RELEASE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Making a JupyterLab Server Release
2+
To create a release, perform the following steps...
3+
4+
## Set up
5+
```
6+
pip install tbump twine build
7+
git pull origin $(git branch --show-current)
8+
git clean -dffx
9+
```
10+
11+
## Update the version and apply the tag
12+
```
13+
echo "Enter new version"
14+
read script_version
15+
tbump ${script_version}
16+
```
17+
18+
## Build the artifacts
19+
```
20+
rm -rf dist
21+
python -m build .
22+
```
23+
24+
## Publish the artifacts to pypi
25+
```
26+
twine check dist/*
27+
twine upload dist/*
28+
```

jupyterlab_server/_version.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
version_info = (2, 4, 0)
2-
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(map(str, version_info[3:]))
1+
from jupyter_packaging import get_version_info
2+
__version__ = '2.4.0'
3+
version_info = get_version_info(__version__)

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[build-system]
2+
requires = ["jupyter_packaging~=0.9", "jupyter_server"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.check-manifest]
6+
ignore = ["tbump.toml", ".*", "*.yml", "docs/source/api/app-config.rst", "docs/source/changelog.md"]
7+
ignore-bad-ideas = ["jupyterlab_server/tests/translations/**/*.mo"]
8+
9+
[tool.tbump.version]
10+
current = "2.4.0"
11+
regex = '''
12+
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
13+
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?
14+
'''
15+
16+
[tool.tbump.git]
17+
message_template = "Bump to {new_version}"
18+
tag_template = "v{new_version}"
19+
20+
[[tool.tbump.file]]
21+
src = "jupyterlab_server/_version.py"
22+
23+
[tool.pytest.ini_options]
24+
addopts = "--color=yes -s --tb=long -svv --cov jupyterlab_server --cov-report term-missing --cov-report term:skip-covered"
25+
filterwarnings = ["ignore::DeprecationWarning:notebook", "ignore::DeprecationWarning:traitlets"]

setup.cfg

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,44 @@
11
[metadata]
2+
name = jupyterlab_server
3+
version = attr: jupyterlab_server._version.__version__
4+
description = A set of server components for JupyterLab and JupyterLab like applications .
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
27
license_file = LICENSE
8+
author = Jupyter Development Team
9+
author_email = [email protected]
10+
url = https://jupyter.org
11+
platforms = Linux, Mac OS X, Windows
12+
keywords = jupyter, jupyterlab
13+
classifiers =
14+
Intended Audience :: Developers
15+
Intended Audience :: System Administrators
16+
Intended Audience :: Science/Research
17+
License :: OSI Approved :: BSD License
18+
Programming Language :: Python
19+
Programming Language :: Python :: 3.6
20+
Programming Language :: Python :: 3.7
21+
Programming Language :: Python :: 3.8
22+
Programming Language :: Python :: 3.9
323

4-
[tool:pytest]
5-
addopts =
6-
--color=yes
7-
-s
8-
--tb=long
9-
-svv
10-
--cov jupyterlab_server
11-
--cov-report term-missing
12-
--cov-report term:skip-covered
24+
[options]
25+
zip_safe = False
26+
include_package_data = True
27+
packages = find:
28+
python_requires = >=3.6
29+
install_requires =
30+
babel
31+
jinja2>=2.10
32+
json5
33+
jsonschema>=3.0.1
34+
jupyter_packaging~=0.9,<2
35+
packaging
36+
requests
37+
jupyter_server~=1.4
1338

14-
filterwarnings =
15-
ignore::DeprecationWarning:notebook
16-
ignore::DeprecationWarning:traitlets
39+
40+
[options.extras_require]
41+
test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel
42+
43+
[options.packages.find]
44+
exclude = ['docs*']

setup.py

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,2 @@
1-
#!/usr/bin/env python
2-
# coding: utf-8
3-
4-
# Copyright (c) Jupyter Development Team.
5-
# Distributed under the terms of the Modified BSD License.
6-
7-
from setupbase import create_cmdclass, __version__
8-
from setuptools import find_packages, setup
9-
import sys
10-
11-
12-
setup_args = dict(
13-
name='jupyterlab_server',
14-
version=__version__,
15-
packages=find_packages('.'),
16-
description='JupyterLab Server',
17-
long_description=open('./README.md').read(),
18-
long_description_content_type='text/markdown',
19-
author='Jupyter Development Team',
20-
author_email='[email protected]',
21-
url='https://jupyter.org',
22-
license='BSD',
23-
platforms='Linux, Mac OS X, Windows',
24-
keywords=['Jupyter', 'JupyterLab'],
25-
cmdclass=create_cmdclass(),
26-
classifiers=[
27-
'Intended Audience :: Developers',
28-
'Intended Audience :: System Administrators',
29-
'Intended Audience :: Science/Research',
30-
'License :: OSI Approved :: BSD License',
31-
'Programming Language :: Python',
32-
'Programming Language :: Python :: 3',
33-
'Programming Language :: Python :: 3.6',
34-
'Programming Language :: Python :: 3.7',
35-
'Programming Language :: Python :: 3.8',
36-
],
37-
include_package_data=True
38-
)
39-
40-
if 'setuptools' in sys.modules:
41-
setup_args['python_requires'] = '>=3.6'
42-
setup_args['extras_require'] = {
43-
'test': [
44-
'codecov',
45-
'ipykernel',
46-
'pytest>=5.3.2',
47-
'pytest-cov',
48-
'jupyter_server[test]',
49-
'openapi_core',
50-
'pytest-console-scripts',
51-
'strict-rfc3339',
52-
'ruamel.yaml',
53-
'wheel',
54-
],
55-
}
56-
setup_args['install_requires'] = [
57-
'babel',
58-
'jinja2>=2.10',
59-
'json5',
60-
'jsonschema>=3.0.1',
61-
'packaging',
62-
'requests',
63-
'jupyter_server~=1.4',
64-
]
65-
66-
if __name__ == '__main__':
67-
setup(**setup_args)
1+
from setuptools import setup
2+
setup()

setupbase.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)