Skip to content

Commit d3fa657

Browse files
committed
deps: generate and commit requirements.txt (bug 1971461)
1 parent a2bec59 commit d3fa657

File tree

5 files changed

+600
-10
lines changed

5 files changed

+600
-10
lines changed

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@ COPY install_git-cinnabar.sh .
2222
RUN ./install_git-cinnabar.sh \
2323
&& mv git-cinnabar git-remote-hg /usr/bin/
2424

25-
# install test dependencies
26-
RUN pip install -U pip pytest pytest-mock pip-tools
27-
2825
# setup just the venv so changes to the source won't require a full venv
2926
# rebuild
3027
COPY --chown=app:app README.md .
31-
COPY --chown=app:app pyproject.toml .
32-
RUN pip-compile --verbose pyproject.toml \
33-
&& pip install -r requirements.txt
28+
COPY --chown=app:app requirements.txt .
29+
RUN pip install -r requirements.txt
3430

3531
RUN mkdir -p /clones \
3632
&& chown app:app /clones
@@ -40,7 +36,7 @@ COPY docker/hgrc /etc/mercurial/hgrc
4036
COPY docker/entrypoint.sh /entrypoint.sh
4137
COPY --chown=app:app . /app
4238
# Make the install editable so we can mount the local source into a container based on this image.
43-
RUN pip install -e /app
39+
RUN pip install /app
4440
USER app
4541

4642
HEALTHCHECK CMD curl -sfk http://localhost:$PORT -o/dev/null

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ $ docker compose run --rm test
172172
$ docker compose down
173173
```
174174

175+
## Update requirements
176+
177+
```console
178+
$ docker compose run --rm pip-compile
179+
```
180+
175181
## Known limitations
176182

177183
- Merge commits cannot be pushed to mercurial repositories;

docker-compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ services:
5656
networks:
5757
- pulse_network
5858

59+
pip-compile:
60+
<<: *sync_config
61+
command: ["--verbose", "--all-build-deps", "--allow-unsafe", "--extra=dev", "--generate-hashes", "--output-file=requirements.txt", "pyproject.toml"]
62+
entrypoint: pip-compile
63+
volumes:
64+
- .:/app
65+
profiles:
66+
- pip-compile
67+
5968
pulse:
6069
image: rabbitmq:3-management-alpine
6170
volumes:

pyproject.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,21 @@ dependencies = [
1515
"mozillapulse",
1616
"mozlog",
1717
"pydantic",
18-
"pytest>=8.3.4",
19-
"pytest-ruff",
20-
"pytest-cov",
2118
"sentry_sdk",
2219
"devtools",
2320
]
2421

22+
[project.optional-dependencies]
23+
dev = [
24+
# Pin due to https://github.com/jazzband/pip-tools/issues/2319
25+
"pip<26.0",
26+
"pip-tools",
27+
"pytest>=8.3.4",
28+
"pytest-cov",
29+
"pytest-mock",
30+
"pytest-ruff",
31+
]
32+
2533
[project.scripts]
2634
git-hg-sync = "git_hg_sync.__main__:main"
2735
git-hg-cli = "git_hg_sync.cli:main"

0 commit comments

Comments
 (0)