-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue for building docker container #91
Changes from 9 commits
cd8f921
e19013e
58b8c44
8e7a728
4928c5d
e143a88
ee8790b
64449ef
5146354
512fa65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,39 +3,47 @@ FROM texlive/texlive:latest | |
# labels | ||
LABEL AUTHOR='Luc Laurent' | ||
LABEL MAINTAINER='Luc Laurent & Benoit Nennig' | ||
LABEL org.opencontainers.image.source = "https://github.com/nennigb/amc2moodle/" | ||
LABEL org.opencontainers.image.source="https://github.com/nennigb/amc2moodle/" | ||
|
||
# declare useful directories using environement | ||
ENV MONITOR_DIR=/tmp/work | ||
ENV LOG_DIR=/tmp/daemon | ||
ENV INSTALL_DIR_A2M=/tmp/amc2moodle | ||
ENV VENVDIR=/tmp/venv | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# install debian packages | ||
RUN apt update && \ | ||
apt install -yy wget ghostscript imagemagick libtext-unidecode-perl latexml xmlindent python3-pip git && \ | ||
apt clean | ||
apt install -yy wget \ | ||
ghostscript \ | ||
imagemagick \ | ||
libtext-unidecode-perl \ | ||
latexml \ | ||
xmlindent \ | ||
python3-pip \ | ||
python3-venv \ | ||
git && \ | ||
apt clean &&\ | ||
rm -rf /var/lib/{apt,dpkg,cache,log}/ | ||
|
||
# move policy file | ||
RUN mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.off | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On my tests, docker install imageMagick 7 thus the path is wrong.
https://imagemagick.org/script/security-policy.php Normally it should be catch in the unittests with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
|
||
# install pip and Python pkg | ||
# RUN pip3 install -U pip && \ | ||
# pip install amc2moodle | ||
WORKDIR /tmp | ||
RUN git clone https://github.com/nennigb/amc2moodle.git -b master ${INSTALL_DIR_A2M} | ||
WORKDIR ${INSTALL_DIR_A2M} | ||
RUN pip3 install -U pip && \ | ||
pip3 install . | ||
RUN mkdir -p ${VENVDIR} && \ | ||
python -m venv ${VENVDIR} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why installing the package in a venv ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in order to avoid "error: externally-managed-environment" when use the system python/pip There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok :-) |
||
ENV PATH="${VENVDIR}/bin:$PATH" | ||
RUN pip install -U pip && \ | ||
pip install '.[test]' | ||
|
||
# check if amc2moodle and moodle2amc work | ||
WORKDIR / | ||
ENV TEXINPUTS=.:${INSTALL_DIR_A2M}/amc2moodle/moodle2amc/test:$TEXINPUTS | ||
ENV TEXINPUTS=.:${INSTALL_DIR_A2M}/amc2moodle/tests/payload_test_moodle2amc/:${TEXINPUTS} | ||
RUN echo ${TEXINPUTS} | ||
RUN python -m amc2moodle.amc2moodle.test && \ | ||
python -m amc2moodle.utils.test && \ | ||
python -m amc2moodle.moodle2amc.test | ||
|
||
|
||
RUN python -m pytest --pyargs amc2moodle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI will fail until
will be merged into the master branch used for docker build. |
||
|
||
# create dir | ||
RUN mkdir ${MONITOR_DIR} && \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,10 @@ dependencies = [ | |
] | ||
requires-python='>=3.8' | ||
|
||
[project.optional-dependencies] | ||
test = ["pytest", "pytest-cov[all]"] | ||
lint = [ "black", "flake8"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default hatch default is line 120, which looks good for me. It could be put in the
I prefer simple quotes which is the present convention and looks less bulky.
If we choose ruff, we need to modify the readme. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I add it |
||
|
||
[project.urls] | ||
Homepage = "https://github.com/nennigb/amc2moodle" | ||
Repository = "https://github.com/nennigb/amc2moodle" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use apt-get (to avoid WARNING: apt does not have a stable CLI interface. Use with caution in scripts.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed