From 586d44fbf4f0bf093353549ef3595d7bc8d1eb4a Mon Sep 17 00:00:00 2001 From: MutantPlatypus <1389865+MutantPlatypus@users.noreply.github.com> Date: Sun, 22 Sep 2019 14:32:08 -0400 Subject: [PATCH 1/6] Use more flexible dependency coding for cairosvg --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ca87aa9..cd61fa7 100644 --- a/setup.py +++ b/setup.py @@ -147,7 +147,7 @@ "test": [ "xmldiff", #Per release notes, Python 2 support dropped at version 2.0.0 - "cairosvg==1.0.22" if sys.version_info < (3, ) else "cairosvg", + "cairosvg<2" if sys.version_info.major < 3 else "cairosvg", "pillow" ], }, From ba3ff8e101f4a112cf2386cdb544577e443ecd0c Mon Sep 17 00:00:00 2001 From: MutantPlatypus <1389865+MutantPlatypus@users.noreply.github.com> Date: Sun, 22 Sep 2019 16:38:56 -0400 Subject: [PATCH 2/6] Do not let OS choose .js file handler --- test/test_render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_render.py b/test/test_render.py index 7bdf541..a90ffa9 100644 --- a/test/test_render.py +++ b/test/test_render.py @@ -45,7 +45,7 @@ def test_upstream(tmpdir,wavedromdir,file): f_out = "{}/{}.svg".format(tmpdir, base) f_out_py = "{}/{}_py.svg".format(tmpdir, base) - subprocess.check_call("{}/bin/cli.js -i {} > {}".format(wavedromdir, file, f_out), shell=True) + subprocess.check_call("node {}/bin/cli.js -i {} > {}".format(wavedromdir, file, f_out), shell=True) wavedrom.render_file(file, f_out_py, strict_js_features=True) unknown = diff(f_out, f_out_py) From ce853c801a4d2c2a6f6745590352b769c3cb4e0c Mon Sep 17 00:00:00 2001 From: MutantPlatypus <1389865+MutantPlatypus@users.noreply.github.com> Date: Sun, 22 Sep 2019 17:37:06 -0400 Subject: [PATCH 3/6] Test with tox The prequisites for the environment to run tox are node, npm, git, and tox. --- .travis.yml | 8 +++----- tox.ini | 9 +++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 tox.ini diff --git a/.travis.yml b/.travis.yml index 67414dd..9fa745d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,10 @@ python: - "3.6" before_install: - - sudo apt-get install -y librsvg2-bin npm + - sudo apt-get install -y npm install: - - pip install .[test] + - pip install tox-travis script: - - pytest -v - - + - tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..1dfe381 --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py27, py35, py36 + +[testenv] +deps = pytest +extras = test + +commands = + pytest -v {posargs} From b32b54c12003566f0c4f8e18b20973fa440504eb Mon Sep 17 00:00:00 2001 From: MutantPlatypus <1389865+MutantPlatypus@users.noreply.github.com> Date: Sun, 22 Sep 2019 18:44:39 -0400 Subject: [PATCH 4/6] Declare support for Python 3.7, test in 3.7 --- .travis.yml | 1 + setup.py | 1 + tox.ini | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9fa745d..7cc0b6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ python: - "2.7" - "3.5" - "3.6" + - "3.7" before_install: - sudo apt-get install -y npm diff --git a/setup.py b/setup.py index cd61fa7..5b6f5f7 100644 --- a/setup.py +++ b/setup.py @@ -107,6 +107,7 @@ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7" ], # This field adds keywords for your project which will appear on the diff --git a/tox.ini b/tox.ini index 1dfe381..1de0a87 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py35, py36 +envlist = py27, py35, py36, py37 [testenv] deps = pytest From fea96ce08638f7d4c5bb7dbe186a01c34d611769 Mon Sep 17 00:00:00 2001 From: MutantPlatypus <1389865+MutantPlatypus@users.noreply.github.com> Date: Mon, 23 Sep 2019 00:57:36 -0400 Subject: [PATCH 5/6] Test with tox-conda --- .travis.yml | 27 ++++++++++++++++++++++++--- tox.ini | 6 +++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cc0b6e..c88289e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,35 @@ +# Applied from https://github.com/conda/conda/blob/master/docs/source/user-guide/tasks/use-conda-with-travis-ci.rst + language: python python: + # We don't actually use the Travis Python, but this keeps it organized. - "2.7" - "3.5" - "3.6" - "3.7" -before_install: - - sudo apt-get install -y npm - install: + - sudo apt-get update + # We do this conditionally because it saves us some downloading if the + # version is the same. + - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then + wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; + else + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + fi + - bash miniconda.sh -b -p $HOME/miniconda + - source "$HOME/miniconda/etc/profile.d/conda.sh" + - hash -r + - conda config --set always_yes yes --set changeps1 no + - conda update -q conda + # Useful for debugging any issues with conda + - conda info -a + + # Replace dep1 dep2 ... with your dependencies + # wavedrompy will use tox-conda, so all dependencies will be handled in tox.ini + - conda create -q -c conda-forge -n test-environment python=$TRAVIS_PYTHON_VERSION tox-conda + - conda activate test-environment + - pip install tox-travis script: diff --git a/tox.ini b/tox.ini index 1de0a87..df133aa 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,11 @@ envlist = py27, py35, py36, py37 [testenv] -deps = pytest +conda_channels = conda-forge +conda_deps = + nodejs + git + pytest extras = test commands = From c5813eeaa68b6b52c4ab2b7b890b06b19c0aebb6 Mon Sep 17 00:00:00 2001 From: MutantPlatypus <1389865+MutantPlatypus@users.noreply.github.com> Date: Mon, 23 Sep 2019 01:19:08 -0400 Subject: [PATCH 6/6] Use python=3.7 vm to host python=2.7 env tox-conda requires python>=3.5, but can create conda environments with any Python --- .travis.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index c88289e..e0ea6b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,15 @@ # Applied from https://github.com/conda/conda/blob/master/docs/source/user-guide/tasks/use-conda-with-travis-ci.rst language: python + +# We don't actually use the Travis Python, but this keeps it organized. +# But tox runs in Travis Python, so it has to be compatible with tox and its plugins. +matrix: + include: + - name: "Python: 2.7" + python: 3.7 + env: TOXENV=py27 python: - # We don't actually use the Travis Python, but this keeps it organized. - - "2.7" - "3.5" - "3.6" - "3.7" @@ -12,11 +18,7 @@ install: - sudo apt-get update # We do this conditionally because it saves us some downloading if the # version is the same. - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - source "$HOME/miniconda/etc/profile.d/conda.sh" - hash -r