0.10.33: pyetest is failing with errors
kloczek opened this issue ยท 17 comments
Describe the bug
Looks like pytest is failing with eerors.
To Reproduce
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
- because I'm calling
build
with--no-isolation
I'm using during all processes only locally installed modules - install .whl file in </install/prefix>
- run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
- build is performed in env which is
cut off from access to the public network
(pytest is executed with-m "not network"
)
Screenshots
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-ablog-0.10.33-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-ablog-0.10.33-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
libraries: Sphinx-6.1.3, docutils-0.19
base tempdir: /tmp/pytest-of-tkloczko/pytest-202
rootdir: /home/tkloczko/rpmbuild/BUILD/ablog-0.10.33, configfile: setup.cfg, testpaths: tests
collected 5 items
tests/test_build.py EE [ 40%]
tests/test_external.py E [ 60%]
tests/test_postlist.py EE [100%]
==================================== ERRORS ====================================
_________________________ ERROR at setup of test_build _________________________
test_params = {'shared_result': None}
app_params = app_params(args=['html'], kwargs={'srcdir': path('/tmp/pytest-of-tkloczko/pytest-202/build')})
make_app = <function make_app.<locals>.make at 0x7fca140eb820>
shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fca1495b970>
@pytest.fixture(scope='function')
def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable,
shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]:
"""
Provides the 'sphinx.application.Sphinx' object
"""
args, kwargs = app_params
> app_ = make_app(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make
app_: Any = SphinxTestApp(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/util.py:136: in __init__
super().__init__(srcdir, confdir, outdir, doctreedir,
/usr/lib/python3.8/site-packages/sphinx/application.py:219: in __init__
self.setup_extension(extension)
/usr/lib/python3.8/site-packages/sphinx/application.py:398: in setup_extension
self.registry.load_extension(self, extname)
/usr/lib/python3.8/site-packages/sphinx/registry.py:443: in load_extension
mod = import_module(extname)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py:24: in <module>
from sphinx.util import SkipProgressMessage, progress_message
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sphinx.deprecation._ModuleWrapper object at 0x7fca15231fa0>
name = 'SkipProgressMessage'
def __getattr__(self, name: str) -> Any:
if name not in self._objects:
return getattr(self._module, name)
canonical_name = self._names.get(name, None)
if canonical_name is not None:
> warnings.warn(f"The alias '{self._modname}.{name}' is deprecated, "
f"use '{canonical_name}' instead. "
"Check CHANGES for Sphinx API modifications.",
self._warning, stacklevel=3)
E sphinx.deprecation.RemovedInSphinx80Warning: The alias 'sphinx.util.SkipProgressMessage' is deprecated, use 'sphinx.util.display.SkipProgressMessage' instead. Check CHANGES for Sphinx API modifications.
/usr/lib/python3.8/site-packages/sphinx/deprecation.py:46: RemovedInSphinx80Warning
_________________________ ERROR at setup of test_feed __________________________
test_params = {'shared_result': None}
app_params = app_params(args=['html'], kwargs={'srcdir': path('/tmp/pytest-of-tkloczko/pytest-202/build')})
make_app = <function make_app.<locals>.make at 0x7fca135e4940>
shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fca13523f70>
@pytest.fixture(scope='function')
def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable,
shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]:
"""
Provides the 'sphinx.application.Sphinx' object
"""
args, kwargs = app_params
> app_ = make_app(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make
app_: Any = SphinxTestApp(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/util.py:136: in __init__
super().__init__(srcdir, confdir, outdir, doctreedir,
/usr/lib/python3.8/site-packages/sphinx/application.py:219: in __init__
self.setup_extension(extension)
/usr/lib/python3.8/site-packages/sphinx/application.py:398: in setup_extension
self.registry.load_extension(self, extname)
/usr/lib/python3.8/site-packages/sphinx/registry.py:443: in load_extension
mod = import_module(extname)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py:24: in <module>
from sphinx.util import SkipProgressMessage, progress_message
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sphinx.deprecation._ModuleWrapper object at 0x7fca15231fa0>
name = 'SkipProgressMessage'
def __getattr__(self, name: str) -> Any:
if name not in self._objects:
return getattr(self._module, name)
canonical_name = self._names.get(name, None)
if canonical_name is not None:
> warnings.warn(f"The alias '{self._modname}.{name}' is deprecated, "
f"use '{canonical_name}' instead. "
"Check CHANGES for Sphinx API modifications.",
self._warning, stacklevel=3)
E sphinx.deprecation.RemovedInSphinx80Warning: The alias 'sphinx.util.SkipProgressMessage' is deprecated, use 'sphinx.util.display.SkipProgressMessage' instead. Check CHANGES for Sphinx API modifications.
/usr/lib/python3.8/site-packages/sphinx/deprecation.py:46: RemovedInSphinx80Warning
_______________________ ERROR at setup of test_external ________________________
test_params = {'shared_result': None}
app_params = app_params(args=['html'], kwargs={'srcdir': path('/tmp/pytest-of-tkloczko/pytest-202/external')})
make_app = <function make_app.<locals>.make at 0x7fca137225e0>
shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fca1348ddf0>
@pytest.fixture(scope='function')
def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable,
shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]:
"""
Provides the 'sphinx.application.Sphinx' object
"""
args, kwargs = app_params
> app_ = make_app(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make
app_: Any = SphinxTestApp(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/util.py:136: in __init__
super().__init__(srcdir, confdir, outdir, doctreedir,
/usr/lib/python3.8/site-packages/sphinx/application.py:219: in __init__
self.setup_extension(extension)
/usr/lib/python3.8/site-packages/sphinx/application.py:398: in setup_extension
self.registry.load_extension(self, extname)
/usr/lib/python3.8/site-packages/sphinx/registry.py:443: in load_extension
mod = import_module(extname)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py:24: in <module>
from sphinx.util import SkipProgressMessage, progress_message
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sphinx.deprecation._ModuleWrapper object at 0x7fca15231fa0>
name = 'SkipProgressMessage'
def __getattr__(self, name: str) -> Any:
if name not in self._objects:
return getattr(self._module, name)
canonical_name = self._names.get(name, None)
if canonical_name is not None:
> warnings.warn(f"The alias '{self._modname}.{name}' is deprecated, "
f"use '{canonical_name}' instead. "
"Check CHANGES for Sphinx API modifications.",
self._warning, stacklevel=3)
E sphinx.deprecation.RemovedInSphinx80Warning: The alias 'sphinx.util.SkipProgressMessage' is deprecated, use 'sphinx.util.display.SkipProgressMessage' instead. Check CHANGES for Sphinx API modifications.
/usr/lib/python3.8/site-packages/sphinx/deprecation.py:46: RemovedInSphinx80Warning
_______________________ ERROR at setup of test_postlist ________________________
test_params = {'shared_result': None}
app_params = app_params(args=['html'], kwargs={'srcdir': path('/tmp/pytest-of-tkloczko/pytest-202/postlist')})
make_app = <function make_app.<locals>.make at 0x7fca135f3550>
shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fca136a53a0>
@pytest.fixture(scope='function')
def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable,
shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]:
"""
Provides the 'sphinx.application.Sphinx' object
"""
args, kwargs = app_params
> app_ = make_app(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make
app_: Any = SphinxTestApp(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/util.py:136: in __init__
super().__init__(srcdir, confdir, outdir, doctreedir,
/usr/lib/python3.8/site-packages/sphinx/application.py:219: in __init__
self.setup_extension(extension)
/usr/lib/python3.8/site-packages/sphinx/application.py:398: in setup_extension
self.registry.load_extension(self, extname)
/usr/lib/python3.8/site-packages/sphinx/registry.py:443: in load_extension
mod = import_module(extname)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py:24: in <module>
from sphinx.util import SkipProgressMessage, progress_message
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sphinx.deprecation._ModuleWrapper object at 0x7fca15231fa0>
name = 'SkipProgressMessage'
def __getattr__(self, name: str) -> Any:
if name not in self._objects:
return getattr(self._module, name)
canonical_name = self._names.get(name, None)
if canonical_name is not None:
> warnings.warn(f"The alias '{self._modname}.{name}' is deprecated, "
f"use '{canonical_name}' instead. "
"Check CHANGES for Sphinx API modifications.",
self._warning, stacklevel=3)
E sphinx.deprecation.RemovedInSphinx80Warning: The alias 'sphinx.util.SkipProgressMessage' is deprecated, use 'sphinx.util.display.SkipProgressMessage' instead. Check CHANGES for Sphinx API modifications.
/usr/lib/python3.8/site-packages/sphinx/deprecation.py:46: RemovedInSphinx80Warning
_______________ ERROR at setup of test_postlist_date_format_conf _______________
test_params = {'shared_result': None}
app_params = app_params(args=['html'], kwargs={'confoverrides': {'post_date_format_short': '%Y-%m-%d'}, 'srcdir': path('/tmp/pytest-of-tkloczko/pytest-202/postlist')})
make_app = <function make_app.<locals>.make at 0x7fca136095e0>
shared_result = <sphinx.testing.fixtures.SharedResult object at 0x7fca134dfd30>
@pytest.fixture(scope='function')
def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable,
shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]:
"""
Provides the 'sphinx.application.Sphinx' object
"""
args, kwargs = app_params
> app_ = make_app(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/sphinx/testing/fixtures.py:178: in make
app_: Any = SphinxTestApp(*args, **kwargs)
/usr/lib/python3.8/site-packages/sphinx/testing/util.py:136: in __init__
super().__init__(srcdir, confdir, outdir, doctreedir,
/usr/lib/python3.8/site-packages/sphinx/application.py:219: in __init__
self.setup_extension(extension)
/usr/lib/python3.8/site-packages/sphinx/application.py:398: in setup_extension
self.registry.load_extension(self, extname)
/usr/lib/python3.8/site-packages/sphinx/registry.py:443: in load_extension
mod = import_module(extname)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py:24: in <module>
from sphinx.util import SkipProgressMessage, progress_message
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sphinx.deprecation._ModuleWrapper object at 0x7fca15231fa0>
name = 'SkipProgressMessage'
def __getattr__(self, name: str) -> Any:
if name not in self._objects:
return getattr(self._module, name)
canonical_name = self._names.get(name, None)
if canonical_name is not None:
> warnings.warn(f"The alias '{self._modname}.{name}' is deprecated, "
f"use '{canonical_name}' instead. "
"Check CHANGES for Sphinx API modifications.",
self._warning, stacklevel=3)
E sphinx.deprecation.RemovedInSphinx80Warning: The alias 'sphinx.util.SkipProgressMessage' is deprecated, use 'sphinx.util.display.SkipProgressMessage' instead. Check CHANGES for Sphinx API modifications.
/usr/lib/python3.8/site-packages/sphinx/deprecation.py:46: RemovedInSphinx80Warning
=========================== short test summary info ============================
ERROR tests/test_build.py::test_build - sphinx.deprecation.RemovedInSphinx80W...
ERROR tests/test_build.py::test_feed - sphinx.deprecation.RemovedInSphinx80Wa...
ERROR tests/test_external.py::test_external - sphinx.deprecation.RemovedInSph...
ERROR tests/test_postlist.py::test_postlist - sphinx.deprecation.RemovedInSph...
ERROR tests/test_postlist.py::test_postlist_date_format_conf - sphinx.depreca...
============================== 5 errors in 0.70s ===============================
System Details
Here is list of installed modules in build env
Package Version
----------------------------- -----------------
aiosignal 1.3.1
alabaster 0.7.13
appdirs 1.4.4
async-generator 1.10
async-timeout 4.0.2
attrs 22.2.0
Babel 2.11.0
Brotli 1.0.9
build 0.9.0
charset-normalizer 3.0.1
coverage 7.1.0
cssselect 1.1.0
Cython 0.29.33
distro 1.8.0
docutils 0.19
exceptiongroup 1.0.0
extras 1.0.0
fixtures 4.0.0
freezegun 1.2.1
frozenlist 1.3.3
gpg 1.18.0-unknown
idna 3.4
imagesize 1.4.1
importlib-metadata 6.0.0
iniconfig 2.0.0
Jinja2 3.1.2
libcomps 0.1.19
lxml 4.9.2
Markdown 3.4.1
MarkupSafe 2.1.2
multidict 6.0.4
numpy 1.24.2
olefile 0.46
packaging 23.0
pbr 5.9.0
pep517 0.13.0
Pillow 9.4.0
pip 22.3.1
pluggy 1.0.0
Pygments 2.14.0
PyGObject 3.43.1.dev0
pytest 7.2.1
pytest-cov 4.0.0
pytest-mock 3.10.0
python-dateutil 2.8.2
pytz 2022.4
re-assert 1.1.0
regex 2022.10.31
requests 2.28.2
rpm 4.17.0
scour 0.38.2
setuptools 65.6.3
six 1.16.0
smartypants 2.0.1
snowballstemmer 2.2.0
Sphinx 6.1.3
sphinxcontrib-applehelp 1.0.2.dev20221204
sphinxcontrib-asyncio 0.3.0
sphinxcontrib-devhelp 1.0.2.dev20230202
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1.dev20230128
sphinxcontrib-qthelp 1.0.3.dev20230128
sphinxcontrib-serializinghtml 1.1.5
testtools 2.5.0
toml 0.10.2
tomli 2.0.1
typing_extensions 4.4.0
typogrify 2.0.7
urllib3 1.26.12
wheel 0.38.4
yarl 1.8.2
zipp 3.13.0
Installation method
No response
That I will need to patch but I think if you can run pytest with -p no:warning
that will silence those warnings and you can continue building the package.
It is always better to jhave those watnings in build logs ๐
Looking over #202 I don't see the same warning.
Looking at the pytest output more closely, the error comes from:
/usr/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py:24: in <module>
from sphinx.util import SkipProgressMessage, progress_message
That import is not within ablog
nor is that a direct dependency. I assume some other package is installing it and therefore causing that warning. Why I can't replicate it on the CI, I am unsure.
It would be better to silence that warning when building the RPM.
That import is not within
ablog
nor is that a direct dependency. I assume some other package is installing it and therefore causing that warning. Why I can't replicate it on the CI, I am unsure.
In build env are instaled only moduels required to build module and its docmentation and test it as well. .. ๐ค
In build env are instaled only moduels required to build module and its docmentation and test it as well. .. ๐ค
Yeah, it must be a dependency of a dependency but I can't replicate it on this repo. So I would suggest ignoring it and continue building it since I don't think I can patch this in ablog.
If you have other problems packaging, please reopen this issue.
As I've provided list of modules with versions could you please have look one more time on that list and compare it with what you have instaled in your build env? ๐ค
As I've provided list of modules with versions could you please have look one more time on that list and compare it with what you have instaled in your build env? thinking
That list is:
mistune==2.0.5
myst-parser==0.18.1
nbclient==0.7.2
nbconvert==7.2.9
nbformat==5.7.3
nbsphinx==0.8.12
packaging==23.0
pandocfilters==1.5.0
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
pip==23.0
platformdirs==3.0.0
pluggy==1.0.0
prompt-toolkit==3.0.36
ptyprocess==0.7.0
pure-eval==0.2.2
Pygments==2.14.0
pyrsistent==0.19.3
pytest==7.2.1
python-dateutil==2.8.2
pytz==2022.7.1
PyYAML==6.0
pyzmq==25.0.0
requests==2.28.2
setuptools==67.1.0
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.4
Sphinx==5.3.0
sphinx-automodapi==0.14.1
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
stack-data==0.6.2
tinycss2==1.2.1
tornado==6.2
traitlets==5.9.0
typing_extensions==4.5.0
urllib3==1.26.14
watchdog==2.2.1
wcwidth==0.2.6
webencodings==0.5.1
wheel==0.38.4
from the most recent time the tests ran on the 0.10 branch.
This has: sphinxcontrib-applehelp==1.0.4
where as yours is sphinxcontrib-applehelp 1.0.2.dev20221204
.
This would explain why the warning does not appear assuming they patched it in the latter versions.
Sphinx==5.3.0
Here is the main differense.
I'm usimg lates 6.1.3.
Ah yeah, not sure how I missed that.
So despite me asking for sphinx 6, one of the dependencies is pinning it to below 6. I will need to work out which one is doing that.
But I have to say again, this is not a bug in ablog. All I can do is add a ignore to the pytest config and do a post tag release of 0.10.
The cause is:
myst-parser 0.18.1 requires sphinx<6,>=4, but you have sphinx 6.1.3 which is incompatible.
Which means technically you can install sphinx 6 but ablogs depencies still have not updated for it yet.
I have ignored the warning in a pull request and now it builds without that warning on sphinx 6.
I have released https://pypi.org/project/ablog/0.10.33.post1/ which hopefully will stop this warning from occuring when you build the rpm.
I've just started looking on recent changes and I think that it is typi in git tag (which my build procedure is using)).
Instead 0.10.33post1
it should be 0.10.33.post1
(with dot) to match the same version as it is on pypi.
OK looks like 0.10.33.post1
is OK.
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-ablog-0.10.33post1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-ablog-0.10.33post1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
libraries: Sphinx-6.1.3, docutils-0.19
base tempdir: /tmp/pytest-of-tkloczko/pytest-9
rootdir: /home/tkloczko/rpmbuild/BUILD/ablog-0.10.33post1, configfile: setup.cfg, testpaths: tests
collected 5 items
tests/test_build.py .. [ 40%]
tests/test_external.py . [ 60%]
tests/test_postlist.py .. [100%]
===================================================================================== 5 passed in 1.57s =====================================================================================
However I'll hold pushing fixed version into my VCS until version string will ve confirmed ๐
Thank you ๐
Oh yeah, not sure how that happened. I'm not sure I want to create a second tag to correct that since the pypi version is correct.
You can just add new tag on the same hash and delete old one and than just puch changes to github ๐
Thak you Nabil for the confirmation๐
In that case I will change it. I think Github stripped out the extra full stop.
I have added a correct v0.10.33.post1
tag https://github.com/sunpy/ablog/tree/v0.10.33.post1
Thank you.