Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python bases in packages #4944

Closed
Eldinnie opened this issue May 8, 2018 · 3 comments
Closed

python bases in packages #4944

Eldinnie opened this issue May 8, 2018 · 3 comments
Labels
Milestone

Comments

@Eldinnie
Copy link

Eldinnie commented May 8, 2018

Problem

When documented our library we would like the base classes to be displayed as you can import them (and they're documented aswell)

let's assume the following

# telegram/base.py

class TelegramObject(object):
  pass
#telegram/chat.py

from telegram import TelegramObject
class Chat(TelegramObject):
  pass
#telegram/__init__.py

from .base import TelegramObject
from .chat import Chat
__all__ = ['TelegramObject', 'Chat']
index.rst

.. toctree::

  telegram.telegramobject
  telegram.chat
telegram.telegramobject.rst

telegram.TelegramObject
=======================

.. autoclass:: telegram.TelegramObject
    :members:
    :show-inheritance:
telegram.chat.rst

telegram.Chat
=============

.. autoclass:: telegram.Chat
    :members:
    :show-inheritance:

Procedure to reproduce the problem

run sphinx-build -b html

Error logs / results

Chat shows it's base as:
telegram.base.TelegramObject
http://python-telegram-bot.readthedocs.io/en/stable/telegram.chat.html

Expected results

I would like Chat to show it's base as telegram.TelegramObject
That way it would link through and we can properly show inheritence
There's also a issue #3014 which would also be fine so we can fix it ourselves

Reproducible project / your project

https://github.com/python-telegram-bot/python-telegram-bot/tree/master/docs

Environment info

  • OS: Linux/Win/whatever runs on rtd
  • Python version: 2.7, 3.6 or 3.7
  • Sphinx version: 1.6.5, 1.7.2
@MuellerSeb
Copy link

#5589 is similar.

@tk0miya
Copy link
Member

tk0miya commented Mar 27, 2021

Now I merged #9026 that generates :canonical: option for the imported classes. It allows to refer to the python objects by its canonical name. It will resolve this problem.
Thanks,

@tk0miya tk0miya closed this as completed Mar 27, 2021
@tk0miya tk0miya reopened this Mar 27, 2021
@tk0miya
Copy link
Member

tk0miya commented Mar 27, 2021

Ah, sorry. #9026 does not resolve this issue. It allows to make a hyperlink as telegram.base.TelegramObject, not telegram.TelegramObject. So this is not resolved yet. So reopening now.

@tk0miya tk0miya modified the milestones: 4.0.0, 4.1.0 Mar 27, 2021
@tk0miya tk0miya closed this as completed May 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants