Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
de59e1e
ENG-7595 Update MFR Dockerfile and (dev-)requirements.txt files to ma…
mkovalua Apr 23, 2025
dc995b9
raven is outdated for py3.13 replace it with sentry_sdk to make it po…
mkovalua Apr 23, 2025
943e5f7
fix some dockerfile lints
felliott Apr 29, 2025
f6b1adf
Merge branch 'feature/dockerfile-updates' into feature/buff-worms
felliott Apr 29, 2025
44b707c
fix Deprecated function, class, or module
mkovalua Apr 23, 2025
2466680
fix incorrect call arguments
mkovalua Apr 23, 2025
9159990
fix Deprecated function, class, or module
mkovalua Apr 24, 2025
be346fa
fix Incorrect type
mkovalua Apr 24, 2025
672260c
fix Unbound local variables
mkovalua Apr 24, 2025
389c57a
use pip install pyupgrade and find . -type f -name '*.py' -exec pyupg…
mkovalua Apr 24, 2025
12cc556
fix single quoted docstring
mkovalua Apr 24, 2025
9eccd05
fix shadowing names from outer scopes
mkovalua Apr 24, 2025
b1fc8a3
fix redundant parentheses
mkovalua Apr 24, 2025
21af2e0
fix shadowing build in names
mkovalua Apr 24, 2025
c6a9490
fix Method is not declared static
mkovalua Apr 24, 2025
ab37d31
Todo: Qodana told about Dictionary can be rewritten by dictionary lit…
mkovalua Apr 24, 2025
0e3ca91
# Todo: not see Name implementation in child classes
mkovalua Apr 24, 2025
106e3de
# Todo: maybe it is needed to use logger and specific message for exc…
mkovalua Apr 24, 2025
9c6fb7c
fix Incorrect docstring (not confident about 'action' and 'metadata' …
mkovalua Apr 24, 2025
c3925b7
add todo about mismatched signature
mkovalua Apr 24, 2025
87b5366
Merge branch 'feature/py3.13-syntax-deprecations' into feature/buff-w…
felliott Apr 29, 2025
1ce7762
Fixup Github Actions to start to run
mkovalua Apr 25, 2025
8426f5b
ci/cd yml update
mkovalua Apr 25, 2025
4aa8b94
Update test-build.yml
mkovalua Apr 25, 2025
e51d9ad
Merge branch 'feature/update-gh-ci' into feature/buff-worms
felliott Apr 29, 2025
651f07e
update MFR dev-requirements.txt
mkovalua Apr 25, 2025
48ff1a0
update MFR doc-requirements.txt
mkovalua Apr 28, 2025
d722f6f
Merge branch 'feature/dep-group-dev-doc' into feature/buff-worms
felliott Apr 29, 2025
f978ec2
Bump dependencies for ext-code and ext-doc
futa-ikeda May 12, 2025
3dbe97e
Merge branch 'feature/dep-group-ext-code-doc' into feature/buff-worms
felliott May 19, 2025
1b4da16
ENG-7603 upgrade infra deps
mkovalua May 30, 2025
99ac9cc
Merge branch 'feature/dep-group-infra' into feature/buff-worms
felliott Jun 14, 2025
1e7e46f
[tool:pytest] is a way to work with python3.13
mkovalua Jun 3, 2025
1476ce7
update test requirements
mkovalua Jun 4, 2025
2a561f2
fix bad async with call for py3.13
mkovalua Jun 4, 2025
9ab77ae
replace ContentEncodingError for python3.13
mkovalua Jun 4, 2025
ec8a0d2
Merge branch 'feature/dep-group-tests' into feature/buff-worms
felliott Jun 14, 2025
e5d4bdc
ENG-7602 | MFR Dep-group 4 upgrade: ext-tabular + util
sh-andriy Jun 4, 2025
eed2348
Merge branch 'feature/dep-group-tabular-util' into feature/buff-worms
felliott Jun 14, 2025
536efe0
fix for py3.13: don't await aiohttp.request
mkovalua Jun 5, 2025
715b3de
Todo: for possible agent lib removal
mkovalua Jun 5, 2025
9b22a5d
Merge branch 'feature/dep-group-wb' into feature/buff-worms
felliott Jun 14, 2025
89ca7c1
Match existing requirements to pinned WB versions
futa-ikeda Jun 5, 2025
f8102ad
Remove imghdr related test failures
futa-ikeda Jun 5, 2025
cafc909
Update image related dependencies
futa-ikeda Jun 5, 2025
851fa80
Update ipython dep group
futa-ikeda Jun 9, 2025
211c03a
Deprecation updates
futa-ikeda Jun 9, 2025
c0925a9
Update tests to not call fixtures directly
futa-ikeda Jun 9, 2025
4013211
Some test fixes
futa-ikeda Jun 12, 2025
28dea64
Fix ipynb test failures
futa-ikeda Jun 12, 2025
0127867
Fix md tests
futa-ikeda Jun 12, 2025
fa2c865
Update bmp test
futa-ikeda Jun 12, 2025
9eb5c7a
Remove pydocx dependency
futa-ikeda Jun 13, 2025
adc4bc2
Merge branch 'feature/dep-group-image-ipy' into feature/buff-worms
felliott Jun 14, 2025
5e2595f
ENG-7737 | MFR convert to Poetry
sh-andriy Jun 11, 2025
6f84694
update poetry deps after dep-group updates
felliott Jun 14, 2025
2df7510
Merge branch 'feature/mfr-poetry' into feature/buff-worms
felliott Jun 14, 2025
55e7f46
fix wrong fixture call usage in tabular t
mkovalua Jun 12, 2025
fe7453c
fix 0 index access error
mkovalua Jun 13, 2025
ef7940e
update deprecated arg in ipynb renderer
mkovalua Jun 13, 2025
c6e6503
update how markdown deregisters html blocks
mkovalua Jun 13, 2025
773079a
update pandas tabular tool
mkovalua Jun 13, 2025
4fe4322
fix testing event loop error
mkovalua Jun 18, 2025
ad99d26
fix xrld tabular renderer tool
sh-andriy Jun 18, 2025
b33ab5b
remove unused pydocx from deps
futa-ikeda Jun 13, 2025
6e51aac
fix syntax in sentry handling of errors
mkovalua Jun 18, 2025
7b2dcc3
fix flake8 remarks to run tests
mkovalua Jun 23, 2025
e85dd26
infra: update mfr installation method
mkovalua Jun 24, 2025
1d49a28
infra: try switching to implicit namespaces
mkovalua Jun 24, 2025
684aa96
infra: update license declaration
felliott Jul 7, 2025
b585dde
infra: use egg_info
mkovalua Jun 24, 2025
7406f82
tests: fix up some deprecation warnings
felliott Jul 7, 2025
7ca4004
Merge branch 'feature/fix-mfr-tests' into feature/buff-worms
felliott Jul 7, 2025
5953766
fixed mfr rendering files
opaduchak Jul 17, 2025
1eff57f
fixed ci and flake8
opaduchak Jul 17, 2025
45bc54d
fixed tests
opaduchak Jul 17, 2025
1b3510e
Merge branch 'feature/toolchain-updates' into feature/buff-worms
felliott Jul 17, 2025
fea43c1
added celery to mfr
opaduchak Jul 18, 2025
6a1dc10
fixed flake8
opaduchak Jul 18, 2025
ecfe0e9
added concurrency option
opaduchak Jul 18, 2025
34340cd
Merge branch 'feature/mfr-worker' into feature/buff-worms
felliott Jul 22, 2025
12277e4
ENG-8355 | MFR Update libreoffice version in dockerfile
sh-andriy Jul 15, 2025
72a927c
Merge branch 'feature/upgrade-lo' into feature/buff-worms
felliott Jul 22, 2025
ed1b701
ENG-8357 replace unoconv with unoserver
mkovalua Jul 16, 2025
8aa8251
Merge branch 'feature/unoserver-update' into feature/buff-worms
felliott Jul 25, 2025
96ece99
fixed files with cyrillic names not rendering
opaduchak Jul 26, 2025
d3cd6e4
made content-dispositon header use modern filename* syntax
opaduchak Jul 28, 2025
46f5c3b
fixed filename=* syntax
opaduchak Jul 28, 2025
ffaba86
Merge pull request #392 from opaduchak/fix/ENG-8472
opaduchak Jul 29, 2025
d4da5a8
[ENG-8475] Fix unable to render spreadsheet files (.xls and .xlsx) (#…
sh-andriy Jul 29, 2025
92a05d9
fix(mfr): fix not all xlsx files render error
sh-andriy Jul 30, 2025
dc2a053
Merge pull request #394 from sh-andriy/fix/xlsx-file-render-error
opaduchak Jul 30, 2025
66b1859
[ENG-8488] MFR: .xlsx file not rendering correctly in OSF Storage (#…
opaduchak Aug 4, 2025
231f5be
[ENG-8489] Enforce MAX_SIZE on .xls rendering just like was on .xlsx …
sh-andriy Aug 5, 2025
a54c91a
[ENG-8501] Upgrade tornado version to "6.5.1" (#399)
mkovalua Aug 12, 2025
9e2e128
[ENG-8488] Fix inconsistent Excel rendering by enforcing binary mode …
sh-andriy Aug 12, 2025
5fa2054
ENG-8426 | Update README with Poetry-based setup steps for local MFR …
sh-andriy Aug 12, 2025
7d7caad
Merge branch 'feature/update-readme' into feature/buff-worms
felliott Aug 17, 2025
73b02b7
Update readthedocs config
Vlad0n20 Aug 13, 2025
3fa803e
update sphinx documentation meta and build
felliott Aug 17, 2025
6498822
Merge branch 'feature/rtd-updates' into feature/buff-worms
felliott Aug 17, 2025
18c07ca
flake fix in rtd conf
felliott Aug 20, 2025
374d392
Merge branch 'feature/rtd-flake-fix' into feature/buff-worms
felliott Aug 20, 2025
983f5ce
removed libreoffice install from dockerfile
opaduchak Aug 20, 2025
69b7309
Merge branch 'feature/fix-docker-build' into feature/buff-worms
felliott Aug 20, 2025
c7b3018
add ruff formatting option
mkovalua Aug 8, 2025
5fd07dc
remove redundant extend-ignore constraints
mkovalua Aug 12, 2025
a080e58
Merge branch 'feature/ruff-support' into feature/buff-worms
felliott Aug 21, 2025
7b643df
Added Celery-powered render
opaduchak Jul 23, 2025
0f0b4e8
Merge branch 'feature/unoserver-celery' into feature/buff-worms
felliott Sep 9, 2025
e9f9e06
ENG-8627 | Fix .3ds files not rendering in MFR viewer
sh-andriy Aug 20, 2025
aea8068
Merge branch 'feature/fix-3ds' into feature/buff-worms
felliott Oct 17, 2025
7ff05de
Fix search in .xlsx files
Vlad0n20 Aug 22, 2025
2ddf4a9
Merge branch 'feature/fix-xlsx-search' into feature/buff-worms
felliott Oct 21, 2025
9006ee7
update wb dep for oathpit workaround
felliott Nov 18, 2025
8e3a82a
Merge branch 'feature/oathpit' into feature/buff-worms
felliott Nov 18, 2025
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.pyc
**/*.pyc
Dockerfile
*venv*
72 changes: 42 additions & 30 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,71 @@ on: [push, pull_request, workflow_dispatch]
jobs:

build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
GHA_DISTRO: ubuntu-20.04
GHA_DISTRO: ubuntu-24.04
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python-version: [3.6]
python-version: [3.13]
steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache Build Requirements
id: pip-cache-step
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.GHA_DISTRO }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }}
- name: install dependencies
if: steps.pip-cache-step.outputs.cache-hit != 'true'
path: ~/.cache/pip
key: ${{ env.GHA_DISTRO }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
python -m pip install poetry==2.1.2 setuptools==80.1.0
poetry install --no-root --without=docs --with=dev

runtests:
name: Run unit tests
needs: build
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
GHA_DISTRO: ubuntu-20.04
GHA_DISTRO: ubuntu-24.04
strategy:
matrix:
python-version: [3.13]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.6
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.GHA_DISTRO }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }}
- name: run syntax checks
run: |
flake8 .
- name: build plugins
path: ~/.cache/pip
key: ${{ env.GHA_DISTRO }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}

- name: Install test dependencies
run: |
python setup.py develop
- name: run unit tests
python -m pip install poetry==2.1.2
python -m pip install setuptools==80.1.0
poetry install --without=docs --with=dev

- name: Run flake8
run: poetry run flake8 .

- name: Run unit tests
run: |
py.test --cov-report term-missing --cov mfr tests
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
poetry run pytest --cov-report term-missing --cov mfr tests

- name: Upload coverage to Coveralls
run: poetry run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 16 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
FROM python:3.6-slim-buster
FROM python:3.13-slim

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

RUN usermod -d /home www-data \
&& chown www-data:www-data /home \
# -slim images strip man dirs, but java won't install unless this dir exists.
&& mkdir -p /usr/share/man/man1 \
&& apt-get update \
# HACK: work around bug in install java (dep of libreoffice)
&& apt-get install -y ca-certificates-java \
&& apt-get update

# mfr dependencies
&& apt-get install -y \
RUN apt-get install -y \
git \
make \
gcc \
Expand All @@ -32,32 +27,31 @@ RUN usermod -d /home www-data \
freecad \
# pspp dependencies
pspp \
# unoconv dependencies
libreoffice \
# grab gosu for easy step-down from root
gosu \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
gosu
RUN apt-get clean
RUN apt-get autoremove -y
RUN rm -rf /var/lib/apt/lists/*

RUN mkdir -p /code
WORKDIR /code

RUN pip install -U pip==18.1
RUN pip install setuptools==37.0.0
RUN pip install unoconv==0.8.2
COPY pyproject.toml poetry.lock* /code/

COPY ./requirements.txt /code/
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=0 \
POETRY_VIRTUALENVS_IN_PROJECT=1

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

# Copy the rest of the code over
COPY ./ /code/

ARG GIT_COMMIT=
ENV GIT_COMMIT ${GIT_COMMIT}
ENV GIT_COMMIT=${GIT_COMMIT}

RUN python setup.py develop
RUN poetry install --without=docs

EXPOSE 7778

Expand Down
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,40 @@ A Python package for rendering files to HTML via an embeddable iframe.

### Compatibility

MFR is compatible with Python 3.6.
MFR is compatible with Python 3.13.

### Documentation

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

### Setting up

Install the latest version of python3.6.
Install the latest version of python3.13.

For MacOSX users:

```bash
brew install python3
brew install python@3.13
# optional, needed for some converters
brew install pspp unoconv
brew install pspp libreoffice
```
For Ubuntu users:

```bash
apt-get install python3
apt-get install python3.13
# optional, needed for some converters
apt-get install pspp unoconv
apt-get install pspp libreoffice
```

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

```bash
pip install virtualenv
pip install virtualenvwrapper
mkvirtualenv --python=`which python3.6` mfr
pip install poetry
poetry env use python3.13
poetry install

pip install setuptools==37.0.0
pip install invoke==0.13.0

invoke install
invoke server
poetry run invoke install
poetry run invoke server
```

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

```bash
invoke install --develop
invoke test
poetry run invoke install --develop
poetry run invoke test
```

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

### License

Copyright 2013-2023 Center for Open Science
Copyright 2013-2025 Center for Open Science

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
7 changes: 0 additions & 7 deletions constraints.txt

This file was deleted.

16 changes: 0 additions & 16 deletions dev-requirements.txt

This file was deleted.

3 changes: 0 additions & 3 deletions doc-requirements.txt

This file was deleted.

14 changes: 4 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# MFR documentation build configuration file.
#
Expand Down Expand Up @@ -31,7 +30,7 @@

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

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

# General information about the project.
project = u'mfr'
copyright = u'2023, Center For Open Science'
project = 'mfr'
copyright = '2025, Center For Open Science'

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

# This block will use the same theme when building locally as on RTD.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

# On RTD we can't import sphinx_rtd_theme, but it will be applied by
# default anyway. This block will use the same theme when building locally
# as on RTD.
if not on_rtd:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
5 changes: 0 additions & 5 deletions docs/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ CodePygmentsRenderer

.. autoclass:: mfr.extensions.codepygments.CodePygmentsRenderer

DocxRenderer
------------

.. autoclass:: mfr.extensions.docx.DocxRenderer

ImageExporter
-------------

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Guide
overview
integrations
code
plugins

Project info
------------
Expand Down
13 changes: 6 additions & 7 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@ Or download one of the following:
* tarball_
* zipball_

Make sure that you have installed `pspp <https://www.gnu.org/software/pspp/>`_ and are using python 3.5 or greater.
Make sure that you have installed `pspp <https://www.gnu.org/software/pspp/>`_ and are using python v3.13 or greater.

Install the versions of ``setuptools`` and ``invoke`` found in the requirements.txt file:
Install ``poetry`` to manage dependencies:

.. code-block:: bash

pip install setuptools==37.0.0
pip install invoke==0.13.0
pip install poetry==2.1.2

Install requirements:

.. code-block:: bash

invoke install
poetry install

Or for some nicities (like tests):

.. code-block:: bash

invoke install --develop
poetry install --with dev

Start the server:

Expand All @@ -45,7 +44,7 @@ Start the server:

.. code-block:: bash

invoke server
poetry run invoke server

.. _Github: https://github.com/CenterForOpenScience/modular-file-renderer
.. _tarball: https://github.com/CenterForOpenScience/modular-file-renderer/tarball/master
Expand Down
20 changes: 20 additions & 0 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Plugins
-------

Auth Providers
==============

.. list-plugins:: mfr.providers
:detailed:

Exporters
=========

.. list-plugins:: mfr.exporters

Renderers
=========

.. list-plugins:: mfr.renderers

Loading