Skip to content

Commit 6573542

Browse files
authored
fix: poetry.lock should trigger requirements sync (#260)
## What Did You Change? Fixed `requirements.txt` not being auto-updated. ## Do You Want Support (syntax, design, etc)? No. <!-- After you open this PR, you can preview your changes. A comment will appear with a link to the server. --> ## Any Reference Material Worth Sharing? - verified via #259 - [successful action](https://github.com/DesignSafe-CI/DS-User-Guide/actions/runs/20726221956/job/59502357547?pr=259
1 parent b0d03ee commit 6573542

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/requirments-sync.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Sync requirements.txt with pyproject.toml
33

44
on:
55
pull_request:
6-
paths: ['pyproject.toml']
6+
paths: ['poetry.lock']
77
types: [opened, synchronize, reopened]
88

99
permissions:
@@ -32,6 +32,9 @@ jobs:
3232
- name: Install Poetry
3333
run: pip install poetry
3434

35+
- name: Install Dependencies via Poetry
36+
run: poetry install --only main --no-root
37+
3538
- name: Detect whether requirements.txt has change
3639
id: detect
3740
run: |

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
DOCKER_COMPOSE_CMD := $(shell if command -v docker-compose > /dev/null; then echo "docker-compose"; else echo "docker compose"; fi)
33

44

5+
# To regenerate requirements.txt from poetry.lock
6+
# CAVEAT: Using .PHONY to skip Make's dependency check
7+
# of poetry.lock until it is reliable or proven useless
8+
.PHONY: requirements.txt
59
requirements.txt: poetry.lock
610
pip install --user poetry-plugin-export \
711
&& poetry export -f requirements.txt --output requirements.txt \

0 commit comments

Comments
 (0)