-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from blink1073/use-hatch
- Loading branch information
Showing
5 changed files
with
86 additions
and
151 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import shutil | ||
import sys | ||
|
||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
|
||
|
||
class CustomHook(BuildHookInterface): | ||
def initialize(self, version, build_data): | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
sys.path.insert(0, here) | ||
from ipykernel.kernelspec import make_ipkernel_cmd, write_kernel_spec | ||
|
||
# When building a standard wheel, the executable specified in the kernelspec is simply 'python'. | ||
if version == "standard": | ||
argv = make_ipkernel_cmd(executable="python") | ||
|
||
# When installing an editable wheel, the full `sys.executable` can be used. | ||
else: | ||
argv = make_ipkernel_cmd() | ||
|
||
dest = os.path.join(here, "data_kernelspec") | ||
if os.path.exists(dest): | ||
shutil.rmtree(dest) | ||
write_kernel_spec(dest, overrides={"argv": argv}) |
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,16 +1,60 @@ | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires=[ | ||
"setuptools", | ||
"wheel", | ||
"debugpy", | ||
"ipython>=5", | ||
"jupyter_core>=4.2", | ||
"jupyter_client", | ||
requires = ["hatchling>=0.25", "jupyter_client>=6"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "ipykernel" | ||
version = "6.13.0" | ||
authors = [{name = "IPython Development Team", email = "[email protected]"}] | ||
license = {file = "COPYING.md"} | ||
readme = "README.md" | ||
description = "IPython Kernel for Jupyter" | ||
keywords = ["Interactive", "Interpreter", "Shell", "Web"] | ||
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.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
] | ||
urls = {Homepage = "https://ipython.org"} | ||
requires-python = ">=3.7" | ||
dependencies = [ | ||
"debugpy>=1.0", | ||
"ipython>=7.23.1", | ||
"traitlets>=5.1.0", | ||
"jupyter_client>=6.1.12", | ||
"tornado>=6.1", | ||
"matplotlib-inline>=0.1", | ||
'appnope;platform_system=="Darwin"', | ||
"psutil", | ||
"nest_asyncio", | ||
"packaging", | ||
] | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest>=6.0", | ||
"pytest-cov", | ||
"flaky", | ||
"ipyparallel", | ||
"pre-commit", | ||
"pytest-timeout", | ||
] | ||
|
||
[tool.check-manifest] | ||
ignore = [] | ||
# Used to call hatch_build.py | ||
[tool.hatch.build.hooks.custom] | ||
|
||
[tool.hatch.build.targets.wheel.shared-data] | ||
"data_kernelspec" = "share/jupyter/kernels/python3" | ||
|
||
[tool.hatch.build] | ||
artifacts = ["ipykernel_launcher.py"] | ||
|
||
[tool.jupyter-releaser] | ||
skip = ["check-links"] | ||
|
@@ -29,6 +73,9 @@ tag_template = "v{new_version}" | |
[[tool.tbump.file]] | ||
src = "ipykernel/_version.py" | ||
|
||
[[tool.tbump.file]] | ||
src = "pyproject.toml" | ||
|
||
[tool.mypy] | ||
check_untyped_defs = true | ||
disallow_any_generics = true | ||
|