-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: migrate to pyproject.toml based build process
- Loading branch information
1 parent
5c8af3b
commit 9592340
Showing
8 changed files
with
97 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
*.egg-info | ||
bqplot_image_gl/static | ||
bqplot_image_gl/labextension | ||
bqplot_image_gl/nbextension | ||
dist | ||
node_modules | ||
.tox | ||
.ipynb_checkpoints | ||
.tmp | ||
__pycache__ | ||
share |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,85 @@ | ||
[build-system] | ||
requires = ["jupyter_packaging>=0.10.6", | ||
"jupyterlab>=3.6", | ||
"setuptools>=40.8.0", | ||
"wheel"] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"jupyterlab>=3.6", | ||
"hatchling", | ||
] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "bqplot-image-gl" | ||
dynamic = ["version"] | ||
description = "An ipywidget image widget for astronomical purposes" | ||
readme = "README.md" | ||
authors = [ | ||
{name = "Maarten A. Breddels", email = "[email protected]"}, | ||
] | ||
requires-python = ">=3.7" | ||
keywords = ["ipython", "jupyter", "widgets"] | ||
license = {text = "MIT"} # Add appropriate license | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Framework :: IPython", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Multimedia :: Graphics", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Programming Language :: Python :: 3.13', | ||
] | ||
dependencies = [ | ||
"ipywidgets>=7.0.0", | ||
"bqplot>=0.12", | ||
"pillow" | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/glue-viz/bqplot-image-gl" | ||
|
||
[tool.hatch.version] | ||
path = "bqplot_image_gl/_version.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
".github", | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
include = [ | ||
"bqplot_image_gl", | ||
"etc", | ||
"js", | ||
] | ||
|
||
[tool.hatch.build] | ||
artifacts = [ | ||
"bqplot_image_gl/nbextension", | ||
"bqplot_image_gl/labextension", | ||
] | ||
|
||
[tool.hatch.build.targets.wheel.shared-data] | ||
"bqplot_image_gl/nbextension" = "share/jupyter/nbextensions/bqplot-image-gl" | ||
"bqplot_image_gl/labextension" = "share/jupyter/labextensions/bqplot-image-gl" | ||
"./bqplot-image-gl.json" = "etc/jupyter/nbconfig/notebook.d/bqplot-image-gl.json" | ||
|
||
[tool.hatch.build.hooks.jupyter-builder] | ||
build-function = "hatch_jupyter_builder.npm_builder" | ||
ensured-targets = [ | ||
"bqplot_image_gl/nbextension/index.js", | ||
"bqplot_image_gl/labextension/package.json", | ||
] | ||
skip-if-exists = [ | ||
"bqplot_image_gl/nbextension/index.js", | ||
"bqplot_image_gl/labextension/package.json", | ||
] | ||
dependencies = [ | ||
"hatch-jupyter-builder>=0.5.0", | ||
] | ||
|
||
[tool.hatch.build.hooks.jupyter-builder.build-kwargs] | ||
path = "./js" | ||
build_cmd = "build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,2 @@ | ||
from __future__ import print_function | ||
from os.path import join as pjoin | ||
from setuptools import setup, find_packages, Command | ||
import os | ||
|
||
from jupyter_packaging import ( | ||
create_cmdclass, | ||
install_npm, | ||
ensure_targets, | ||
combine_commands, | ||
get_version, | ||
skip_if_exists, | ||
) | ||
|
||
LONG_DESCRIPTION = 'An ipywidget image widget for astronomical purposes' | ||
here = os.path.dirname(os.path.abspath(__file__)) | ||
name = 'bqplot-image-gl' | ||
package_name = name.replace('-', '_') | ||
version = get_version(pjoin(package_name, '_version.py')) | ||
|
||
js_dir = pjoin(here, 'js') | ||
|
||
# Representative files that should exist after a successful build | ||
jstargets = [ | ||
pjoin('share', 'jupyter', 'nbextensions', f'{name}', 'index.js'), | ||
# pjoin('share', 'jupyter', 'labextensions', f'{name}', 'package.json'), | ||
] | ||
|
||
data_files_spec = [ | ||
(f'share/jupyter/nbextensions/{name}', f'share/jupyter/nbextensions/{name}', '*.js'), | ||
(f'share/jupyter/labextensions/{name}/', f'share/jupyter/labextensions/{name}/', '**'), | ||
(f'etc/jupyter/nbconfig/notebook.d', f'etc/jupyter/nbconfig/notebook.d', f'{name}.json'), | ||
] | ||
|
||
js_command = combine_commands( | ||
install_npm(js_dir, build_dir='share/jupyter/', source_dir='js/src', build_cmd='build'), ensure_targets(jstargets), | ||
) | ||
|
||
cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec) | ||
is_repo = os.path.exists(os.path.join(here, '.git')) | ||
if is_repo: | ||
cmdclass['jsdeps'] = js_command | ||
else: | ||
cmdclass['jsdeps'] = skip_if_exists(jstargets, js_command) | ||
|
||
setup( | ||
name=name, | ||
version=version, | ||
description='An ipywidget image widget for astronomical purposes', | ||
long_description=LONG_DESCRIPTION, | ||
include_package_data=True, | ||
install_requires=[ | ||
'ipywidgets>=7.0.0', | ||
'bqplot>=0.12', | ||
'pillow', | ||
], | ||
packages=find_packages(), | ||
zip_safe=False, | ||
cmdclass=cmdclass, | ||
author='Maarten A. Breddels', | ||
author_email='[email protected]', | ||
url='https://github.com/glue-viz/bqplot-image-gl', | ||
keywords=[ | ||
'ipython', | ||
'jupyter', | ||
'widgets', | ||
], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Framework :: IPython', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Science/Research', | ||
'Topic :: Multimedia :: Graphics', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Programming Language :: Python :: 3.13', | ||
], | ||
) | ||
# setup.py shim for use with applications that require it. | ||
__import__("setuptools").setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters