Skip to content

autodoc&autosummary fails for uppercase/lowercase class/function #4874

Open

Description

Error: toctree references unknown document for class and function with same name, one uppercase, one lowercase.

Problem

Having a module which contains a class Colorbar and a function colorbar, it seems impossible to get a working documentation out with autodoc and autosummary.

Procedure to reproduce the problem

class Colorbar():
      # ...

def colorbar():
     # ...

result when calling make html is

D:\xyz\doc\source\_as_gen\colorbar.rst:29: 
WARNING: toctree references unknown document ' _as_gen/colorbar.colorbar'

There is a document
_as_gen\colorbar.Colorbar.rst produced. But no _as_gen\colorbar.colorbar.rst (probably as expected due to the os not differentiating between upper and lower case).

Reproducible project / your project

A runnable example can be found here:

https://github.com/ImportanceOfBeingErnest/sphinx-mwe/tree/master/sphinx-upperlowercase

Environment info

  • OS: Windows 8.1
  • Python version: 2.7
  • Sphinx version: 1.7.1

Activity

  1. tk0miya commented on Apr 21, 2018

    @tk0miya
    Member

    I guess filesystem of windows causes this problem. It ignores the case of characters.
    I can't think of any good ideas or workarounds for this trouble...

  2. jfbu commented on Apr 22, 2018

    @jfbu
    Contributor

    The very same problem is confirmed on MacOS X. (thanks for the example project)

  3. tk0miya commented on Apr 22, 2018

    @tk0miya
    Member

    AFAIK, (old?) MacOS also uses case-insensitive filesystem...

    On my macbook air, it is easily reproduced:

    $ uname -a
    Darwin deneb.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
    $ echo Uppercase > Colorbar.rst
    $ echo lowercase > colorbar.rst
    $ ls -l
    total 8
    -rw-r--r--  1 tkomiya  staff  10  4 22 19:33 Colorbar.rst
    $ cat Colorbar.rst
    lowercase
    

    Unfortunately, two major OS chooses case-insensitive file system by default. So we need to avoid such trouble.

  4. jfbu commented on Apr 22, 2018

    @jfbu
    Contributor

    @tk0miya afaik the default for all MacOS (old and new) is case-insensitive. But it is possible in recent MacOSes to decide for case-sensitive at install time. If not done initially, then a re-format of hard drive is needed..

  5. added this to the some future version milestone on Sep 29, 2022
  6. larsoner commented on Apr 26, 2023

    @larsoner
    Contributor

    For anyone else who stumbles around this, it looks like one workaround is to use autosummary_filename_map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions