diff --git a/.gitignore b/.gitignore index 7261ec40..d3b8cd83 100644 --- a/.gitignore +++ b/.gitignore @@ -9,15 +9,19 @@ /*.egg /.eggs /.installed.cfg +/.jip +/.jip_index /.tox /bin /build /develop-eggs +/data/pom.tpl /dist /docs/.build /downloads /eggs /include +/javalib /lib /local /oxt/pyhwp.egg.record diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..df86991e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +language: python +python: +- "2.7" +env: +- TOXENV=py27 +matrix: + include: + - python: "2.7" + env: TOXENV=lint + - python: "2.7" + env: TOXENV=py27 + - python: "pypy" + env: TOXENV=pypy + - python: "2.7" + env: TOXENV=jy27 + allow_failures: + - python: "2.7" + env: TOXENV=jy27 +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y libxml2-utils xsltproc +install: + - pip install -U setuptools pip wheel jip + - pip install -U zc.buildout tox + - buildout + - tox --version + - sort --version + - env | sort + - if [ "$TOXENV" == "jy27" ]; then make install-jython; fi +script: + - tox diff --git a/Makefile b/Makefile index 921a0509..ad4db8ad 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ define ALL update-requirements + install-jython endef ALL:=$(shell echo $(ALL)) # to remove line-feeds @@ -64,3 +65,12 @@ notebook: clitest: $(VENV) env SAMPLES=samples clitest -1 --prefix 3 pyhwp-tests/cli_tests/hwp5proc.txt $(VENV) env SAMPLES=samples clitest -1 --prefix 3 pyhwp-tests/cli_tests/hwp5odt.txt + + +.PHONY: install-jython +install-jython: parts/jython2.7/bin/jython +parts/jython2.7/bin/jython: + rm -rf parts/jython2.7 + mkdir -p parts + $(VIRTUAL_ENV)/bin/jip install org.python:jython-installer:2.7.1b3 + java -jar $(VIRTUAL_ENV)/javalib/jython-installer-2.7.1b3.jar -s -d $(PWD)/parts/jython2.7 diff --git a/pyhwp-tests/cli_tests/hwp5proc.txt b/pyhwp-tests/cli_tests/hwp5proc.txt index 794cbba7..e5c963c8 100644 --- a/pyhwp-tests/cli_tests/hwp5proc.txt +++ b/pyhwp-tests/cli_tests/hwp5proc.txt @@ -435,7 +435,8 @@ unpack 명령 $ rm -rf sample-5017 $ hwp5proc unpack samples/sample-5017.hwp - $ find sample-5017 -type f | sort | xargs sha1sum + $ find sample-5017 -type f | sort --dictionary | xargs sha1sum + 25233fb7d96f387fbe07eadae65c7ba3cdccaab1 sample-5017/_05HwpSummaryInformation a651496e95dd70a7a5c3ae08f8829cecd5e6ed7b sample-5017/BinData/BIN0002.jpg e0f44117bf675d77297a86a322bd9eaa96543c37 sample-5017/BinData/BIN0002.png e0f44117bf675d77297a86a322bd9eaa96543c37 sample-5017/BinData/BIN0003.png @@ -447,19 +448,20 @@ unpack 명령 23302ee8ea7ddf4b1b7bfb8f6c307df589eeea4f sample-5017/PrvText e40fe23054d2df479a06947174be594ff4c80497 sample-5017/Scripts/DefaultJScript 3da89ee273be13437e7ecf760f3fbd4dc0e8d1fe sample-5017/Scripts/JScriptVersion - 25233fb7d96f387fbe07eadae65c7ba3cdccaab1 sample-5017/_05HwpSummaryInformation $ rm -rf sample-5017 $ hwp5proc unpack --vstreams samples/sample-5017.hwp - $ find sample-5017 -type f | sort + $ find sample-5017 -type f | sort --dictionary + sample-5017/_05HwpSummaryInformation + sample-5017/_05HwpSummaryInformation.txt sample-5017/BinData/BIN0002.jpg sample-5017/BinData/BIN0002.png sample-5017/BinData/BIN0003.png - sample-5017/BodyText.xml sample-5017/BodyText/Section0 sample-5017/BodyText/Section0.models sample-5017/BodyText/Section0.records sample-5017/BodyText/Section0.xml + sample-5017/BodyText.xml sample-5017/DocInfo sample-5017/DocInfo.models sample-5017/DocInfo.records @@ -472,8 +474,6 @@ unpack 명령 sample-5017/PrvText.utf8 sample-5017/Scripts/DefaultJScript sample-5017/Scripts/JScriptVersion - sample-5017/_05HwpSummaryInformation - sample-5017/_05HwpSummaryInformation.txt records 명령 ------------ diff --git a/requirements-dev.in b/requirements-dev.in index e546fc84..4fb48ef6 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -4,6 +4,7 @@ babel check-manifest coloredlogs flake8 +jip jupyter lxml pip-tools >= 1.9.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 6345909c..33ab5847 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -37,6 +37,7 @@ ipython-genutils==0.2.0 # via nbformat, notebook, qtconsole, traitlets ipython==5.4.1 # via ipykernel, ipywidgets, jupyter-console ipywidgets==7.0.0 # via jupyter jinja2==2.9.6 # via nbconvert, notebook, sphinx +jip==0.9.13 jsonschema==2.6.0 # via nbformat jupyter-client==5.1.0 # via ipykernel, jupyter-console, notebook, qtconsole jupyter-console==5.2.0 # via jupyter @@ -74,7 +75,7 @@ qtconsole==4.3.1 readme-renderer==17.2 # via restview repoze.sphinx.autointerface==0.8 requests-toolbelt==0.8.0 # via twine -requests==2.18.4 # via requests-toolbelt, sphinx, twine +requests==2.18.4 # via jip, requests-toolbelt, sphinx, twine restview==2.7.0 scandir==1.5 # via pathlib2 simplegeneric==0.8.1 # via ipython diff --git a/tox.ini b/tox.ini index 643c5e31..ae2dded1 100644 --- a/tox.ini +++ b/tox.ini @@ -10,8 +10,7 @@ changedir = {envdir} commands = zope-testrunner -vv --color --path={toxinidir}/pyhwp-tests --test-path={toxinidir}/pyhwp-tests --tests-pattern='^hwp5_tests$' ln -sf {toxinidir}/samples - {toxinidir}/bin/clitest --prefix 3 {toxinidir}/pyhwp-tests/cli_tests/hwp5proc.txt - {toxinidir}/bin/clitest --prefix 3 {toxinidir}/pyhwp-tests/cli_tests/hwp5odt.txt + {toxinidir}/bin/clitest --prefix 3 {toxinidir}/pyhwp-tests/cli_tests/hwp5proc.txt {toxinidir}/pyhwp-tests/cli_tests/hwp5odt.txt whitelist_externals = ln @@ -20,7 +19,7 @@ deps = -r{toxinidir}/requirements-test.txt [testenv:jy27] -basepython = jython2.7 +basepython = {toxinidir}/parts/jython2.7/bin/jython deps = -r{toxinidir}/requirements-test.txt