-
Notifications
You must be signed in to change notification settings - Fork 138
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
Move markdown to pyxform functionality out of tests and into main package #599
Comments
@lindsay-stevens @lognaturel Thoughts? |
The codebase you're referencing here is your external system (presumably Ona)? Are you writing additional tests that verify the conversion functionality? If so, could those be added here? Or are you using |
Ah, actually, I think I just remembered that Ona uses the pyxform json representations internally instead of the actual XForm, is that right? So you use that pyxform json representation to test Ona features that interact with the form def in some way? |
We use both the JSON as well as the XForm representation. Yes, in my case this is onadata, for example we use the method self.md_to_pyxform_survey(md_xlsform, kwargs=kwargs) then access the XML and JSON representation accordingly which is the goal. survey = self.md_to_pyxform_survey(md_xlsform, kwargs=kwargs)
...
xml = survey.to_xml()
json = survey.to_json()
... |
I have not done much isolation other than treating the two files as all public https://github.com/XLSForm/pyxform/pull/600/files. |
Thanks for clarifying the usage! That all makes sense. My preference would be to make @lindsay-stevens I'd also like your thoughts on what a good structure would be. |
In my view tests are private code, and as a result any changes to the tests are not (usually) mentioned in the changelog and these changes don't affect versioning. So I don't think it's good practice for 3rd party code to rely on tests. I wonder if those 3rd party tests using the pyxform test code are perhaps tests that should be contributed as pyxform tests? Another issue for onadata is that it seems to support both python 3 and 2, whereas pyxform supports only 3.7+ only. Anyway, some suggestions:
Option 4 could have other benefits beyond meeting the request in this ticket:
|
Seems like a path of least effort, will consider this in the short term.
I did not have much success with this option.
I'm keen on Option 4, having it as part of the library will make things far much easier. I will take down the PR #600. and leave the issue open hoping we pursue option 4 instead. |
I like the way y'all think!
Wild. |
Software and hardware versions
pyxform v1.7.0 - v1.9.0, Python 3.8.13
Problem description
I have been using the functionality within pyxform_test_case in writing tests using markdown to minimise or eliminate the use of Excel files within the codebase. I believe the change introduced by the PR #562 eliminated the inclusion of the package during distribution and as such the module is not available in third party code bases that rely on it.
Steps to reproduce the problem
Expected behaviour
Could we make this module available under
pyxform.test_utls
or any relevant path and allow the continued use by third party code bases for writing tests? The goal is the same as was for this package to reduce the use of binary XLSForm files.The text was updated successfully, but these errors were encountered: