A monorepo containing jupyter-blocks and jupyter-tidyblocks. Blockly extension for JupyterLab.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #100 from martinRenou/fix_version_py

Generate _version.py at build time

authored by

Denisa Checiu and committed by
GitHub
e9602251 fafd1b1e

+7 -26
+3
.gitignore
··· 116 116 117 117 # Yarn cache 118 118 .yarn/ 119 + 120 + # This is generated by hatch 121 + jupyterlab_blockly/_version.py
-23
jupyterlab_blockly/_version.py
··· 1 - import json 2 - from pathlib import Path 3 - 4 - __all__ = ["__version__"] 5 - 6 - def _fetchVersion(): 7 - HERE = Path(__file__).parent.resolve() 8 - 9 - for settings in HERE.rglob("package.json"): 10 - try: 11 - with settings.open() as f: 12 - version = json.load(f)["version"] 13 - return ( 14 - version.replace("-alpha.", "a") 15 - .replace("-beta.", "b") 16 - .replace("-rc.", "rc") 17 - ) 18 - except FileNotFoundError: 19 - pass 20 - 21 - raise FileNotFoundError(f"Could not find package.json under dir {HERE!s}") 22 - 23 - __version__ = _fetchVersion()
+4 -3
pyproject.toml
··· 37 37 [tool.hatch.version] 38 38 source = "nodejs" 39 39 40 + [tool.hatch.build.hooks.version] 41 + path = "jupyterlab_blockly/_version.py" 42 + 40 43 [tool.hatch.metadata.hooks.nodejs] 41 44 fields = ["description", "authors", "urls"] 42 45 ··· 83 86 ] 84 87 before-build-python = [ 85 88 # Build the assets 86 - "jlpm build:prod", 87 - # Clean the build artifacts to not include them in sdist 88 - "jlpm clean" 89 + "jlpm build:prod" 89 90 ] 90 91 91 92 [tool.check-wheel-contents]