8

How to test on py27 and py37 in tox when the py37 changes aren't packaged to pypi

  • The py3.7 compatible changes exist in repo branches.

  • They can be run by hand through pip -e installing them and running pytest without tox.

  • I'd like to move to running them through tox, but I can't figure out the correct string to give the deps list, or perhaps this is done in another way.

Attempted solution:

tox.ini

[tox]
envlist = py27,py37


[testenv:py27]
deps =
    pytest
    pytest-cov
    pytest-mock
    pylint
    ; packages specified by the setup.py cover the other dependencies for py2.7
commands =
    pytest -v


[testenv:py37]
deps =
    pytest
    pytest-cov
    pytest-mock
    pylint
    git+ssh//repo_url/location1.git@branchname_that_supports_py37
    git+ssh//repo_url/location2.git@branchname_that_supports_py37
    git+ssh//repo_url/location3.git@branchname_that_supports_py37
    git+ssh//repo_url/location4.git@branchname_that_supports_py37
    git+ssh//repo_url/location5.git@branchname_that_supports_py37
    git+ssh//repo_url/location6.git@branchname_that_supports_py37
    git+ssh//repo_url/location7.git@branchname_that_supports_py37
    git+ssh//repo_url/location8.git@branchname_that_supports_py37

commands =
    pytest -v
SwimBikeRun
  • 4,192
  • 11
  • 49
  • 85

1 Answers1

7

For VCS URLs pip needs to know the name of the package that should be provided with #egg=name:

    git+ssh//repo_url/location1.git@branchname_that_supports_py37#egg=package1

Otherwise your tox.ini looks good. I use the same approach, for example.

phd
  • 82,685
  • 13
  • 120
  • 165
  • Ah I see. I had strong suspicions the pip command itself was wrong, but the fact you can pip -e without the #egg is what was throwing me off. Will confirm then accept, thanks! And awesome link, I really appreciate that. – SwimBikeRun May 08 '19 at 19:28