Comments (25)
@exarkun set owner to @mwhudson |
---|
I think docextractor has a plan to deal with this?
from twisted.
Automation removed owner |
---|
from twisted.
@glyph set status to closed |
---|
See #3139 for the remaining issue originally referred to. I believe the tools now do what we need, which is what this issue was really about.
from twisted.
spiv commented |
---|
#!html
<pre>
Yeah, something like that sounds good.
I'm assigning this to me... I'll try find some time to see
how easy/hard this is to do sometime in the next few days.
</pre>
from twisted.
@radix commented |
---|
#!html
<pre>
Some of the links to API documentation from
http://twistedmatrix.com/documents/howto/pb-usage link
to pages that return 404.
For example, the section that reads "First we look at
the server. This defines an Echoer class (derived from
pb.Root), with a method called remote_echo() ..." links
to
http://twistedmatrix.com/documents/TwistedDocs/current/api/public/twisted.spread.pb.Root.html
which is a 404.
WebCVS says that the source doc for this looks like:
<p>First we look at the server. This defines an Echoer
class (derived from
<code class="API"
base="twisted.spread">pb.Root</code>), with a method called
<code>remote_echo()</code>.
Don't know enough Twisted to say whether this is a bug
in the docs or in Lore or whether the docs are out of date.
</pre>
from twisted.
spiv commented |
---|
#!html
<pre>
The pb.Root link is broken because Root is actually defined
in twisted/spread/flavors.py, and is merely imported by
pb.py, so epydoc doesn't document it. Unfortunately,
typical use is to import it from pb, so the HOWTO is
correct. I'm not sure what the right fix for this is.
(This is probably a good reason to avoid nasty "promotion"
hacks where a class is defined in one module, but only
documented publicly as available from another. Yes, I'm
thinking about flow here ;)
</pre>
from twisted.
@radix commented |
---|
#!html
<pre>
so, you fixed the function thing already, right? then all
that's left is this "alias" thing.
Here are the ways I can think of fixing it.
* Similar to my idea (that you didn't like) about the
function problem, we could have lore do a o =
namedObject(aliasname), then *actually* like to qual(o). I
know you don't like this. :-)
* Manually maintain a list of aliases for lore to look up
all api links in and replace.
* Add more markup to allow the text of the link to be
different from the actual api link.
</pre>
from twisted.
spiv commented |
---|
#!html
<pre>
Yep, functions links are fixed (in CVS, anyway).
* Yep, still don't like it, especially for such a minor bug.
* Keeping an explicit list of aliases is pretty sucky, but
not as bad as your first suggestion :)
* Yuck, I don't like the idea of markup for that. What
about the print form -- epydoc can produce latex, so it
would be possible to make Lore link to API docs in print.
But if the reader sees "pb.Root (page 434)" and then turns
to 434 and finds the documentation for the flavors module,
they'll be confused.
I think what the best solution would be is to mark the alias
in the *source*. We should do this anyway; what if some
later maintainer deleted the "from flavors import Root" line
in pb.py because it wasn't needed by the code in pb.py
anymore? There should be some sign in the source that a
variable is part of the public API of a module, even if it
is just an import from elsewhere.
If we did that, then we could fix epydoc, not Lore :)
This makes sense to me, because "pb.Root" is an API, and it
should appear in the API docs...
</pre>
from twisted.
@radix commented |
---|
#!html
<pre>
Soo... something like, in pb.py
from twisted.python.epysupport import alias
alias('twisted.spread.flavors.Root', 'twisted.spread.pb.Root')
or maybe
alias(flavors.Root, 'twisted.spread.pb.Root')
or just
alias(flavors.Root) with a hack to look in the caller's
namespace to see which module he's coming from ;)
</pre>
from twisted.
@itamarst commented |
---|
#!html
<pre>
How's this going?
</pre>
from twisted.
@radix commented |
---|
#!html
<pre>
Itamar Shtull-Trauring <itamar@...> added the comment:
> How's this going?
Still no progress, still haven't figured out how to continue.
</pre>
from twisted.
spiv commented |
---|
#!html
<pre>
So, we could just "fix" this with a nasty hack: just define a trivial subclass
in pb.py, e.g.:
class Root(flavors.Root):
pass
Actually, I guess the proposed alias function could do this... but working with
epydoc rather than hacking around it is probably a better idea.
</pre>
from twisted.
@moshez commented |
---|
#!html
<pre>
I thought of this.
It bothered me because of persistence constraints.
</pre>
from twisted.
@teratorn commented |
---|
#!html
<pre>
At #38 this issue wins the prize for oldest unresolved bug ;)
If it's not gonna be fixed, can we just mark it done-cbb and move along?
</pre>
from twisted.
@radix commented |
---|
#!html
<pre>
It's not done at all, and it stil has to be fixed. :-(
</pre>
from twisted.
@mwhudson commented |
---|
Well, um, given that we control all the software involved, we could certainly come up with a plan. I don't really have one yet, though. It ought to be easy to recognise this "alias" function.
(wasn't there another bug almost exactly like this? ah, yes #10752)
from twisted.
@exarkun commented |
---|
FWIW, for some reason, I don't really like the alias() plan. We are already annotating the module with its public API, by way of all. Would it be much harder to detect that instead (assuming it is all static and non-magical, of course)? I'd be happy to do some work on this, if we can get everyone to agree it's the right thing.
from twisted.
@mwhudson commented |
---|
twisted/spread/pb.py doesn't define __all__
, although it could. I guess you could say I really don't like __all__
for some reason :)
It shouldn't be at all hard to detect, though.
from twisted.
@jyknight commented |
---|
(Reposting comment from #11370, which was a duplicate of this):
This is an issue for e.g. twisted.internet.stdio. It imports one of _win32stdio or _posixstdio. But those are implementation details. Docs should show up under the t.i.stdio module, somehow. (Let's leave aside that the StandardIO class doesn't currently have documentation: at least the class definition should show up.)
from twisted.
@mwhudson commented |
---|
Well, I have the opposite of a fix at
(look where the pb.Referenceable link goes).
Sadly, I'm not sure this gets us any closer to a proper fix to the problem.
from twisted.
@mwhudson commented |
---|
Is there anything even approaching a consensus on how to proceed here? I'm now at a point where I think there are no real technical obstacles. The most likely approach seems to be to be defining an {{all}} in spread/pb.py, having pydoctor notice when a name from {{all}} is imported into a module and doing the appropriate magic.
Who knows what should go in pb.all ? Here's an automatically derived guess:
set(['Cacheable', 'portno', 'Copyable', 'RemoteReference', 'Viewable',
'RemoteCache', 'authIdentity', 'ProtocolError', 'getObjectAt', 'ViewPoint',
'PBServerFactory', 'setUnjellyableForClass', 'Broker', 'Referenceable',
'setCopierForClassTree', 'setCopierForClass', 'RemoteCopy', 'PBClientFactory',
'Avatar', 'IPerspective', 'Root', 'failure2Copyable', 'DeadReferenceError',
'BrokerFactory'])
from twisted.
@mwhudson commented |
---|
OK, the pydoctor part of this is done. Has some slightly surprising consequences, like SelectReactor becoming part of twisted.internet.default:
http://starship.python.net/crew/mwh/apidocs/twisted.internet.default.html
from twisted.
@exarkun commented |
---|
+1 on !all!
from twisted.
@glyph commented |
---|
So, the URL that mwh points to here actually doesn't show SelectReactor
as part of twisted.internet.default
. Maybe it did at one point? Or maybe it's an option or something? We should generate the API docs with a recent version of pydoctor and see what they look like, because this sounds like it might already be done to me.
from twisted.
@glyph commented |
---|
The URL that MWH points to here now does show SelectReactor
. Hooray! I think the thing to do now is to close this ticket - our oldest open ticket! - and open a new one that deals with the specific PB documentation links issue.
from twisted.
Related Issues (20)
- Continued Use of Insecure Default Parameters HOT 8
- Deprecation of SSH ciphers HOT 1
- t.c.ssh.channel.SSHChannel.write has no limit to the buffer
- t.c.ssh.filetransferserver.FileTransferServer.packet_READ with unhandled error
- type confusion in KnownHosts.verifyHostKey traceback when adding ip key
- Compiled version of DelayedCall
- Change documentation for optional dependency SOAPpy to SOAPpy-py3 HOT 6
- Remove the soap code
- `twisted.internet.test.test_tcp.AbortConnectionTests_*Tests.test_fullWriteBuffer` test timeout on macOS HOT 13
- TwistedWeb ReverseProxyResource example has string not bytes as third argument
- Setup benchmarks using Codspeed.io HOT 6
- Speed up twisted.web server, part 2 of N
- Deprecate t.w.h.HTTPClient HOT 4
- t.w.h.HTTPClient parses Content-Length laxly HOT 1
- disttrial / `trial -j` should support debug prints
- `twisted.python.test.test_sendmsg.SendmsgTests.test_sendSubProcessFD` is flaky HOT 2
- Deprecation docs should use NEXT placeholders
- Improve defer.inlineCallbacks tests
- twisted.web generates deprecation warnings internally HOT 3
- Expand benchmarks to run on PyPy as well HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twisted.