Skip to content

Commit

Permalink
move tests folder in packages folder + rewrite pyproject.toml to work…
Browse files Browse the repository at this point in the history
… with pdm-backend + add tests' settings for vscode
  • Loading branch information
luclaurent committed Oct 9, 2024
1 parent 91f263b commit d3c7c31
Show file tree
Hide file tree
Showing 29 changed files with 67 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Byte-code
__pycache__/
**/__pycache__/
*.py[cod]

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

# pdoc
html/
Expand Down Expand Up @@ -40,3 +42,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
}
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.
File renamed without changes.
File renamed without changes.
55 changes: 49 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[project]
name = "amc2moodle"
Expand Down Expand Up @@ -35,11 +35,54 @@ Issues = "https://github.com/nennigb/amc2moodle/issues"
amc2moodle = "amc2moodle.amc2moodle.bin.amc2moodle:run"
moodle2amc = "amc2moodle.moodle2amc.bin.moodle2amc:run"

[tool.setuptools.dynamic]
version = {attr = "amc2moodle.__version__"}
[tool.pdm.version]
source = "file"
path = "amc2moodle/_version.py"

[tool.setuptools]
package-dir = { "amc2moodle" = "amc2moodle", "amc2moodle.tests" = "tests"}
[tool.pdm.build]
source-includes = [
"LICENSE",
"README.md"
]
includes = [
"amc2moodle/",
"amc2moodle/moodle2amc/README.md",
"amc2moodle/amc2moodle/README.md",
"amc2moodle/amc2moodle/bin/amc2moodle",
"amc2moodle/amc2moodle/*.xslt",
"amc2moodle/amc2moodle/*sty.ltxml",
"amc2moodle/moodle2amc/bin/moodle2amc",
"amc2moodle/moodle2amc/html2tex.xslt",
"amc2moodle/moodle2amc/struc2tex.xslt",
"amc2moodle/tests/payload_test_amc2moodle/Figures/*",
"amc2moodle/tests/payload_test_amc2moodle/Figures/other/*",
"amc2moodle/tests/payload_test_amc2moodle/4.png",
"amc2moodle/tests/payload_test_amc2moodle/QCM.pdf",
"amc2moodle/tests/payload_test_amc2moodle/QCM.tex",
"amc2moodle/tests/payload_test_amc2moodle/QCM.xml",
"amc2moodle/tests/payload_test_amc2moodle/QCM_wo-tikz.tex",
"amc2moodle/tests/payload_test_amc2moodle/QCM_wo-tikz.xml",
"amc2moodle/tests/payload_test_amc2moodle/tikz.tex",
"amc2moodle/tests/payload_test_amc2moodle/common-bank.tex",
"amc2moodle/tests/payload_test_amc2moodle/numerical.tex",
"amc2moodle/tests/payload_test_amc2moodle/numerical.xml",
"amc2moodle/tests/payload_test_amc2moodle/cleaning.tex",
"amc2moodle/tests/payload_test_amc2moodle/cleaning.xml",
"amc2moodle/tests/payload_test_amc2moodle/element.tex",
"amc2moodle/tests/payload_test_amc2moodle/includestyles.tex",
"amc2moodle/tests/payload_test_moodle2amc/automultiplechoice.sty",
"amc2moodle/tests/payload_test_moodle2amc/moodle-bank-exemple.xml",
"amc2moodle/tests/payload_test_moodle2amc/moodle-bank-exemple.tex",
"amc2moodle/tests/payload_test_moodle2amc/moodle-bank-exemple.pdf"
]
excludes = [
"**/*_magic.tex",
"**/xmlclean*",
"**/__pycache__"
]

# [tool.setuptools]
# package-dir = { "amc2moodle" = "amc2moodle", "amc2moodle.tests" = "tests"}

[tool.coverage.run]
branch = true
Expand Down

0 comments on commit d3c7c31

Please sign in to comment.