Skip to content

Commit

Permalink
merge from new setup version
Browse files Browse the repository at this point in the history
  • Loading branch information
luclaurent committed Nov 29, 2024
2 parents 6789a93 + 33ba3ac commit 1c8aab5
Show file tree
Hide file tree
Showing 37 changed files with 282 additions and 184 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/ci-mac-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
run: |
# xstring is just required for testing --includestyles
sudo tlmgr update --self
sudo tlmgr install collection-fontsrecommended bophook xstring
sudo tlmgr install collection-fontsrecommended bophook xstring --verify-repo=none
- name: Test latexml
run: |
# add --strict flag to be more strict in error catching
latexml --noparse --nocomment --strict --path=./amc2moodle/amc2moodle --dest=./out.xml ./amc2moodle/amc2moodle/test/QCM.tex
latexml --noparse --nocomment --strict --path=./amc2moodle/amc2moodle --dest=./out.xml ./amc2moodle/tests/payload_test_amc2moodle/QCM.tex
- name: Install amc2moodle
run: |
Expand All @@ -68,16 +68,19 @@ jobs:
- name: Test amc2moodle
run: |
python -m amc2moodle.amc2moodle.test
python -m amc2moodle.tests.test_amc2moodle
- name: Test moodle2amc
run: |
# add automultiplechoice.sty local copy to LaTeX PATH (for this step)
export TEXINPUTS=.:./amc2moodle/moodle2amc/test:$TEXINPUTS
python -m amc2moodle.moodle2amc.test
# export TEXINPUTS=.:./tests/payload_test_amc2moodle/:$TEXINPUTS (during tests, automultiplechoice.sty is copied in the temporary test folder )
python -m amc2moodle.tests.test_moodle2amc
- name: Test text parser
run: |
python -m amc2moodle.tests.test_utils_text
- name: Test calculated questions parsers
run: |
python -m amc2moodle.utils.test
python -m amc2moodle.tests.test_utils_calculatedParser
# Store output files
Expand All @@ -87,20 +90,20 @@ jobs:
uses: actions/upload-artifact@main
with:
name: test_notikz_${{ matrix.python-version }}
path: test_notikz.xml
path: output_tests/test_notikz.xml

- name: Archive XML test output of amc2moodle (with tikz)
if: ${{ always() }}
uses: actions/upload-artifact@main
with:
name: test_tikz_${{ matrix.python-version }}
path: test_tikz.xml
path: output_tests/test_tikz.xml
# moodle2amc
- name: Move latex output
if: ${{ always() }}
run: |
mkdir moodle-bank-exemple-output
mv test_moodle-bank-exemple.* moodle-bank-exemple-output/
mv output_tests/test_moodle-bank-exemple.* moodle-bank-exemple-output/
- name: Archive LaTeX test output (moodle2amc)
if: ${{ always() }}
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Test latexml
run: |
# add --strict flag to be more strict in error catching
latexml --noparse --nocomment --strict --path=./amc2moodle/amc2moodle --dest=./out.xml ./amc2moodle/amc2moodle/test/QCM.tex
latexml --noparse --nocomment --strict --path=./amc2moodle/amc2moodle --dest=./out.xml ./amc2moodle/tests/payload_test_amc2moodle/QCM.tex
- name: Install amc2moodle
run: |
Expand All @@ -64,15 +64,18 @@ jobs:
- name: Test amc2moodle
run: |
python -m amc2moodle.amc2moodle.test
python -m amc2moodle.tests.test_amc2moodle
- name: Test moodle2amc
run: |
# add automultiplechoice.sty local copy to LaTeX PATH (for this step)
export TEXINPUTS=.:./amc2moodle/moodle2amc/test:$TEXINPUTS
python -m amc2moodle.moodle2amc.test
# export TEXINPUTS=.:./tests/payload_test_amc2moodle/:$TEXINPUTS (during tests, automultiplechoice.sty is copied in the temproary test folder )
python -m amc2moodle.tests.test_moodle2amc
- name: Test text parser
run: |
python -m amc2moodle.tests.test_utils_text
- name: Test calculated questions parsers
run: |
python -m amc2moodle.utils.test
python -m amc2moodle.tests.test_utils_calculatedParser
# Store output files
# amc2moodle
Expand All @@ -81,20 +84,20 @@ jobs:
uses: actions/upload-artifact@main
with:
name: test_notikz_${{ matrix.python-version }}
path: test_notikz.xml
path: output_tests/test_notikz.xml

- name: Archive XML test output of amc2moodle (with tikz)
if: ${{ always() }}
uses: actions/upload-artifact@main
with:
name: test_tikz_${{ matrix.python-version }}
path: test_tikz.xml
path: output_tests/test_tikz.xml
# moodle2amc
- name: Move latex output
if: ${{ always() }}
run: |
mkdir moodle-bank-exemple-output
mv test_moodle-bank-exemple.* moodle-bank-exemple-output/
mv output_tests/test_moodle-bank-exemple.* moodle-bank-exemple-output/
- name: Archive LaTeX test output (moodle2amc)
if: ${{ always() }}
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Byte-code
__pycache__/
**/__pycache__/
*.py[cod]
.coverage
.pytest_cache/

# Distribution / packaging
*.egg-info/
build/
dist/

# pdoc
html/
Expand Down Expand Up @@ -40,3 +44,8 @@ html/
*.mtc1
*.out
*.synctex*

# specific amc2moodle artifacts
**/xmlclean*
**/*_magic.tex
output_tests/
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./amc2moodle/tests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true
}
40 changes: 20 additions & 20 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ include amc2moodle/amc2moodle/README.md
include amc2moodle/amc2moodle/bin/amc2moodle
include amc2moodle/amc2moodle/*.xslt
include amc2moodle/amc2moodle/*sty.ltxml
include amc2moodle/amc2moodle/test/Figures/*
include amc2moodle/amc2moodle/test/Figures/other/*
include amc2moodle/amc2moodle/test/4.png
include amc2moodle/amc2moodle/test/QCM.pdf
include amc2moodle/amc2moodle/test/QCM.tex
include amc2moodle/amc2moodle/test/QCM.xml
include amc2moodle/amc2moodle/test/QCM_wo-tikz.tex
include amc2moodle/amc2moodle/test/QCM_wo-tikz.xml
include amc2moodle/amc2moodle/test/tikz.tex
include amc2moodle/amc2moodle/test/common-bank.tex
include amc2moodle/amc2moodle/test/numerical.tex
include amc2moodle/amc2moodle/test/numerical.xml
include amc2moodle/amc2moodle/test/cleaning.tex
include amc2moodle/amc2moodle/test/cleaning.xml
include amc2moodle/amc2moodle/test/element.tex
include amc2moodle/amc2moodle/test/includestyles.tex
include tests/payload_test_amc2moodle/Figures/*
include tests/payload_test_amc2moodle/Figures/other/*
include tests/payload_test_amc2moodle/4.png
include tests/payload_test_amc2moodle/QCM.pdf
include tests/payload_test_amc2moodle/QCM.tex
include tests/payload_test_amc2moodle/QCM.xml
include tests/payload_test_amc2moodle/QCM_wo-tikz.tex
include tests/payload_test_amc2moodle/QCM_wo-tikz.xml
include tests/payload_test_amc2moodle/tikz.tex
include tests/payload_test_amc2moodle/common-bank.tex
include tests/payload_test_amc2moodle/numerical.tex
include tests/payload_test_amc2moodle/numerical.xml
include tests/payload_test_amc2moodle/cleaning.tex
include tests/payload_test_amc2moodle/cleaning.xml
include tests/payload_test_amc2moodle/element.tex
include tests/payload_test_amc2moodle/includestyles.tex
include amc2moodle/moodle2amc/bin/moodle2amc
include amc2moodle/moodle2amc/html2tex.xslt
include amc2moodle/moodle2amc/struc2tex.xslt
include amc2moodle/moodle2amc/test/automultiplechoice.sty
include amc2moodle/moodle2amc/test/moodle-bank-exemple.xml
include amc2moodle/moodle2amc/test/moodle-bank-exemple.tex
include amc2moodle/moodle2amc/test/moodle-bank-exemple.pdf
include tests/payload_test_moodle2amc/automultiplechoice.sty
include tests/payload_test_moodle2amc/moodle-bank-exemple.xml
include tests/payload_test_moodle2amc/moodle-bank-exemple.tex
include tests/payload_test_moodle2amc/moodle-bank-exemple.pdf

2 changes: 1 addition & 1 deletion amc2moodle/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.10.4'
__version__ = '2.11.0'
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions amc2moodle/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
This file is part of amc2moodle, a convertion tool to recast quiz written
with the LaTeX format used by automuliplechoice 1.0.3 into the
moodle XML quiz format.
Copyright (C) 2016 Benoit Nennig, benoit.nennig@supmeca.fr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from .test_amc2moodle import *
from .test_moodle2amc import *
from .test_utils_calculatedParser import *
from .test_utils_text import *
# import glob
# import unittest
# import os

# # run all tests
# test_files = glob.glob(os.path.abspath(os.path.join(os.getcwd(),'test_*.py')))
# module_strings = [test_file[0:len(test_file)-3] for test_file in test_files]
# suites = [unittest.defaultTestLoader.loadTestsFromName(test_file) for test_file in module_strings]
# test_suite = unittest.TestSuite(suites)

# # Run autonomous
# if __name__ == '__main__':
# test_runner = unittest.TextTestRunner().run(test_suite)
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 1c8aab5

Please sign in to comment.