Skip to content

Commit 987eb64

Browse files
authored
Merge pull request #19 from nova-model/17-remove-poetry
Remove Poetry
2 parents c674c5e + 9e223b4 commit 987eb64

File tree

10 files changed

+2478
-4434
lines changed

10 files changed

+2478
-4434
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ jobs:
3434
load: true
3535
target: source
3636
- name: Run ruff check
37-
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run ruff check
37+
run: docker run --rm ${{ steps.build.outputs.imageid }} ruff check
3838
- name: Run format check
39-
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run ruff format --check
39+
run: docker run --rm ${{ steps.build.outputs.imageid }} ruff format --check
4040
- name: Run mypy
41-
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run mypy .
41+
run: docker run --rm ${{ steps.build.outputs.imageid }} mypy .
4242
- name: Run Prettier
4343
run: docker run --rm -w /opt/run/vue ${{ steps.build.outputs.imageid }} pnpm exec prettier --check .
4444
- name: Run eslint
4545
run: docker run --rm -w /opt/run/vue ${{ steps.build.outputs.imageid }} pnpm exec eslint .
4646
- name: Unit tests
47-
run: docker run --rm ${{ steps.build.outputs.imageid }} poetry run pytest
47+
run: docker run --rm ${{ steps.build.outputs.imageid }} pytest
4848
- name: Run coverage
49-
run: docker run --rm ${{ steps.build.outputs.imageid }} sh -c "poetry run coverage run && poetry run coverage report"
49+
run: docker run --rm ${{ steps.build.outputs.imageid }} sh -c "coverage run && coverage report"

.gitlab-ci.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ lint-check:
2323
stage: lint
2424
script:
2525
- docker build -f dockerfiles/Dockerfile --target source -t image .
26-
- docker run -u `id -u`:`id -g` image poetry run ruff check
27-
- docker run -u `id -u`:`id -g` image poetry run ruff format --check
28-
- docker run -u `id -u`:`id -g` image poetry run mypy .
26+
- docker run -u `id -u`:`id -g` image ruff check
27+
- docker run -u `id -u`:`id -g` image ruff format --check
28+
- docker run -u `id -u`:`id -g` image mypy .
2929
- docker run -u `id -u`:`id -g` -w /opt/run/vue image pnpm exec prettier --check .
3030
- docker run -u `id -u`:`id -g` -w /opt/run/vue image pnpm exec eslint .
3131
- docker tag image ${IMAGE_NAME}:src-${CI_COMMIT_SHA}
@@ -38,9 +38,9 @@ unit-tests:
3838
script:
3939
- mkdir reports
4040
- docker pull ${IMAGE_NAME}:src-${CI_COMMIT_SHA}
41-
- docker run -u `id -u`:`id -g` -v `pwd`/reports:/opt/run/django/reports ${IMAGE_NAME}:src-${CI_COMMIT_SHA} poetry run coverage run
42-
- docker run -u `id -u`:`id -g` -v `pwd`/reports:/opt/run/django/reports ${IMAGE_NAME}:src-${CI_COMMIT_SHA} poetry run coverage report
43-
- docker run -u `id -u`:`id -g` -v `pwd`/reports:/opt/run/django/reports ${IMAGE_NAME}:src-${CI_COMMIT_SHA} poetry run coverage xml -o reports/coverage.xml
41+
- docker run -u `id -u`:`id -g` -v `pwd`/reports:/opt/run/django/reports ${IMAGE_NAME}:src-${CI_COMMIT_SHA} coverage run
42+
- docker run -u `id -u`:`id -g` -v `pwd`/reports:/opt/run/django/reports ${IMAGE_NAME}:src-${CI_COMMIT_SHA} coverage report
43+
- docker run -u `id -u`:`id -g` -v `pwd`/reports:/opt/run/django/reports ${IMAGE_NAME}:src-${CI_COMMIT_SHA} coverage xml -o reports/coverage.xml
4444
- sed -i "s:<source>/src:<source>${CI_BUILDS_DIR}/${CI_PROJECT_PATH}:" reports/coverage.xml
4545

4646
coverage: '/TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
@@ -77,17 +77,3 @@ build-image:
7777
fi
7878
tags:
7979
- rse-multi-builder
80-
# package-build:
81-
# stage: package
82-
# script:
83-
# - >
84-
# docker run
85-
# -u `id -u`:`id -g`
86-
# ${IMAGE_NAME}:src-${CI_COMMIT_SHA}
87-
# bash -c "
88-
# poetry config repositories.gitlab_repo ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi &&
89-
# poetry publish -u gitlab-ci-token -p ${CI_JOB_TOKEN} -r gitlab_repo
90-
# "
91-
# when: manual
92-
# tags:
93-
# - rse-multi-builder

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
hooks:
2121
- id: mypy
2222
name: mypy
23-
entry: poetry run mypy src/launcher_app
23+
entry: pixi run mypy src/launcher_app
2424
language: system
2525
types: [python]
2626
verbose: true

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ way for users to launch interactive tools without going through Calvera.
55

66
## Install dependencies
77

8-
You will need to install [Poetry](https://python-poetry.org/) and [pnpm](https://pnpm.io/). After doing so, you can run
8+
You will need to install [Pixi](https://pixi.sh/latest/) and [pnpm](https://pnpm.io/). After doing so, you can run
99
the following commands to build the source code.
1010

1111
```bash
12-
poetry install
13-
poetry run ./manage.py migrate
12+
pixi install
13+
pixi run ./manage.py migrate
1414
```
1515

1616
```bash
@@ -35,13 +35,12 @@ pnpm run dev --host 0.0.0.0 --port 5173
3535
After that to start the application (from the root directory):
3636

3737
```bash
38-
poetry run ./manage.py runserver_plus --insecure 0.0.0.0:8080
38+
pixi run ./manage.py runserver_plus --insecure 0.0.0.0:8080
3939
```
4040

4141
## Develop
4242

43-
Run `poetry env info --path` to see the path to Poetry environment. It can then be used
44-
to configure your IDE to select the correct Python interpreter.
43+
Pixi will create a `.pixi` folder containing a virtual environment for this project. Please configure your IDE to use this environment.
4544

4645
## Docker
4746

dockerfiles/Dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ ARG DEBIAN_FRONTEND=noninteractive
33

44
# make sure image can run as non-root user
55
ENV PNPM_HOME=/pnpm
6-
ENV POETRY_CACHE_DIR=/poetry/.cache
7-
ENV POETRY_CONFIG_DIR=/poetry/.config
8-
ENV POETRY_HOME=/poetry
96

107
RUN apt update && apt upgrade -y && apt install -y \
118
curl \
@@ -16,10 +13,6 @@ RUN add-apt-repository ppa:deadsnakes/ppa -y
1613
RUN apt update && apt install -y \
1714
python3.10
1815

19-
# Install Poetry
20-
RUN curl -fsSL https://install.python-poetry.org | python3.10 -
21-
ENV PATH="$PATH:$POETRY_HOME/bin"
22-
2316
# Install Node.js LTS & pnpm
2417
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
2518
RUN apt install -y nodejs
@@ -30,7 +23,12 @@ ENV PATH="$PATH:$PNPM_HOME"
3023
# Setup Django
3124
ADD ./ /opt/run/django
3225
WORKDIR /opt/run/django
33-
RUN poetry install
26+
27+
RUN curl -fsSL https://pixi.sh/install.sh | sh
28+
ENV PATH="/root/.pixi/bin:${PATH}"
29+
RUN pixi install
30+
SHELL [ "pixi", "run", "--manifest-path", "/opt/run/django" ]
31+
ENTRYPOINT [ "pixi", "run", "--manifest-path", "/opt/run/django" ]
3432

3533
# Setup Vue.js
3634
ADD src/vue /opt/run/vue
@@ -39,7 +37,6 @@ RUN pnpm install
3937

4038
WORKDIR /opt/run/django
4139
RUN chmod og+rwX -R /pnpm
42-
RUN chmod og+rwX -R /poetry
4340
RUN chmod og+rwX -R /opt/run/django
4441
RUN chmod og+rwX -R /opt/run/vue
4542

@@ -48,7 +45,7 @@ FROM source AS run
4845

4946
# Install dependencies only used in production builds
5047
WORKDIR /opt/run/django
51-
RUN poetry run pip install gunicorn uvicorn-worker
48+
RUN pixi add --pypi gunicorn uvicorn-worker
5249

5350
# Create static client build
5451
WORKDIR /opt/run/vue

0 commit comments

Comments
 (0)