Conversation
pytest_doctestplus/plugin.py
Outdated
| def indent(text, prefix): | ||
| return '\n'.join([prefix + line for line in text.splitlines()]) | ||
|
|
||
| PYTEST_GT_5 = Version(pytest.__version__) > Version('5') |
There was a problem hiding this comment.
Version(pytest.__version__) < Version('6.0.0') didn't work because CI pulled 6.0.0rc<blahblah> and that evaluates to True even if I wanted it to be False.
There was a problem hiding this comment.
why not LooseVersion, that should return False for those (though one could argue False is the wrong answer, but in these scenarios it's the right answer we need)
There was a problem hiding this comment.
Apparently Python org hates distutils now or something... Using packaging is consistent with astropy/astropy#10590 .
There was a problem hiding this comment.
Pytest also uses packaging, i.e. it's a dependency of pytest, so having it a dependency here is not a big deal. It will get installed regardless.
This comment has been minimized.
This comment has been minimized.
|
Not sure what is going on with this failure. It is unrelated and I cannot reproduce it locally even when I did a hack to make |
| import sys | ||
| import warnings | ||
|
|
||
| from packaging.version import Version |
There was a problem hiding this comment.
You'll want to add packaging to install_requires in setup.py. This is working now because pytest also depends on packaging and installs it.
There was a problem hiding this comment.
I think packaging is vendored by setuptools
There was a problem hiding this comment.
It is, but it doesn't not have the same namespace. You then have to import it from setuptools.extern.version I believe.
Attempt to fix #118