Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade packaging #178

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defaults:
shell: bash -l {0}

jobs:
linux:
test:
name: ${{ matrix.PLATFORM }} py${{ matrix.PYTHON_VERSION }}
runs-on: ${{ matrix.PLATFORM }}-latest
env:
Expand Down Expand Up @@ -59,6 +59,12 @@ jobs:
# See `setup.cfg` for full test options
run: |
pytest --pyargs jupyterlab_server
- name: Check manifest
run: |
set -eux
pip install check-manifest
git clean -dfx
check-manifest -v
- name: Upload coverage
run: |
codecov
Expand All @@ -67,7 +73,8 @@ jobs:
run: |
set -eux
pip uninstall -y jupyterlab_server
python setup.py sdist
pip install build
python -m build --sdist .
cd dist
pip install *.tar.gz
pytest --pyargs jupyterlab_server
Expand All @@ -81,3 +88,9 @@ jobs:
make html
conda deactivate
popd
- name: Check Version Bump
run: |
set -eux
pip install tbump
tbump --non-interactive --only-patch 100.1.1
git checkout .
7 changes: 5 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
include README.md
include *.md
include LICENSE
include setupbase.py
include jupyterlab_server/rest-api.yml
include jupyterlab_server/templates/*.html
recursive-include jupyterlab_server/tests *.json *.json.orig *.jupyterlab-workspace
recursive-include docs *.*
include docs/Makefile

prune docs/build

# prune translation test data to avoid long path limits on Windows
prune jupyterlab_server/tests/translations
Expand Down
28 changes: 28 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Making a JupyterLab Server Release
To create a release, perform the following steps...

## Set up
```
pip install tbump twine build
git pull origin $(git branch --show-current)
git clean -dffx
```

## Update the version and apply the tag
```
echo "Enter new version"
read script_version
tbump ${script_version}
```

## Build the artifacts
```
rm -rf dist
python -m build .
```

## Publish the artifacts to pypi
```
twine check dist/*
twine upload dist/*
```
5 changes: 3 additions & 2 deletions jupyterlab_server/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version_info = (2, 4, 0)
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(map(str, version_info[3:]))
from jupyter_packaging import get_version_info
__version__ = '2.4.0'
version_info = get_version_info(__version__)
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[build-system]
requires = ["jupyter_packaging~=0.9", "jupyter_server"]
build-backend = "setuptools.build_meta"

[tool.check-manifest]
ignore = ["tbump.toml", ".*", "*.yml", "docs/source/api/app-config.rst", "docs/source/changelog.md"]
ignore-bad-ideas = ["jupyterlab_server/tests/translations/**/*.mo"]

[tool.tbump.version]
current = "2.4.0"
regex = '''
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?
'''

[tool.tbump.git]
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"

[[tool.tbump.file]]
src = "jupyterlab_server/_version.py"

[tool.pytest.ini_options]
addopts = "--color=yes -s --tb=long -svv --cov jupyterlab_server --cov-report term-missing --cov-report term:skip-covered"
filterwarnings = ["ignore::DeprecationWarning:notebook", "ignore::DeprecationWarning:traitlets"]
52 changes: 40 additions & 12 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
[metadata]
name = jupyterlab_server
version = attr: jupyterlab_server._version.__version__
description = A set of server components for JupyterLab and JupyterLab like applications .
long_description = file: README.md
long_description_content_type = text/markdown
license_file = LICENSE
author = Jupyter Development Team
author_email = jupyter@googlegroups.com
url = https://jupyter.org
platforms = Linux, Mac OS X, Windows
keywords = jupyter, jupyterlab
classifiers =
Intended Audience :: Developers
Intended Audience :: System Administrators
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Programming Language :: Python
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9

[tool:pytest]
addopts =
--color=yes
-s
--tb=long
-svv
--cov jupyterlab_server
--cov-report term-missing
--cov-report term:skip-covered
[options]
zip_safe = False
include_package_data = True
packages = find:
python_requires = >=3.6
install_requires =
babel
jinja2>=2.10
json5
jsonschema>=3.0.1
jupyter_packaging~=0.9,<2
packaging
requests
jupyter_server~=1.4

filterwarnings =
ignore::DeprecationWarning:notebook
ignore::DeprecationWarning:traitlets

[options.extras_require]
test = codecov; ipykernel; pytest>=5.3.2; pytest-cov; jupyter_server[test]; openapi_core; pytest-console-scripts; strict-rfc3339; ruamel.yaml; wheel

[options.packages.find]
exclude = ['docs*']
69 changes: 2 additions & 67 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,67 +1,2 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

from setupbase import create_cmdclass, __version__
from setuptools import find_packages, setup
import sys


setup_args = dict(
name='jupyterlab_server',
version=__version__,
packages=find_packages('.'),
description='JupyterLab Server',
long_description=open('./README.md').read(),
long_description_content_type='text/markdown',
author='Jupyter Development Team',
author_email='jupyter@googlegroups.com',
url='https://jupyter.org',
license='BSD',
platforms='Linux, Mac OS X, Windows',
keywords=['Jupyter', 'JupyterLab'],
cmdclass=create_cmdclass(),
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
include_package_data=True
)

if 'setuptools' in sys.modules:
setup_args['python_requires'] = '>=3.6'
setup_args['extras_require'] = {
'test': [
'codecov',
'ipykernel',
'pytest>=5.3.2',
'pytest-cov',
'jupyter_server[test]',
'openapi_core',
'pytest-console-scripts',
'strict-rfc3339',
'ruamel.yaml',
'wheel',
],
}
setup_args['install_requires'] = [
'babel',
'jinja2>=2.10',
'json5',
'jsonschema>=3.0.1',
'packaging',
'requests',
'jupyter_server~=1.4',
]

if __name__ == '__main__':
setup(**setup_args)
from setuptools import setup
setup()
69 changes: 0 additions & 69 deletions setupbase.py

This file was deleted.