Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,8 @@ COPY install_git-cinnabar.sh .
RUN ./install_git-cinnabar.sh \
&& mv git-cinnabar git-remote-hg /usr/bin/

# install test dependencies
RUN pip install -U pip pytest pytest-mock pip-tools

# setup just the venv so changes to the source won't require a full venv
# rebuild
COPY --chown=app:app README.md .
COPY --chown=app:app pyproject.toml .
RUN pip-compile --verbose pyproject.toml \
&& pip install -r requirements.txt
COPY --chown=app:app requirements.txt .
RUN pip install -r requirements.txt

RUN mkdir -p /clones \
&& chown app:app /clones
Expand All @@ -39,6 +32,7 @@ RUN mkdir -p /clones \
COPY docker/hgrc /etc/mercurial/hgrc
COPY docker/entrypoint.sh /entrypoint.sh
COPY --chown=app:app . /app

# Make the install editable so we can mount the local source into a container based on this image.
RUN pip install -e /app
USER app
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ $ docker compose run --rm test
$ docker compose down
```

## Update requirements

```console
$ docker compose run --rm pip-compile
```

## Known limitations

- Merge commits cannot be pushed to mercurial repositories;
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ services:
networks:
- pulse_network

pip-compile:
<<: *sync_config
command: ["--verbose", "--all-build-deps", "--allow-unsafe", "--extra=dev", "--generate-hashes", "--output-file=requirements.txt", "pyproject.toml"]
entrypoint: pip-compile
volumes:
- .:/app
profiles:
- pip-compile

pulse:
image: rabbitmq:3-management-alpine
volumes:
Expand Down
2 changes: 1 addition & 1 deletion install_git-cinnabar.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

VER=3f0a8a4c35b5be88ddc229c0dd099b99c67483ce
VER=71ac248b7dd7b56ac2cfe764c914a6a3025ea5af

curl https://raw.githubusercontent.com/glandium/git-cinnabar/${VER}/download.py -o download.py
chmod u+x download.py
Expand Down
16 changes: 13 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ dependencies = [
"mozillapulse",
"mozlog",
"pydantic",
"pytest>=8.3.4",
"pytest-ruff",
"pytest-cov",
"sentry_sdk",
"devtools",
]

[project.optional-dependencies]
dev = [
# Pin due to https://github.com/jazzband/pip-tools/issues/2319,
# otherwise pip-compile doesn't work in the container.
"pip<26.0",

"pip-tools",
"pytest>=8.3.4",
"pytest-cov",
"pytest-mock",
"pytest-ruff",
]

[project.scripts]
git-hg-sync = "git_hg_sync.__main__:main"
git-hg-cli = "git_hg_sync.cli:main"
Expand Down
Loading