Skip to content

fix: include xml in wheel/sdist; Segement tag positional; optional validate - #155

Merged
nerdoc merged 4 commits into
nerdocs:masterfrom
tammoippen:fix/include-xml-fix-typing-validate
Sep 21, 2026
Merged

nerdoc merged 4 commits into
nerdocs:masterfrom
tammoippen:fix/include-xml-fix-typing-validate

Conversation

@tammoippen

@tammoippen tammoippen commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Hi @nerdoc ,

I have some points i stumbled over, when updating from 0.1.8 to 0.2.3:

  • pyright gives an error for the Segment.__init__ overloads: fixed by enforcing tag as a positional argument
    Screenshot 2026-09-18 at 14 54 25

  • we get a warning about: MissingImplementationWarning apparently the xml schema files are not present. I added them in this PR, or is there a reason to not include them?

  • we also have to work with edifacts, that do not comply 100% with the schema and we also have our own validation, so i made the validate option available from Interchange, and Parser and pass them down on functions like from_str

The data/ directories under pydifact/syntax are not Python packages, so
setuptools dropped their XML files from sdist and wheel, and XML-based
segment validation was silently skipped in installed copies.
The implementation only accepts positional *args, so the overload must not
advertise `tag` as a keyword parameter (pyright reportInconsistentOverload).
Parser, from_str(), from_segments() and Interchange.from_file() accept
`validate` (default True). With validate=False, neither the parsed segments
nor the UNB header of an interchange are validated.
@nerdoc

nerdoc commented Sep 21, 2026

Copy link
Copy Markdown
Member

Oh yes, that's a good idea to let the user override the validate method. I'll have a look at this.
I'll release a new version ASAP.

@nerdoc
nerdoc merged commit 571a0e4 into nerdocs:master Sep 21, 2026
6 checks passed
@nerdoc

nerdoc commented Sep 21, 2026

Copy link
Copy Markdown
Member

Thank you. Yes, this was forgotten to include. I cought this up. If something else is missing, please tell me.

@tammoippen

Copy link
Copy Markdown
Contributor Author

Nice! Thank you!

@tammoippen
tammoippen deleted the fix/include-xml-fix-typing-validate branch September 21, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants