Skip to content

Commit 58ef564

Browse files
committed
Reorganise the data files and corresponging changes.
1 parent d9da273 commit 58ef564

File tree

10 files changed

+5550
-24
lines changed

10 files changed

+5550
-24
lines changed

.github/workflows/publish-north.yaml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@ on:
1111

1212
env:
1313
REGISTRY: ghcr.io
14-
UV_VERSION: 0.7
14+
UV_VERSION: 0.9
1515
PYTHON_VERSION: 3.12
16-
JUPYTER_VERSION: "2025-04-14"
16+
JUPYTER_VERSION: 2025-04-14
1717
IMAGE_PREFIX: /jupyter
1818
SERVICES: jupyter
1919
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM: "0.0.0+0.UNKNOWN"
20-
TEST_DATA_DIR: $(pwd)/src/pynxtools_spm/nomad/example_uploads
21-
20+
# Upload to Jupyter image build
21+
EXAMPLES_DIR: $(pwd)/src/pynxtools_spm/north_tools/spm_jupyter/examples
22+
# Data for testing notebooks in Jupyter image
23+
TEST_DATA_DIR: $(pwd)/src/pynxtools_spm
2224
# Path w.r.t. TEST_DATA_DIR multi-line in single string
23-
TEST_NOTEBOOKS: afm/AFMExampleWithCustomization/CommandLineDataconverter.ipynb
24-
stm/STMExampleWithCustomization/CommandLineDataconverter.ipynb
25-
sts/STSExampleWithCustomization/CommandLineDataconverter.ipynb
25+
TEST_NOTEBOOKS:
26+
nomad/example_uploads/afm/AFMExampleWithCustomization/CommandLineDataconverter.ipynb
27+
nomad/example_uploads/stm/STMExampleWithCustomization/CommandLineDataconverter.ipynb
28+
nomad/example_uploads/sts/STSExampleWithCustomization/CommandLineDataconverter.ipynb
29+
north_tools/spm_jupyter/examples/stm/CommandLineDataconverter_STM.ipynb
2630

2731
permissions:
2832
packages: write
@@ -63,13 +67,6 @@ jobs:
6367
VERSION=$(./scripts/get_git_version.sh)
6468
echo "Computed version: $VERSION"
6569
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM=$VERSION" >> "$GITHUB_ENV"
66-
echo "Env variable: ${{ env.SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM }}"
67-
- name: All the available variables from env
68-
run: |
69-
echo "UV_VERSION=${{ env.UV_VERSION }}"
70-
echo "PYTHON_VERSION=${{ env.PYTHON_VERSION }}"
71-
echo "JUPYTER_VERSION=${{ env.JUPYTER_VERSION }}"
72-
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM=${{ env.SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM }}"
7370
- uses: docker/setup-buildx-action@v3
7471
# https://github.com/docker/metadata-action
7572
- name: Extract Docker metadata
@@ -92,12 +89,13 @@ jobs:
9289
uses: docker/build-push-action@v6
9390
with:
9491
context: .
95-
file: Dockerfile
92+
file: docker/Dockerfile.jupyter
9693
build-args: |
9794
UV_VERSION=${{ env.UV_VERSION }}
9895
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
9996
JUPYTER_VERSION=${{ env.JUPYTER_VERSION }}
10097
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM=${{ env.SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM }}
98+
EXAMPLES_DIR=${{ env.EXAMPLES_DIR }}
10199
cache-from: type=gha
102100
cache-to: type=gha,mode=max
103101
push: false

Dockerfile renamed to docker/Dockerfile.jupyter

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
21
ARG JUPYTER_TAG=2025-10-20
32
ARG UV_VERSION=0.9
43
ARG PLUGIN_NAME="PLUGIN"
54
ARG PYTHON_VERSION=3.12
65
ARG SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM="0.0.0+0.gunknown"
6+
ARG EXAMPLES_DIR="./src/test_north/north_tools/spm_jupyter/examples"
77
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_stage
88

99
FROM quay.io/jupyter/scipy-notebook:${JUPYTER_TAG} AS scipy_notebook
@@ -58,28 +58,28 @@ ENV UV_PROJECT_ENVIRONMENT=${CONDA_DIR} \
5858
UV_SYSTEM_PYTHON=1 \
5959
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM=${SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYNXTOOLS_SPM}
6060

61-
COPY --chown=${NB_USER}:${NB_GID} . $HOME/$PLUGIN_NAME
61+
COPY --chown=${NB_USER}:${NB_GID} . ${HOME}/${PLUGIN_NAME}
6262

63-
WORKDIR $HOME/$PLUGIN_NAME
63+
WORKDIR ${HOME}/${PLUGIN_NAME}
6464

6565
# RUN export SETUPTOOLS_SCM_PRETEND_VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION}
6666
# https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
6767
# Install dependencies
6868
RUN --mount=type=cache,target=/root/.cache/uv \
6969
uv sync --locked --no-editable --extra=north --extra=nomad --inexact
7070

71-
WORKDIR $HOME
71+
WORKDIR ${HOME}
7272
RUN rm -rf ${HOME}/${PLUGIN_NAME}
7373

7474
RUN jupyter lab build --dev-build=False --minimize=False && \
7575
fix-permissions "/home/${NB_USER}" \
7676
&& fix-permissions "${CONDA_DIR}"
7777

78-
WORKDIR $HOME
78+
WORKDIR ${HOME}
7979

80+
ARG EXAMPLES_DIR
8081
# copy north examples
81-
COPY --chown=${NB_UID}:${NB_GID} ./src/pynxtools_spm/nomad/example_uploads ${HOME}/examples
82-
82+
COPY --chown=${NB_UID}:${NB_GID} ${EXAMPLES_DIR} ${HOME}/examples
8383

8484
RUN touch ${HOME}/.hushlogin
8585

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ sts_example = "pynxtools_spm.nomad.entrypoints:sts_example"
7373
stm_example = "pynxtools_spm.nomad.entrypoints:stm_example"
7474
afm_example = "pynxtools_spm.nomad.entrypoints:afm_example"
7575
spm_app = "pynxtools_spm.nomad.apps:spm_app"
76-
spm_tool = "pynxtools_spm.north_tools.jupyter_nb:spm_jupyter"
76+
spm_tool = "pynxtools_spm.north_tools.spm_jupyter:spm_jupyter"
7777

7878

7979
[tool.setuptools.packages.find]

src/pynxtools_spm/north_tools/jupyter_nb/__init__.py renamed to src/pynxtools_spm/north_tools/spm_jupyter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
path_prefix="lab/tree",
1818
privileged=False,
1919
with_path=True,
20-
display_name="SPM",
20+
display_name="SPM-Jupyter",
2121
)
2222

2323
spm_jupyter = NorthToolEntryPoint(id_url_safe="spm_jupyter", north_tool=tool)

0 commit comments

Comments
 (0)