Closed vpbrendel closed 4 years ago
I wasn't aware that pytest had Python-version-specific executables such as pytest-2 and pytest-3. In any case, there is no pytest-3
entry point in my environment (pytest 5.3.3), so this change would break my setup. Does this fix specific problems with the Singularity build, or are you just trying to be proactive here? 😀
Based on this page, pytest 4.6 is the last version to support Python 2.7 and 3.4. So an alternative option here would be to explicitly require pytest>=5.0.
When problems arise from not explicitly distinguishing between Python 2 and 3, we of course need to take reasonable steps to solve those problems. But like pytest and many other projects, it's not necessary that we actively remove Python 2 support. We are just free now to ignore bugs that are Py2 specific. I'm sure Python 2 will be available for a long time to support legacy systems, but hopefully Python 3 will soon take over as the default, and the only version pre-installed on UNIX operating systems.
This could be Fedora specific, but installation did not provide pytest; only pytest-3. And the version that gets installed with Fedora 30 fails. In the currently active Fedora 31, all works perfectly. Our install instructions are basically "look at the Singularity file" ... which leaves open the question whether the Makefile would work on other Linux distributions. For my testing, only the python tests were problematic.
On balance, I suggest we go back to writing "pytest" and leave it up to the user to make sure that this links to the pytest version to be used on the system. On the container (Fedora 31) we only have python-3.7.6 installed and the install provide the symbolic link. On an upgrade from Fedora 30 to 31, I have both python 2 and 3 installed, and the upgrade links python and pytest to the 3.7.6 version as default. Only an install of pytest-3 on an existing Fedora 29 with both 2 and 3 installed failed to create the symbolic link of pytest to pytest-3. So, I think use of "pytest" in our Makefile will be most consistent, and if it were to fail on some OS version, a user could easily fix it.
Ok, this now includes a more significant update concerning the calculation of "effective length" and sigma/phi. Definitely requires further testing, but to get things going:
I changed the -gqnt to -mqnt and propose to throw out short miLoci; the problem with the previous implementation is that we throw out giLoci but evaluate miLoci based on them ...; the pull request implements culling short miLoci instead
there is a bit of an art to calculating "effective lengths" to not double-count overlaps; one fix offered here is to split the overlap on two overlapping iLoci, rather than putting all the overlap into the length of the right iLocus; maybe a minor point, but when the overlapping iLoci are of different types, then this matters for the tallying of proportions
This pull request creates a Singularity recipe that has everything working in my tests.
The Makefile change from "pytest" to "pytest-3" tacitly removes support for python2 versions. As is, everything works with python3, so I think this is the way to go.
A side note is that pytest-3 does not work under Fedora 30 ...