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

Add ODK Validate 1.5.0 jar. #116

Merged
merged 2 commits into from
Jun 8, 2017
Merged

Conversation

lognaturel
Copy link
Contributor

@lognaturel lognaturel commented May 31, 2017

Closes #114. Confirmed working on macOS, Linux and Windows 10.

I have verified that I can run this jar from where it is with java -jar ODK_Validate.jar. The UI shows the version as 1.5.0 and a form such as contains_starts-with_ends-with.txt that uses new XPath functions validates. I can also run Validate through the CLI and get the same results.

However, if I run python ./xls2xform.py on the corresponding XLSForm -
contains_starts-with_ends-with.xlsx - I get the same ODK Validate errors as I got with the old jar. Interestingly, if I then run this same jar on the resulting xml file, it validates as expected.

When I run nosetests, I get the same behavior as on master. 117 passes but there is usage: nosetests [-h] [--json] [--skip_validate] path_to_XLSForm output_path nosetests: error: too few arguments printed part way through.

Is there something special that needs to be done to update the jar? Paging @lindsay-stevens because I see you were the last to do this update and had to fix some previous issues.

@lognaturel lognaturel force-pushed the use-validate-1.5.0 branch 2 times, most recently from ba36026 to 8fa6e90 Compare May 31, 2017 18:58
@lognaturel
Copy link
Contributor Author

The problem was that because I had already installed pyxform through pip, that was being used. Now I've uninstalled through pip and when I run python pyxform/xls2xform.py path_to_XLSForm output_path as recommended by the README, I get

  File "pyxform/xls2xform.py", line 7, in <module>
    from pyxform import xls2json, builder
ImportError: No module named pyxform

I'm not very familiar with running scripts in modules in this way. What's the right approach?

@lindsay-stevens
Copy link
Contributor

lindsay-stevens commented May 31, 2017 via email

@lognaturel
Copy link
Contributor Author

Thank you, @lindsay-stevens! That extra background is very helpful and it's good to know I should verify this on Windows.

My broader problem now is just that I can't figure out how to run xls2xform.py 😖. Any advice on that appreciated.

@lindsay-stevens
Copy link
Contributor

lindsay-stevens commented Jun 1, 2017 via email

@dorey
Copy link
Contributor

dorey commented Jun 1, 2017

@lognaturel , to run local code, you should uninstall the pip installed version (pip uninstall pyxform) because it probably pulled the source from pypi. Then, assuming you're running inside a virtualenv with the virtualenvwrapper helper, you can get set up as simply as:

mkvirtualenv local_pyxform                     # or whatever you want to name it
(local_pyxform)$ python setup.py develop       # install the local files
(local_pyxform)$ python pyxform/xls2xform.py --help
(local_pyxform)$ xls2xform --help              # same effect as previous line
(local_pyxform)$ which xls2xform
# ~/.virtualenvs/local_pyxform/bin/xls2xform

That last shortcut is available because of the entry point in setup.py.

And later, you can leave the virtualenv with deactivate and get back in with workon local_pyxform

(local_pyxform)$ deactivate                    # practice leaving the virtualenv
$ xls2xform --help 
# -bash: xls2xform: command not found
$ workon local_pyxform                         # and reactivate the virtualenv
(local_pyxform)$ which xls2xform               # & we can access the scripts once again
~/.virtualenvs/local_pyxform/bin/xls2xform

@lognaturel
Copy link
Contributor Author

Thank you @dorey, @lindsay-stevens. I'll update the readme.

I can confirm that this updated jar works with OS X and Linux. Does one of you have a Windows machine/VM handy that you could quickly verify on?

@dorey
Copy link
Contributor

dorey commented Jun 1, 2017

Question for @lognaturel: What process went into making this ODK Validate.jar? Did you make changes or recompile the JAR?

I ask because it would be nice if we could either verify a checksum with a trusted source or compile the JAR locally when the package is installed so that we don't have to approve or disapprove binary files from new contributors. (edit: This is described in #64 )

(also, no access to a windows VM here. sorry!)

@lognaturel
Copy link
Contributor Author

lognaturel commented Jun 1, 2017

Good idea, @dorey! This is the jar that is now available on the ODK website and there's a checksum there you should be able to verify.

If this doesn't work on Windows, we should figure out what needs to be changed in the packaging process and document it on the Validate side so that we can always use the official jar/source.

@lindsay-stevens
Copy link
Contributor

lindsay-stevens commented Jun 1, 2017 via email

@lognaturel
Copy link
Contributor Author

I'll investigate getting set up AppVeyor. In the mean time, I have verified that this works with Windows 10, Python 2.7.13. If we think that's a sufficient verification, it should be ready to merge.

@ukanga
Copy link
Contributor

ukanga commented Jun 8, 2017

Cool, I have created an issue for Appveyor #124, might take a stub later today since I linked the repo with the CI already.

@ukanga ukanga merged commit c9fadce into XLSForm:master Jun 8, 2017
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.

Use Validate 1.5.0
4 participants