- Test:
pytest -vv(all tests) orpytest tests/test_<name>.py -vv(single test file) - Test with coverage:
pytest --cov=json2xml --cov-report=xml:coverage/reports/coverage.xml --cov-report=term -xvs - Lint:
ruff check json2xml tests - Type check:
uvx ty check json2xml tests - Test all Python versions:
tox - Clean artifacts:
make clean
- Main module:
json2xml/withjson2xml.py(main converter),dicttoxml.py(core conversion),utils.py(utilities) - Core functionality: JSON to XML conversion via
Json2xmlclass wrappingdicttoxml - Tests:
tests/with test files followingtest_*.pypattern
- Always add typing annotations to functions/classes with descriptive docstrings (PEP 257)
- Use pytest (no unittest), all tests in
./tests/with typing annotations - Import typing fixtures when TYPE_CHECKING:
CaptureFixture,FixtureRequest,LogCaptureFixture,MonkeyPatch,MockerFixture - Ruff formatting: line length 119, ignores E501, F403, E701, F401
- Python 3.10+ required, supports up to 3.14 (including 3.14t freethreaded)
- Dependencies: defusedxml, urllib3, xmltodict, pytest, pytest-cov