Skip to content

Commit 2b789f8

Browse files
committed
Merge branch 'release/25.0.0'
2 parents 878881d + a176d21 commit 2b789f8

File tree

117 files changed

+7047
-1823
lines changed

Some content is hidden

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

117 files changed

+7047
-1823
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.pyc
33
**/*.pyc
44
Dockerfile
5+
*venv*

.github/workflows/test-build.yml

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,71 @@ on: [push, pull_request, workflow_dispatch]
55
jobs:
66

77
build:
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-24.04
99
env:
10-
GHA_DISTRO: ubuntu-20.04
10+
GHA_DISTRO: ubuntu-24.04
1111
if: "!contains(github.event.head_commit.message, 'skip ci')"
1212
strategy:
1313
matrix:
14-
python-version: [3.6]
14+
python-version: [3.13]
1515
steps:
1616
- name: Git checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
18+
1819
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
2021
with:
2122
python-version: ${{ matrix.python-version }}
23+
2224
- name: Cache Build Requirements
2325
id: pip-cache-step
24-
uses: actions/cache@v2
26+
uses: actions/cache@v4
2527
with:
26-
path: ${{ env.pythonLocation }}
27-
key: ${{ env.GHA_DISTRO }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }}
28-
- name: install dependencies
29-
if: steps.pip-cache-step.outputs.cache-hit != 'true'
28+
path: ~/.cache/pip
29+
key: ${{ env.GHA_DISTRO }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}
30+
31+
- name: Install dependencies
3032
run: |
31-
python -m pip install --upgrade pip
32-
pip install -r dev-requirements.txt
33+
python -m pip install poetry==2.1.2 setuptools==80.1.0
34+
poetry install --no-root --without=docs --with=dev
3335
3436
runtests:
3537
name: Run unit tests
3638
needs: build
37-
runs-on: ubuntu-20.04
39+
runs-on: ubuntu-24.04
3840
env:
39-
GHA_DISTRO: ubuntu-20.04
41+
GHA_DISTRO: ubuntu-24.04
42+
strategy:
43+
matrix:
44+
python-version: [3.13]
4045
steps:
41-
- uses: actions/checkout@v2
42-
- name: Set up Python 3.6
43-
uses: actions/setup-python@v2
46+
- uses: actions/checkout@v3
47+
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v4
4450
with:
45-
python-version: 3.6
51+
python-version: ${{ matrix.python-version }}
52+
4653
- name: Cache pip
47-
uses: actions/cache@v2
54+
uses: actions/cache@v4
4855
with:
49-
path: ${{ env.pythonLocation }}
50-
key: ${{ env.GHA_DISTRO }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }}
51-
- name: run syntax checks
52-
run: |
53-
flake8 .
54-
- name: build plugins
56+
path: ~/.cache/pip
57+
key: ${{ env.GHA_DISTRO }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}
58+
59+
- name: Install test dependencies
5560
run: |
56-
python setup.py develop
57-
- name: run unit tests
61+
python -m pip install poetry==2.1.2
62+
python -m pip install setuptools==80.1.0
63+
poetry install --without=docs --with=dev
64+
65+
- name: Run flake8
66+
run: poetry run flake8 .
67+
68+
- name: Run unit tests
5869
run: |
59-
py.test --cov-report term-missing --cov mfr tests
60-
- name: Upload coverage data to coveralls.io
61-
run: coveralls --service=github
70+
poetry run pytest --cov-report term-missing --cov mfr tests
71+
72+
- name: Upload coverage to Coveralls
73+
run: poetry run coveralls --service=github
6274
env:
6375
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
ChangeLog
33
*********
44

5+
25.0.0 (2025-11-18)
6+
===================
7+
- Upgrade MFR and dependencies to python v3.13.
8+
- Allow render jobs to be backgrounded and cached.
9+
- Switch from unoconv to unoserver; upgrade LibreOffice used to convert office files to pdf.
10+
- Switch to pyproject.toml and poetry.
11+
512
24.0.0 (2024-01-02)
613
===================
714
- Fix: Install ca-certificates-java in Dockerfile to fix image build.

Dockerfile

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
FROM python:3.6-slim-buster
1+
FROM python:3.13-slim
22

3-
# ensure unoconv can locate the uno library
4-
ENV PYTHONPATH /usr/lib/python3/dist-packages
53

64
RUN usermod -d /home www-data \
75
&& chown www-data:www-data /home \
8-
# -slim images strip man dirs, but java won't install unless this dir exists.
9-
&& mkdir -p /usr/share/man/man1 \
10-
&& apt-get update \
11-
# HACK: work around bug in install java (dep of libreoffice)
12-
&& apt-get install -y ca-certificates-java \
6+
&& apt-get update
7+
138
# mfr dependencies
14-
&& apt-get install -y \
9+
RUN apt-get install -y \
1510
git \
1611
make \
1712
gcc \
@@ -32,32 +27,31 @@ RUN usermod -d /home www-data \
3227
freecad \
3328
# pspp dependencies
3429
pspp \
35-
# unoconv dependencies
36-
libreoffice \
3730
# grab gosu for easy step-down from root
38-
gosu \
39-
&& apt-get clean \
40-
&& apt-get autoremove -y \
41-
&& rm -rf /var/lib/apt/lists/*
31+
gosu
32+
RUN apt-get clean
33+
RUN apt-get autoremove -y
34+
RUN rm -rf /var/lib/apt/lists/*
4235

4336
RUN mkdir -p /code
4437
WORKDIR /code
4538

46-
RUN pip install -U pip==18.1
47-
RUN pip install setuptools==37.0.0
48-
RUN pip install unoconv==0.8.2
39+
COPY pyproject.toml poetry.lock* /code/
4940

50-
COPY ./requirements.txt /code/
41+
ENV POETRY_NO_INTERACTION=1 \
42+
POETRY_VIRTUALENVS_CREATE=0 \
43+
POETRY_VIRTUALENVS_IN_PROJECT=1
5144

52-
RUN pip install --no-cache-dir -r ./requirements.txt
45+
RUN pip install poetry==2.1.2 setuptools==80.1.0 \
46+
&& poetry install --no-root --without=docs
5347

5448
# Copy the rest of the code over
5549
COPY ./ /code/
5650

5751
ARG GIT_COMMIT=
58-
ENV GIT_COMMIT ${GIT_COMMIT}
52+
ENV GIT_COMMIT=${GIT_COMMIT}
5953

60-
RUN python setup.py develop
54+
RUN poetry install --without=docs
6155

6256
EXPOSE 7778
6357

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,40 @@ A Python package for rendering files to HTML via an embeddable iframe.
88

99
### Compatibility
1010

11-
MFR is compatible with Python 3.6.
11+
MFR is compatible with Python 3.13.
1212

1313
### Documentation
1414

1515
Documentation available at: http://modular-file-renderer.readthedocs.io/en/latest/
1616

1717
### Setting up
1818

19-
Install the latest version of python3.6.
19+
Install the latest version of python3.13.
2020

2121
For MacOSX users:
2222

2323
```bash
24-
brew install python3
24+
brew install [email protected]
2525
# optional, needed for some converters
26-
brew install pspp unoconv
26+
brew install pspp libreoffice
2727
```
2828
For Ubuntu users:
2929

3030
```bash
31-
apt-get install python3
31+
apt-get install python3.13
3232
# optional, needed for some converters
33-
apt-get install pspp unoconv
33+
apt-get install pspp libreoffice
3434
```
3535

36-
After installing python3.6, create the virtual environment with the following commands:
36+
After installing python3.13, set up the project with the following commands:
3737

3838
```bash
39-
pip install virtualenv
40-
pip install virtualenvwrapper
41-
mkvirtualenv --python=`which python3.6` mfr
39+
pip install poetry
40+
poetry env use python3.13
41+
poetry install
4242

43-
pip install setuptools==37.0.0
44-
pip install invoke==0.13.0
45-
46-
invoke install
47-
invoke server
43+
poetry run invoke install
44+
poetry run invoke server
4845
```
4946

5047
### Configuring
@@ -80,8 +77,8 @@ If you encounter the error message `TypeError: throw() takes 2 positional argume
8077
Before running the tests, you will need to install some additional requirements. In your checkout, run:
8178

8279
```bash
83-
invoke install --develop
84-
invoke test
80+
poetry run invoke install --develop
81+
poetry run invoke test
8582
```
8683

8784
### Known issues
@@ -98,7 +95,7 @@ Interested in adding support for a new provider or file format? Check out the CO
9895

9996
### License
10097

101-
Copyright 2013-2023 Center for Open Science
98+
Copyright 2013-2025 Center for Open Science
10299

103100
Licensed under the Apache License, Version 2.0 (the "License");
104101
you may not use this file except in compliance with the License.

constraints.txt

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

dev-requirements.txt

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

doc-requirements.txt

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

docs/conf.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# MFR documentation build configuration file.
43
#
@@ -31,7 +30,7 @@
3130

3231
# Add any Sphinx extension module names here, as strings. They can be extensions
3332
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
33+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'stevedore.sphinxext']
3534

3635
# Add any paths that contain templates here, relative to this directory.
3736
templates_path = ['_templates']
@@ -46,8 +45,8 @@
4645
master_doc = 'index'
4746

4847
# General information about the project.
49-
project = u'mfr'
50-
copyright = u'2023, Center For Open Science'
48+
project = 'mfr'
49+
copyright = '2025, Center For Open Science'
5150

5251
# The version info for the project you're documenting, acts as replacement for
5352
# |version| and |release|, also used in various other places throughout the
@@ -177,12 +176,7 @@
177176
# Output file base name for HTML help builder.
178177
htmlhelp_basename = 'mfrdoc'
179178

179+
# This block will use the same theme when building locally as on RTD.
180180
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
181-
182-
# On RTD we can't import sphinx_rtd_theme, but it will be applied by
183-
# default anyway. This block will use the same theme when building locally
184-
# as on RTD.
185181
if not on_rtd:
186-
import sphinx_rtd_theme
187182
html_theme = 'sphinx_rtd_theme'
188-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

docs/extensions.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ CodePygmentsRenderer
1111

1212
.. autoclass:: mfr.extensions.codepygments.CodePygmentsRenderer
1313

14-
DocxRenderer
15-
------------
16-
17-
.. autoclass:: mfr.extensions.docx.DocxRenderer
18-
1914
ImageExporter
2015
-------------
2116

0 commit comments

Comments
 (0)