Opened 3 years ago
Last modified 23 hours ago
#27578 new defect
Use sphinx.util.inspect.Signature not sphinx.ext.autodoc.inspector.formatargspec
Reported by: | jhpalmieri | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | sage-9.8 |
Component: | documentation | Keywords: | sphinx, formatargspec, Signature |
Cc: | fbissey, jdemeyer, slelievre, strogdon, gh-tobiasdiez | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
After upgrading to Sphinx 1.8.5 in #26451, Sphinx's function formatargspec
is deprecated, so we should not use anymore it in src/sage_setup/docbuild/ext/sage_autodoc.py
.
The deprecation warning advises to replace the use of sphinx.ext.autodoc.inspector.formatargspec
by that of sphinx.util.inspect.Signature
.
For ordinary Python functions, we may be able to change formatargspec(my_func, *argspec)
to Signature(my_func).format_args()
. I don't think this works with Cython functions, though.
Change History (19)
comment:1 Changed 3 years ago by
comment:2 Changed 3 years ago by
Sphinx has its own Signature
class (in sphinx.util.inspect
), and that's what I was thinking about using.
comment:3 Changed 3 years ago by
- Cc fbissey added
comment:4 Changed 3 years ago by
- Cc strogdon added
comment:5 Changed 3 years ago by
- Cc slelievre added
- Keywords sphinx formatargspec Signature added
- Summary changed from Don't use sphinx.ext.autodoc.inspector.formatargspec anymore to Use sphinx.util.inspect.Signature not sphinx.ext.autodoc.inspector.formatargspec
comment:6 Changed 3 years ago by
- Cc jdemeyer added
- Description modified (diff)
comment:7 Changed 3 years ago by
The proposed changes at #27971 get rid of the deprecation warnings. We can leave this open in case it is worthwhile to use Sphinx's Signature
or Python 3's Signature
. (And maybe we should use those in sageinspect.py
, too?)
comment:8 Changed 3 years ago by
- Milestone changed from sage-8.8 to sage-8.9
Moving open critical and blocker issues to the next release milestone (optimistically).
comment:9 Changed 3 years ago by
- Milestone changed from sage-8.9 to sage-9.1
Ticket retargeted after milestone closed
comment:10 Changed 2 years ago by
- Milestone changed from sage-9.1 to sage-9.2
comment:11 Changed 2 years ago by
- Milestone changed from sage-9.2 to sage-9.3
comment:12 Changed 18 months ago by
See also: #31309 sage_getargspec
mishandles keyword-only arguments
comment:13 Changed 17 months ago by
- Milestone changed from sage-9.3 to sage-9.4
Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.
comment:14 Changed 13 months ago by
- Milestone changed from sage-9.4 to sage-9.5
comment:15 Changed 8 months ago by
- Milestone changed from sage-9.5 to sage-9.6
comment:16 Changed 4 months ago by
- Cc gh-tobiasdiez added
comment:17 Changed 4 months ago by
An alternative is proposed in #30884.
comment:18 Changed 3 months ago by
- Milestone changed from sage-9.6 to sage-9.7
comment:19 Changed 23 hours ago by
- Milestone changed from sage-9.7 to sage-9.8
The
Signature
class is new in Python 3, though there exists a backport of it for Python 2 so we'd have to add the backport as a depency so long as we still support Python 2. Obviously adding the backport is no big deal. I've used it before and it works fine. It's not a bad idea, since theSignature
interface is much nicer in general thaninspect.getargspec
.