-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Eliminate use of __init__.py files for supplying package docstrings #32508
Comments
Branch: u/klee/32508 |
Author: Kwankyu Lee |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
Previously sage: import sage.combinat
sage: sage.combinat.quickref? worked. Not anymore with the patch. We should sage: import sage.combinat.quickref
sage: sage.combinat.quickref? The same with |
comment:5
More seriously, before the patch, sage: import sage.combinat
sage: help(sage.combinat) gives a nice ... help. Could we retain this functionality somehow while eliminating the content of |
comment:6
I guess with a bit of extra code in |
comment:7
Replying to @mkoeppe:
I cannot guess how. Where should the content go? Do you imagine a file like |
comment:8
|
comment:9
+1 on |
comment:10
Replying to @mkoeppe:
Do you mean |
comment:11
With |
comment:12
Then |
comment:13
On the other hand, I wonder if there is a solution(or recommendation) for this problem(package docstring) in python level as this seems a general issue with namespace packages. |
comment:14
Replying to @kwankyu:
Yes, that's what I thought |
comment:15
Replying to @kwankyu:
I agree, it would be good to find out whether there are existing practices for this in the Python community. |
comment:16
Replying to @mkoeppe:
One problem with How about this:
Then the namespace package Is this too much or incompatible with the modularization plan? |
comment:17
Replying to @mkoeppe:
I googled for it, but found none. |
comment:18
How about we just use (Modularized packages such as sagemath-polyhedra (#32432) add files such as |
comment:19
Replying to @mkoeppe:
How does (1) Does it exist by itself and import other (2) Or is it dynamically created by combining Anyway, if it is at |
comment:20
Yes, |
comment:21
Generally, if the |
comment:22
If |
comment:23
Replying to @mkoeppe:
Hmm. if the For experiment, I created sage: import sage.namespace.all
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-f30e99bc2b64> in <module>
----> 1 import sage.namespace.all
ModuleNotFoundError: No module named 'sage.namespace.all' |
comment:24
The current default build system of the Sage library does not actually understand namespace packages. If you look into the installed Sage library in If you want to test this, you can use |
comment:25
Replying to @mkoeppe:
Thanks. It works. |
comment:44
I don't see a reason why |
comment:45
Replying to @kwankyu:
Not necessarily. Only the |
comment:46
Re-running the command from the ticket description of #32501 on the present branch:
|
comment:47
To do:
Not necessary to change:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
New commits:
|
comment:50
Re-running the command from the ticket description of #32501 on the present branch:
|
Reviewer: Matthias Koeppe |
comment:52
Looking great but I'm getting a docbuild error:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:54
Strange that those errors got slipped in unnoticed... |
comment:55
It's working now, and the built documentation also looks fine. Thanks! |
comment:56
Looks good indeed. Just one thing (that could possibly go in a follow up First because it's easier to remember, and does not But also because, thanks to intersphinx links these Thanks, |
comment:57
Replying to @nthiery:
If you compare "before" and "after" below, we see that Sphinx recognizes regular package and treat it appropriately. Hence I think we need to wait until Sphinx gets equipped with some mechanism to deal with namespace packages appropriately. It seems that Sphinx does not have such a mechanism yet (as far as I know by googling). Before the patch: this line
generates
After the patch: this line
generates
|
Changed branch from public/32508 to |
Changed commit from |
comment:59
The addition of
to |
comment:60
Replying to @jhpalmieri:
After 7 months, I don't remember why I put that line into |
comment:61
Indeed, there is no reason for quickref and tutorial to be in the global namespace. |
comment:62
See #33933. |
... as in
src/sage/categories/__init__.py
orsrc/sage/combinat/__init__.py
(part of #32501)
CC: @tscrim @kwankyu @nthiery
Component: refactoring
Author: Kwankyu Lee
Branch:
ee4367d
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/32508
The text was updated successfully, but these errors were encountered: