improve installation and test workflow
ClosedPublic

Authored by kparal on Feb 10 2017, 2:33 PM.

Details

Summary
  • Use --ignore-installed for pip to make sure all available packages

are installed into virtualenv if available.

  • Simplify setup and test instructions in README.
  • Show test coverage by default for a test suite. Remove clashing

pytest.ini.

  • Remove extra venv repos from dodo, they are now available in PyPI.
  • Avoid silent command failures in dodo by using && instead of ;
  • Add missing deps into spec file.
  • Add testcloud to requirements, it's on PyPI now.
  • Remove deps from setup.py, it's outdated and there's no point until we

publish it to PyPI.

Test Plan

updated virtualenv and testing instructions worked for me, also package building

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to improve installation and test workflow.Feb 10 2017, 2:33 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added a reviewer: libtaskotron.
jskladan added inline comments.
README.rst
50

is the testcloud dependency removed for simplicity, or do we not need it at all now?

61

What's the technical and actual difference between --force-reinstall and --ignore-installed? Also, does it not go around the purpose of --system-site-packages?

182

What's the difference in pytest (used in resultsdb's readme) and py.test used here. I guess it's the same, so we might keep it consistent?

requirements.txt
13

This extra newline, and the one on line 41 are killing me :)

Other than @jskladan's remarks, looks good.

README.rst
50

It's removed here and added to requirements.txt ;)

Thanks for a detailed review!

README.rst
50

Yes, we can use the PyPI version now. It wasn't on PyPI before.

61

--force-reinstall works only with --update, otherwise does nothing. --ignore-installed works always. The main use case seems (to me) to have it used together with --system-site-packages. We want system site packages be used only when absolutely necessary (if everything can be installed from pypi, ideally without compilation, we prefer standalone virtualenv). However, if you have e.g. requests already installed in the system, they will not be installed in the virtualenv (because pip already sees it as installed). If you use --ignore-installed, packages will always be installed, regardless of existing system packages. This makes sure that your virtualenv contains as many packages as possible, and only the necessary minimum is pulled from system site packages.

As an example, let's say we have 10 packages defined in requirements.txt and 1 package (koji) which is not on pypi and thus forces us to use --system-site-packages. If you use just pip install, you'll end up having 0-10 packages in your virtualenv, depending on your system state. The system state of course changes in time, so packages might end up being removed or updated/downgraded, potentially causing issues in your project. If you do pip install --ignore-installed, you'll end up with exactly 10 packages in your virtualenv (the full set), and the only package that is pulled from your system is koji.

182

Yeah, my fault. It seems that pytest command is available only in latest pytest package, and the older (and more universal) binary name is py.test. So we either need to bump requirement.txt to pytest >= 3.0 (so that we get pytest), which I was a bit reluctant to do (since neither F24 nor F25 contains pytest >= 3.0), or we need to stay with py.test. If you want it consistent across projects, all we need to do is to change the README in resultsdb to use py.test.

requirements.txt
13

Macro devops: newlines baby

kparal updated this revision to Diff 2885.Feb 13 2017, 11:26 AM
  • requirements: stop teasing jskladan
jskladan added inline comments.Feb 13 2017, 12:17 PM
README.rst
61

So, as we discussed in person, the --ignore-installed really mostly invalidates the reason for us to have --system-site-packages - so we don't need to keep a list of required devel packages for the gcc installation.
Let's remove the --ignore-installed and creatively use the versioning in requirements.txt.

kparal updated this revision to Diff 2886.Feb 13 2017, 12:49 PM
  • remove --ignore-installed again. Relax restrictions on requirements.txt
jskladan accepted this revision.Feb 13 2017, 1:17 PM
jskladan added a reviewer: jskladan.

Macro devops:                  iz ok                        I guess...

This revision is now accepted and ready to land.Feb 13 2017, 1:17 PM
Closed by commit rLTRNfcc74e37ff45: improve installation and test workflow (authored by Kamil Páral <kparal@redhat.com>). · Explain WhyFeb 14 2017, 7:30 AM
This revision was automatically updated to reflect the committed changes.