Skip to content

Commit f6923b4

Browse files
authored
Merge pull request #53 from YtoTech/latexmk
Latexmk
2 parents d8c4903 + 1d98c0b commit f6923b4

61 files changed

Lines changed: 1679 additions & 3564 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
python-version: ${{ matrix.python-version }}
2727
- name: Install dependencies
2828
run: |
29-
python -m pip install --upgrade pip
30-
pip install pipenv
29+
python -m pip install --upgrade pip pipx
30+
pipx install poetry
3131
make install-dev
3232
- name: Build Docker images
3333
run: make docker-build-all

.github/workflows/docker-hub-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
python-version: ${{ matrix.python-version }}
1919
- name: Install dependencies
2020
run: |
21-
python -m pip install --upgrade pip
22-
pip install pipenv
21+
python -m pip install --upgrade pip pipx
22+
pipx install poetry
2323
make install-dev
2424
- name: Build Docker images
2525
run: make docker-build-all

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,4 @@ examples/**/*.bcf
114114
examples/**/*.run.xml
115115

116116
samples/**/*.log
117+
data/postgres*

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 2025-08-06-1
4+
5+
* Switch to TexLive 2025
6+
* Use `latexmk` as default runner instead of `latexrun`
7+
* Add PostgreSQL database in prevision of job status
8+
39
## 2025-02-13-1
410

511
* Fix build with XelaTeX [#43](https://github.com/YtoTech/latex-on-http/issues/43)

DEV.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Dev guide
2+
3+
## Create a migration file
4+
5+
```sh
6+
docker-compose run --entrypoint /bin/bash latex -c "goose -s create <migration_name> sql"
7+
sudo
8+
make set-permissions-migrations
9+
```

Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,27 @@ RUN mkdir -p /app/latex-on-http
2424
WORKDIR /app/latex-on-http/
2525

2626
# Copy application source code.
27-
COPY app.py Makefile Pipfile Pipfile.lock /app/latex-on-http/
27+
COPY app.py Makefile pyproject.toml poetry.lock /app/latex-on-http/
2828
COPY ./latexonhttp/ /app/latex-on-http/latexonhttp/
2929

30+
# TODO curl -LsSf https://astral.sh/uv/install.sh | sh
3031
# Install app dependencies.
3132
RUN make install
3233

34+
# Add migration tool.
35+
RUN apt-get update -qq && apt-get install -y \
36+
curl \
37+
&& curl -fsSL \
38+
https://raw.githubusercontent.com/pressly/goose/master/install.sh |\
39+
sh \
40+
&& apt-get autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists/*
41+
RUN mkdir -p /app/latex-on-http/tools/migrations
42+
COPY ./tools/migrations/ /app/latex-on-http/tools/
43+
ENV GOOSE_MIGRATION_DIR /app/latex-on-http/tools/migrations
44+
ENV GOOSE_DRIVER postgres
45+
46+
COPY ./tools/entrypoint.sh ./tools/
47+
3348
EXPOSE 8080
34-
CMD ["make", "start"]
49+
ENTRYPOINT ["/bin/bash", "tools/entrypoint.sh"]
50+
CMD ["prod"]

Makefile

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,41 @@
22
## Running Python app ##
33
## -------------------------------
44
install:
5-
pipenv install
5+
poetry install
66

77
start:
8-
pipenv run gunicorn --workers=2 --threads=8 --bind=0.0.0.0:8080 app:app
8+
poetry run gunicorn --workers=2 --threads=8 --bind=0.0.0.0:8080 app:app
99

1010
debug:
11-
pipenv run python app.py --verbose --debug
11+
poetry run python app.py --verbose --debug
1212

1313

1414
## -------------------------------
1515
## Running cache app ##
1616
## -------------------------------
1717
start-cache:
18-
pipenv run python app_cache.py
18+
poetry run python app_cache.py
1919

2020
debug-cache:
21-
pipenv run python -u app_cache.py --debug
22-
23-
24-
## -------------------------------
25-
## Dev tools ##
26-
## -------------------------------
27-
install-dev:
28-
pipenv install --dev
29-
21+
poetry run python -u app_cache.py --debug
3022

3123
## -------------------------------
3224
## Docker build/images ##
3325
## -------------------------------
3426
docker-pull-yoant-texlive-debian:
3527
docker pull yoant/docker-texlive:debian
3628

37-
docker-pull-yoant-texlive-alpine:
38-
docker pull yoant/docker-texlive:alpine
39-
4029
docker-build-tl-distrib-debian:
4130
docker build -f container/tl-distrib-debian.Dockerfile -t yoant/latexonhttp-tl-distrib:debian .
4231

43-
docker-build-tl-distrib-alpine:
44-
docker build -f container/tl-distrib-alpine.Dockerfile -t yoant/latexonhttp-tl-distrib:alpine .
45-
4632
docker-build-python-debian:
4733
docker build -f container/python-debian.Dockerfile -t yoant/latexonhttp-python:debian .
4834

49-
docker-build-python-alpine:
50-
docker build -f container/python-alpine.Dockerfile -t yoant/latexonhttp-python:alpine .
51-
5235
docker-build-main:
5336
docker build -f Dockerfile .
5437

5538
docker-build-all-debian: docker-pull-yoant-texlive-debian docker-build-tl-distrib-debian docker-build-python-debian docker-build-main
5639

57-
docker-build-all-alpine: docker-pull-yoant-texlive-alpine docker-build-tl-distrib-alpine docker-build-python-alpine docker-build-main
58-
5940
docker-build-all: docker-build-all-debian
6041

6142
## -------------------------------
@@ -72,22 +53,25 @@ docker-push-python-debian:
7253
## Docker Compose for dev ##
7354
## -------------------------------
7455
dev:
75-
docker-compose -f docker-compose.dev.yml up
56+
docker-compose up
7657

7758
dev-build:
78-
docker-compose -f docker-compose.dev.yml build --no-cache
59+
docker-compose build --no-cache
7960

8061
dev-sh-latex:
81-
docker-compose -f docker-compose.dev.yml exec latex /bin/bash
62+
docker-compose exec latex /bin/bash
63+
64+
set-permissions-migrations:
65+
chown -R $(SUDO_USER):$(SUDO_USER) ./tools/migrations
8266

8367
## -------------------------------
8468
## Tests ##
8569
## -------------------------------
8670
test:
87-
pipenv run pytest -vv
71+
poetry run pytest -vv
8872

8973
test-x:
90-
pipenv run pytest -vv -x
74+
poetry run pytest -vv -x
9175

9276
test-docker-compose: test-docker-compose-start
9377
sleep 3
@@ -121,4 +105,4 @@ test-docker-compose-build-no-cache:
121105
## Code conventions and formatting ##
122106
## -------------------------------
123107
format:
124-
pipenv run black .
108+
poetry run black .

Pipfile

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

0 commit comments

Comments
 (0)