fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
123 stars 39 forks source link

Remove "version" arg from VirtualEnv class init. #255

Closed gordonmessmer closed 3 years ago

gordonmessmer commented 3 years ago

Remove "version" arg from VirtualEnv class init. Because "name" is a local file, "version" is not necessary.

gordonmessmer commented 3 years ago

@decathorpe Would you review these changes?

I introduced a bug in #209 and #226 . Since pyp2rpm builds a virtualenv from a local file, it doesn't need to specify a version. The version spec is incompatible with specifying a local file, which causes setup to fail, and no data can be extracted from virtualenvs. None of the tests specifically required virtualenv data, so I've added additional tests on virtualenv specifically.

There's still one issue that the test reveals, which is that pyp2rpm will try to use python3 for some tests, even when it is running in the Python 2.7 virtualenv created by tox. Rather than spend time on that, I think I might just file that under "known issues" temporarily until Python 2.7 support is removed.

Travis tests aren't running most of the time due to docker pull rate limits. All tests for this branch are successful except for one test under the py27 env specifically: tests/test_virtualenv.py::TestVirtualEnvGetData::test_get_data[/home/gordon/git/pyp2rpm/tests/test_data/utest-0.1.0.tar.gz-expected0] FAILED

decathorpe commented 3 years ago

If "name" in VirtualEnv constructors is really always a local file, then this LGTM.