Skip to content
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

Feature request: print xsdata version to console and code comment #746

Closed
bjhend opened this issue Feb 15, 2023 · 1 comment · Fixed by #751
Closed

Feature request: print xsdata version to console and code comment #746

bjhend opened this issue Feb 15, 2023 · 1 comment · Fixed by #751

Comments

@bjhend
Copy link

bjhend commented Feb 15, 2023

It would be nice if xsdata would print its version information to

  • the console when it generates code
  • as a comment into the main __init__ file or alternatively some readme file

Rationale

I'm currently debugging a problem that might be solved in a newer xsdata version. To compare the generated code, I have different xsdata versions generate code in different Python virtual environments. Printing the version to the console would ensure that the intended xsdata version was called.

To have comparable code I use the same --package argument in all cases. After copying the code to the project it is hard to tell which code was generated with which xsdata version. A comment in __main__ with the version would help to find out.

@tefra
Copy link
Owner

tefra commented Feb 22, 2023

Thank you for the suggestion @bjhend, I am not a fan of this kind of branding eww, but I see why this would be usefull.

I added it as a config option, default: off,

xsdata generate --include-header schema.xsd

https://xsdata.readthedocs.io/en/latest/faq/how-can-i-compare-output-results-between-versions.html

I also added a header message in the cli to print the current xsdata version, python version and platform.

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 a pull request may close this issue.

2 participants