Test conllu reader and writer in Travis#21
Merged
Merged
Conversation
python -m py.test does not work in my Python 3.5
trying to fix python3 and failing Travis
`packages=['udapi']` installs just the root udapi package (with no modules). We need `packages=['udapi', 'udapi.core', 'udapi.block', 'udapi.block.demo',...]`, but it would be difficult to keep this list updated, so let's use `find_packages()` helepr function for this purpose. We just need to have `__init__.py` files in each package, which we have anyway.
Users must make sure Udapi (with all its packages) is Python's search path. So either * installing Udapi from local dir (`python setup.py install --user` or `pip install -e .`), or * installing Udapi from PyPI (once we upload it there), or * developers' mode: set PYTHONPATH and PATH as suggested in README.md.
My original motivation for adding `--user` was to prevent the need of `sudo` in Travis. However, Travis runs Pythons in virtualenv, so this is not needed. Even worse, it fails with `python setup.py install --user`.
added 2 commits
December 19, 2016 13:35
…rent version of the udapi.block.write.conllu.
martinpopel
commented
Dec 19, 2016
| self.file_handler.write('\n') | ||
|
|
||
| self.file_handler.write("\n") | ||
| if number_of_written_bundles != len(document.bundles) - 1: |
Contributor
Author
There was a problem hiding this comment.
according to CoNLL-U specification, each tree (including the last one) must end with an empty line
| #!/bin/bash | ||
|
|
||
| udapy read.Conllu filename=UD_Czech_sample.conllu write.Conllu > out.conllu && diff UD_Czech_sample.conllu out.conllu | ||
| udapy read.Conllu filename=data/UD_Czech_sample.conllu write.Conllu > out.conllu && diff data/UD_Czech_sample.conllu out.conllu |
Contributor
Author
There was a problem hiding this comment.
But the file is still here https://github.com/udapi/udapi-python/blob/master/udapi/core/tests/UD_Czech_sample.conllu
|
I merge this branch for now, but there are still some problems (see #24) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of the tests can be unittests, but we need at least few tests,
which run the
udapyrunner from command line.I am not sure how to integrate this into pytest, so for now I did it as additonal test in
.travis.yml.The test I added is to check that that by reading and writing a conllu file we don't lose any info.
Currently, Travis CI fails on this test, but that's the purpose of this PR.