Skip to content

Commit 88f4471

Browse files
committed
Merge branch '52-remove-poetry' into 'main'
Remove Poetry Closes #52 See merge request ndip/project-templates/nova-application-template!44
2 parents 23049f0 + 467c64f commit 88f4471

22 files changed

+126
-269
lines changed

.gitlab-ci.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ test-cli-template:
2323
script:
2424
- mkdir reports
2525
- docker build -f dockerfiles/Dockerfile -t image .
26-
- docker run -u `id -u`:`id -g` -w /src_cli image poetry run ruff check
27-
- docker run -u `id -u`:`id -g` -w /src_cli image poetry run ruff format --check
28-
- docker run -u `id -u`:`id -g` -w /src_cli image poetry run mypy .
29-
- docker run -u `id -u`:`id -g` -w /src_cli image poetry run pytest .
26+
- docker run -u `id -u`:`id -g` -w /src_cli image pixi run ruff check
27+
- docker run -u `id -u`:`id -g` -w /src_cli image pixi run ruff format --check
28+
- docker run -u `id -u`:`id -g` -w /src_cli image pixi run mypy .
29+
- docker run -u `id -u`:`id -g` -w /src_cli image pixi run pytest .
3030
tags:
3131
- rse-multi-builder
3232

@@ -38,10 +38,10 @@ test-library-template:
3838
script:
3939
- mkdir reports
4040
- docker build -f dockerfiles/Dockerfile -t image .
41-
- docker run -u `id -u`:`id -g` -w /src_library image poetry run ruff check
42-
- docker run -u `id -u`:`id -g` -w /src_library image poetry run ruff format --check
43-
- docker run -u `id -u`:`id -g` -w /src_library image poetry run mypy .
44-
- docker run -u `id -u`:`id -g` -w /src_library image poetry run pytest .
41+
- docker run -u `id -u`:`id -g` -w /src_library image pixi run ruff check
42+
- docker run -u `id -u`:`id -g` -w /src_library image pixi run ruff format --check
43+
- docker run -u `id -u`:`id -g` -w /src_library image pixi run mypy .
44+
- docker run -u `id -u`:`id -g` -w /src_library image pixi run pytest .
4545
tags:
4646
- rse-multi-builder
4747

@@ -53,10 +53,10 @@ test-ndip-tool-template:
5353
script:
5454
- mkdir reports
5555
- docker build -f dockerfiles/Dockerfile -t image .
56-
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image poetry run ruff check
57-
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image poetry run ruff format --check
58-
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image poetry run mypy .
59-
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image poetry run pytest .
56+
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run ruff check
57+
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run ruff format --check
58+
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run mypy .
59+
- docker run -u `id -u`:`id -g` -w /src_ndip_tool image pixi run pytest .
6060
tags:
6161
- rse-multi-builder
6262

@@ -68,25 +68,10 @@ test-nova-application-template:
6868
script:
6969
- mkdir reports
7070
- docker build -f dockerfiles/Dockerfile -t image .
71-
- docker run -u `id -u`:`id -g` -w /src_nova_application image poetry run ruff check
72-
- docker run -u `id -u`:`id -g` -w /src_nova_application image poetry run ruff format --check
73-
- docker run -u `id -u`:`id -g` -w /src_nova_application image poetry run mypy .
74-
- docker run -u `id -u`:`id -g` -w /src_nova_application image poetry run pytest .
75-
tags:
76-
- rse-multi-builder
77-
78-
test-nova-application-mantid-template:
79-
stage: test
80-
hooks:
81-
pre_get_sources_script:
82-
- 'test -d "${CI_PROJECT_DIR}" && sudo chown gitlab-runner -R "${CI_PROJECT_DIR}" ||:'
83-
script:
84-
- mkdir reports
85-
- docker build -f dockerfiles/Dockerfile -t image .
86-
- docker run -u `id -u`:`id -g` -w /src_nova_application_mantid image pixi run poetry run ruff check
87-
- docker run -u `id -u`:`id -g` -w /src_nova_application_mantid image pixi run poetry run ruff format --check
88-
- docker run -u `id -u`:`id -g` -w /src_nova_application_mantid image pixi run poetry run mypy .
89-
- docker run -u `id -u`:`id -g` -w /src_nova_application_mantid image pixi run poetry run pytest .
71+
- docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run ruff check
72+
- docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run ruff format --check
73+
- docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run mypy .
74+
- docker run -u `id -u`:`id -g` -w /src_nova_application image pixi run pytest .
9075
tags:
9176
- rse-multi-builder
9277

@@ -98,10 +83,10 @@ test-tutorial-template:
9883
script:
9984
- mkdir reports
10085
- docker build -f dockerfiles/Dockerfile -t image .
101-
- docker run -u `id -u`:`id -g` -w /src_tutorial image poetry run ruff check
102-
- docker run -u `id -u`:`id -g` -w /src_tutorial image poetry run ruff format --check
103-
- docker run -u `id -u`:`id -g` -w /src_tutorial image poetry run mypy .
104-
- docker run -u `id -u`:`id -g` -w /src_tutorial image poetry run pytest .
86+
- docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run ruff check
87+
- docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run ruff format --check
88+
- docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run mypy .
89+
- docker run -u `id -u`:`id -g` -w /src_tutorial image pixi run pytest .
10590
tags:
10691
- rse-multi-builder
10792

copier.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ tool_category:
4444
Small Angle Neutron Scattering: small-angle-neutron-scattering
4545
Triple-Axis Spectroscopy: spectroscopy
4646

47-
use_mantid:
48-
type: bool
49-
help: Do you want to install Mantid for your project?
50-
default: no
51-
5247
# --- Nova Application Specific ---
5348
# Implicitly GUI if Nova Application is chosen.
5449
framework:
@@ -101,16 +96,16 @@ _message_after_copy: |
10196
2. Read "DEVELOPMENT.md" for development guidelines!
10297
10398
3. Install project dependencies and setup pre-commit:
104-
$ poetry install
105-
$ pre-commit install
99+
$ pixi install
100+
$ pixi run pre-commit install
106101
{% else %}
107102
2. Review the generated files, including `minimal_config.yaml`.
108103
You may need to install dependencies like 'git', 'docker', 'bash', 'sed', 'grep', 'mktemp' manually if not already present.
109104
{% endif %}
110105
111106
{% if application_type in ['Nova Application', 'NDIP Tool'] %}
112107
4. Initialize the Git repository:
113-
$ poetry run init-repo
108+
$ pixi run init-repo
114109
115110
This script will show you the planned actions and ask for confirmation.
116111
It will NOT push automatically. After running, review the changes and push manually:
@@ -119,21 +114,21 @@ _message_after_copy: |
119114
$ git push --set-upstream origin main
120115
121116
5. Test if the application runs:
122-
$ poetry run app
117+
$ pixi run app
123118
{% if application_type == 'Nova Application' %}
124119
If there are any problems with GUI dependencies (like PyQt/Trame) you might need to install/update system libraries.
125120
{% endif %}
126121
127122
6. Deploy the tool XML to the Galaxy tools repository on the prototype branch:
128-
$ poetry run deploy-prototype
123+
$ pixi run deploy-prototype
129124
130125
This script will also ask for confirmation before committing and pushing to the Galaxy tools repo.
131126
Ensure your Docker image is built and pushed first (see DEVELOPMENT.md or Dockerfile).
132127
133128
7. Start coding! Remember to document your work (see DEVELOPMENT.md). Continue to update the version in pyproject.toml and run deploy-prototype as needed.
134129
135130
8. When you're ready to make your tool available to users, deloy the tool XML to the Galaxy tools repository on the dev branch:
136-
$ poetry run deploy-production
131+
$ pixi run deploy-production
137132
138133
This script will first create a new branch with your XML, then create a merge request from that branch to the dev branch.
139134
This will start the process of making your tool available to users on calvera. You should also review the MR and assign a reviewer.
@@ -147,7 +142,7 @@ _message_after_copy: |
147142
# Add remote and push if needed
148143
149144
5. Test if the application runs:
150-
$ poetry run app
145+
$ pixi run app
151146
152147
6. Start coding! Remember to document your work (see DEVELOPMENT.md).
153148
@@ -159,19 +154,19 @@ _message_after_copy: |
159154
# Add remote and push if needed
160155
161156
{% if publish_to_pypi %}
162-
5. Configure PyPI publishing details in `pyproject.toml` and follow Poetry's publishing guide.
157+
5. Configure PyPI publishing details in `pyproject.toml` and follow [Hatch's](https://hatch.pypa.io/latest/) publishing guide.
163158
{% endif %}
164159
{% if publish_docs %}
165-
6. Configure Readthedocs integration (see `.readthedocs.yml` and `docs/conf.py`). Build docs locally with `poetry run sphinx-build docs docs/_build/html`.
160+
6. Configure Readthedocs integration (see `.readthedocs.yml` and `docs/conf.py`). Build docs locally with `pixi run sphinx-build docs docs/_build/html`.
166161
{% endif %}
167162
168163
7. Start developing your library! Remember to write tests and documentation (see DEVELOPMENT.md).
169164
170165
{% elif application_type == 'Tutorial' %}
171166
4. Follow the specific instructions provided in the generated tutorial documentation (e.g., TUTORIAL.md or README.md) for next steps.
172167
This likely involves installing dependencies, running setup scripts, and testing the application.
173-
$ poetry install
174-
$ pre-commit install
168+
$ pixi install
169+
$ pixi run pre-commit install
175170
# (Check tutorial docs for specific init-repo/deploy-tool usage if applicable)
176171
177172
{% elif application_type == 'Minimal' %}

dockerfiles/.cli-copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ application_type: Command-line tool
33
project_name: CLI Tool
44
python_package: cli-tool
55
tool_category: generic
6-
use_mantid: false

dockerfiles/.library-copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ publish_docs: true
55
publish_to_pypi: true
66
python_package: library
77
tool_category: generic
8-
use_mantid: false

dockerfiles/.minimal-copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
application_type: Minimal
33
project_name: minimal
44
tool_category: generic
5-
use_mantid: false

dockerfiles/.ndip-tool-copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ application_type: NDIP Tool
33
project_name: ndip_tool
44
python_package: ndip_tool
55
tool_category: generic
6-
use_mantid: false

dockerfiles/.nova-application-copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ multitabs: true
55
project_name: nova_application
66
python_package: nova_application
77
tool_category: generic
8-
use_mantid: false

dockerfiles/.nova-application-mantid-copier-answers.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

dockerfiles/.tutorial-copier-answers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ multitabs: true
55
project_name: Tutorial
66
python_package: tutorial
77
tool_category: generic
8-
use_mantid: false

dockerfiles/Dockerfile

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
FROM --platform=amd64 regproxy.ornl.gov/hub_proxy/python:3.10-slim
22

3-
ENV POETRY_CACHE_DIR=/poetry/.cache
4-
ENV POETRY_CONFIG_DIR=/poetry/.config
5-
ENV POETRY_HOME=/poetry
6-
73
RUN apt-get update && apt-get install -y curl git
8-
RUN pip install poetry copier
4+
RUN pip install copier
95

106
RUN curl -fsSL https://pixi.sh/install.sh | sh
117
ENV PATH="/root/.pixi/bin:${PATH}"
@@ -19,37 +15,24 @@ RUN copier copy --data-file /template/dockerfiles/.library-copier-answers.yml --
1915
RUN copier copy --data-file /template/dockerfiles/.minimal-copier-answers.yml --vcs-ref=HEAD template src_minimal
2016
RUN copier copy --data-file /template/dockerfiles/.ndip-tool-copier-answers.yml --vcs-ref=HEAD template src_ndip_tool
2117
RUN copier copy --data-file /template/dockerfiles/.nova-application-copier-answers.yml --vcs-ref=HEAD template src_nova_application
22-
RUN copier copy --data-file /template/dockerfiles/.nova-application-mantid-copier-answers.yml --vcs-ref=HEAD template src_nova_application_mantid
2318
RUN copier copy --data-file /template/dockerfiles/.tutorial-copier-answers.yml --vcs-ref=HEAD template src_tutorial
2419

2520

2621
WORKDIR /src_cli
27-
RUN poetry install
22+
RUN pixi install
2823

2924
WORKDIR /src_library
30-
RUN poetry install
25+
RUN pixi install
3126

3227
WORKDIR /src_ndip_tool
33-
RUN poetry install
28+
RUN pixi install
3429

3530
WORKDIR /src_nova_application
36-
RUN poetry install
37-
38-
WORKDIR /src_nova_application_mantid
3931
RUN pixi install
40-
RUN pixi run poetry install
4132

4233
WORKDIR /src_tutorial
43-
RUN poetry install
44-
45-
RUN poetry install
46-
RUN poetry build --format=wheel
47-
48-
RUN chmod og+rwX /poetry
49-
RUN chmod og+rwX /src_cli
50-
RUN chmod og+rwX /src_library
51-
RUN chmod og+rwX /src_minimal
52-
RUN chmod og+rwX /src_ndip_tool
53-
RUN chmod og+rwX /src_nova_application
54-
RUN chmod og+rwX /src_nova_application_mantid
55-
RUN chmod og+rwX /src_tutorial
34+
RUN pixi install
35+
RUN pixi run hatch build
36+
37+
RUN mkdir -p /.cache
38+
RUN chmod -R og+rwX /.cache /src_cli /src_library /src_minimal /src_ndip_tool /src_nova_application /src_tutorial

0 commit comments

Comments
 (0)