Skip to content

Commit df304db

Browse files
committed
jupyterlab_widgets using setup.cfg
1 parent 23c83e3 commit df304db

File tree

4 files changed

+50
-61
lines changed

4 files changed

+50
-61
lines changed

docs/source/dev_release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Lerna will prompt you for version numbers for each of the changed npm packages i
5959

6060
Go into the `jupyterlab_widgets` directory. Change `jupyterlab_widgets/_version.py` to reflect the new version number.
6161
```
62-
python setup.py sdist bdist_wheel
63-
twine check dist/*
62+
pip install build
63+
python -m build
6464
twine upload dist/*
6565
```
6666

jupyterlab_widgets/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ global-exclude *~
1919
global-exclude *.pyc
2020
global-exclude *.pyo
2121
global-exclude .git
22+
global-exclude .gitignore
2223
global-exclude .ipynb_checkpoints

jupyterlab_widgets/setup.cfg

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[metadata]
2+
name = jupyterlab_widgets
3+
version = attr: jupyterlab_widgets._version.__version__
4+
author = Jupyter Development Team
5+
author_email = [email protected]
6+
url = https://github.com/jupyter-widgets/ipywidgets
7+
description = Jupyter interactive widgets for JupyterLab
8+
long_description = file: README.md
9+
long_description_content_type = text/markdown
10+
license_file = LICENSE
11+
license = BSD-3-Clause
12+
platforms = Linux, Mac OS X, Windows
13+
keywords = Interactive, Interpreter, Shell, Web, notebook, widgets, Jupyter, JupyterLab, JupyterLab3
14+
classifiers =
15+
Intended Audience :: Developers
16+
Intended Audience :: System Administrators
17+
Intended Audience :: Science/Research
18+
License :: OSI Approved :: BSD License
19+
Programming Language :: Python
20+
Programming Language :: Python :: 3
21+
Programming Language :: Python :: 3.6
22+
Programming Language :: Python :: 3.7
23+
Programming Language :: Python :: 3.8
24+
Programming Language :: Python :: 3.9
25+
Programming Language :: Python :: 3 :: Only
26+
Framework :: Jupyter
27+
28+
[options]
29+
python_requires = >=3.6
30+
zip_safe=False
31+
include_package_data = True
32+
packages = find:

jupyterlab_widgets/setup.py

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,33 @@
1+
# Copyright (c) Jupyter Development Team.
2+
# Distributed under the terms of the Modified BSD License.
3+
14
"""
25
jupyterlab_widgets setup
36
"""
4-
import os
5-
67
from jupyter_packaging import (
78
create_cmdclass, install_npm, ensure_targets,
89
combine_commands, ensure_python, get_version,
910
skip_if_exists
1011
)
11-
import setuptools
12+
from pathlib import Path
13+
from setuptools import setup
1214

13-
HERE = os.path.abspath(os.path.dirname(__file__))
15+
HERE = Path(__file__).parent.resolve()
16+
IS_REPO = (HERE.parent / '.git').exists()
17+
LAB_PATH = HERE / "jupyterlab_widgets" / "labextension"
1418

1519
# The name of the project
1620
name = "jupyterlab_widgets"
17-
18-
# Ensure a valid python version
19-
ensure_python(">=3.6")
20-
21-
# Get our version
22-
version = get_version(os.path.join(name, "_version.py"))
23-
24-
lab_path = os.path.join(HERE, name, "labextension")
21+
labext_name = "@jupyter-widgets/jupyterlab-manager"
2522

2623
# Representative files that should exist after a successful build
27-
jstargets = [
28-
os.path.join(lab_path, "package.json"),
29-
]
24+
jstargets = [LAB_PATH / "package.json"]
3025

31-
package_data_spec = {
32-
name: [
33-
"*"
34-
]
35-
}
36-
37-
labext_name = "@jupyter-widgets/jupyterlab-manager"
26+
package_data_spec = {name: ["*"]}
3827

3928
data_files_spec = [
40-
("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"),
41-
("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),
29+
(f"share/jupyter/labextensions/{labext_name}", LAB_PATH, "**"),
30+
(f"share/jupyter/labextensions/{labext_name}", HERE, "install.json"),
4231
]
4332

4433
cmdclass = create_cmdclass(
@@ -55,43 +44,10 @@
5544
ensure_targets(jstargets),
5645
)
5746

58-
is_repo = os.path.exists(os.path.join(HERE, os.pardir, ".git"))
59-
if is_repo:
47+
if IS_REPO:
6048
cmdclass["jsdeps"] = js_command
6149
else:
6250
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)
6351

64-
with open("README.md", "r") as fh:
65-
long_description = fh.read()
66-
67-
setup_args = dict(
68-
name=name,
69-
version=version,
70-
url="https://github.com/jupyter-widgets/ipywidgets",
71-
author="Jupyter Development Team",
72-
description="A JupyterLab extension.",
73-
long_description= long_description,
74-
long_description_content_type="text/markdown",
75-
cmdclass=cmdclass,
76-
packages=setuptools.find_packages(),
77-
install_requires=[],
78-
zip_safe=False,
79-
include_package_data=True,
80-
python_requires=">=3.6",
81-
license="BSD-3-Clause",
82-
platforms="Linux, Mac OS X, Windows",
83-
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
84-
classifiers=[
85-
"License :: OSI Approved :: BSD License",
86-
"Programming Language :: Python",
87-
"Programming Language :: Python :: 3",
88-
"Programming Language :: Python :: 3.6",
89-
"Programming Language :: Python :: 3.7",
90-
"Programming Language :: Python :: 3.8",
91-
"Framework :: Jupyter",
92-
],
93-
)
94-
95-
9652
if __name__ == "__main__":
97-
setuptools.setup(**setup_args)
53+
setup(cmdclass=cmdclass)

0 commit comments

Comments
 (0)