-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to hatch custom build * fix version bump
- Loading branch information
Showing
2 changed files
with
24 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""A custom hatch build hook for octave_kernel.""" | ||
import shutil | ||
from pathlib import Path | ||
|
||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
|
||
|
||
class CustomHook(BuildHookInterface): | ||
"""The octave_kernel build hook.""" | ||
|
||
def initialize(self, version, build_data): | ||
"""Initialize the hook.""" | ||
here = Path(__file__).parent.resolve() | ||
jupyter_data = here /"jupyter-data" | ||
if jupyter_data.exists(): | ||
shutil.rmtree(jupyter_data) | ||
jupyter_data.mkdir() | ||
shutil.copy(here / "octave_kernel" / "kernel.json", jupyter_data / "kernel.json") | ||
shutil.copytree(here / "octave_kernel" / "images", jupyter_data / "images") |
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