pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

help running tests during debian package build

Open sandrotosi opened this issue 3 years ago • 1 comments

Hello, i'm packaging pydata-sphinx-theme and i have a problem when running tests in our build environment: if i run pytest in the top-level directory, they all pass, but if i run in the destination of setup.py build they all fail like this one:

___________________________ test_navbar_align_right ____________________________

sphinx_build_factory = <function sphinx_build_factory.<locals>._func at 0x7fb0366b5b80>

    def test_navbar_align_right(sphinx_build_factory):
        """The navbar items align with the proper part of the page."""
        confoverrides = {"html_theme_options.navbar_align": "right"}
>       sphinx_build = sphinx_build_factory("base", confoverrides=confoverrides).build()

tests/test_build.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_build.py:49: in _func
    app = make_app(
/usr/lib/python3/dist-packages/sphinx/testing/fixtures.py:195: in make
    app_ = SphinxTestApp(*args, **kwargs)  # type: Any
/usr/lib/python3/dist-packages/sphinx/testing/util.py:133: in __init__
    super().__init__(srcdir, confdir, outdir, doctreedir,
/usr/lib/python3/dist-packages/sphinx/application.py:272: in __init__
    self._init_builder()
/usr/lib/python3/dist-packages/sphinx/application.py:330: in _init_builder
    self.builder.init()
/usr/lib/python3/dist-packages/sphinx/builders/html/__init__.py:220: in init
    self.init_templates()
/usr/lib/python3/dist-packages/sphinx/builders/html/__init__.py:260: in init_templates
    self.theme = theme_factory.create(themename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sphinx.theming.HTMLThemeFactory object at 0x7fb035f38790>
name = 'pydata_sphinx_theme'

    def create(self, name: str) -> Theme:
        """Create an instance of theme."""
        if name not in self.themes:
            self.load_extra_theme(name)
    
        if name not in self.themes:
            if name == 'sphinx_rtd_theme':
                raise ThemeError(__('sphinx_rtd_theme is no longer a hard dependency '
                                    'since version 1.4.0. Please install it manually.'
                                    '(pip install sphinx_rtd_theme)'))
            else:
>               raise ThemeError(__('no theme named %r found '
                                    '(missing theme.conf?)') % name)
E               sphinx.errors.ThemeError: no theme named 'pydata_sphinx_theme' found (missing theme.conf?)

/usr/lib/python3/dist-packages/sphinx/theming.py:247: ThemeError

i diff'ed pydata-sphinx-theme and tests directories, but they are exactly the same, what am i missing?

thanks, Sandro

sandrotosi avatar Mar 13 '21 03:03 sandrotosi

I am not very familiar with debian packaging, so can you give a bit more details on how you built / tested the package? (to reproduce it locally)

Did you install the package? (base on the error message, it seems the package was not installed in the environment (it is the setup.py that registers the theme to sphinx as an entry point) How did you run the tests? (as I don't think we include the tests in the built package, right now)

jorisvandenbossche avatar Mar 22 '21 13:03 jorisvandenbossche

This issue has been closed because it has been inactive for more than a year. You may reopen this issue if it has been closed in error.

12rambau avatar Sep 12 '22 08:09 12rambau