Closed kloczek closed 1 year ago
These tests are explicitly testing that these warnings are raised: https://github.com/pypa/readme_renderer/blob/6a9b282823e033d4344ca519452c49def6d259ec/tests/test_noextra.py
I'm not sure there's a way to suppress them from being surfaced by pytest.
I'm more concerned about the skipped test, is your distribution of readme_renderer
missing the test fixtures?
These tests are explicitly testing that these warnings are raised
Ah .. so there is nothing to do here 😄 Thank you to let me know. I'm closing this ticket.
I'm more concerned about the skipped test, is your distribution of
readme_renderer
missing the test fixtures?
Did you see this?
I'm not sure what it it means. Can you explain that shortly?
That test depends on the files in https://github.com/pypa/readme_renderer/tree/main/tests/fixtures being present. It appears that the test was skipped because none of these files are present in the environment in which you ran these tests.
As input resource I'm using autogenerated tar ball from git tag. https://github.com/pypa/readme_renderer/archive/32.0/python-readme_renderer-32.0.tar.gz That tar ball contais tests/fixture/ directory.
@kloczek What's the output of the following command in the root of that tarball?
$ python -c "from tests.test_markdown import MD_FIXTURES; print(MD_FIXTURES)"
If that's empty, what's the following:
$ python -c 'from tests.test_markdown import __file__; import glob; import os; print(list(glob.iglob(os.path.join(os.path.dirname(__file__), "fixtures", "test_GFM*.md"))))'
And if that's empty, what's this?
$ python -c 'from tests.test_markdown import __file__; import os; print(os.path.join(os.path.dirname(__file__), "fixtures"))'
@kloczek What's the output of the following command in the root of that tarball?
$ python -c "from tests.test_markdown import MD_FIXTURES; print(MD_FIXTURES)"
/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/readme_renderer/markdown.py:44: UserWarning: Markdown renderers are not available. Install 'readme_renderer[md]' to enable Markdown rendering. warnings.warn(_EXTRA_WARNING) []
If that's empty, what's the following:
$ python -c 'from tests.test_markdown import __file__; import glob; import os; print(list(glob.iglob(os.path.join(os.path.dirname(__file__), "fixtures", "test_GFM*.md"))))'
/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/readme_renderer/markdown.py:44: UserWarning: Markdown renderers are not available. Install 'readme_renderer[md]' to enable Markdown rendering. warnings.warn(_EXTRA_WARNING) ['/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_001.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_002.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_003.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_004.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_005.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_006.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_007.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_008.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_009.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_010.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_011.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_012.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_013.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_014.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_015.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_016.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_017.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_018.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_019.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_020.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_021.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_022.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_023.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_024.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_025.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_doublequotes.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_highlight.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_highlight_default_py.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_img.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_malicious_pre.md', '/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures/test_GFM_style.md']
And if that's empty, what's this?
$ python -c 'from tests.test_markdown import __file__; import os; print(os.path.join(os.path.dirname(__file__), "fixtures"))'
It is not empty however just FTR result
/home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/readme_renderer/markdown.py:44: UserWarning: Markdown renderers are not available. Install 'readme_renderer[md]' to enable Markdown rendering. warnings.warn(_EXTRA_WARNING) /home/tkloczko/rpmbuild/BUILD/readme_renderer-32.0/tests/fixtures
Got it. Looks like you're testing this without the optional cmarkgfm
dependency:
https://github.com/pypa/readme_renderer/blob/f96ab230fcd4fb92e48be897320bbdcd1f0a0ffc/setup.py#L62
How does your redistributing handle these 'extra' dependencies?
How does your redistributing handle these 'extra' dependencies?
Generally speaking as I'm packaging readme_renderer
as rpm package all depends on manually specified BuidRequires.
OK. Will try to add that module to build env 😄
@kloczek Did you figure this out? If so, feel free to close the issue!
Still I have the same warnings ..
I don't think we have enough details to effectively assist here, as we don't have information as to how you're packaging this code, so can't reproduce.
Can you share more on how we could reproduce this issue to try and resolve?
What kind of details you need?
Maybe for starters, what commands and environment you’re using to run this rpm build? StackOverflow has a good article on what to provide for reproduction: https://stackoverflow.com/help/minimal-reproducible-example
I'm using pep517 based buid:
python3 -sBm build -w --no-isolation
Here it is list of modules installd in build env
Package Version
--------------- --------------
attrs 22.1.0.dev0
bleach 5.0.0
Brlapi 0.8.3
build 0.8.0
codespell 2.1.0
cycler 0.11.0
distro 1.7.0
docutils 0.17.1
extras 1.0.0
fixtures 4.0.0
fonttools 4.33.3
gpg 1.17.1-unknown
html5lib 1.1
iniconfig 1.1.1
kiwisolver 1.4.3
libcomps 0.1.18
louis 3.22.0
matplotlib 3.5.2
numpy 1.23.0
olefile 0.46
packaging 21.3
pbr 5.8.1
pep517 0.12.0
Pillow 9.1.1
pip 22.0.4
pluggy 1.0.0
py 1.11.0
Pygments 2.12.0
PyGObject 3.42.1
pyparsing 3.0.9
pytest 7.1.2
python-dateutil 2.8.2
rpm 4.17.0
setuptools 62.6.0
six 1.16.0
testtools 2.5.0
tomli 2.0.1
webencodings 0.5.1
wheel 0.37.1
Thanks for the details.
I think the crux of this issue, as @di pointed out earlier, is that you're missing the extras
dependency of cmarkgfm
which would then execute more of the test suite. It's a runtime dependency, and will produce end-user warnings of the package isn't present, and the test suite confirms that.
You haven't provided how the build tool dependencies are installed, nor the library dependencies, nor the pytest dependency that is then invoked. In your list of dependencies, the install_requires
ones are present, which is as intended.
My current read on this is that it comes down to how your unique build environment is being set up - and not about the package and dependencies.
Looks like pytest shows few warnings