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

Fix broken references in docs/client_reference.rst #5620

Merged
merged 4 commits into from
May 24, 2021

Conversation

l1storez
Copy link
Contributor

What do these changes do?

This change corrects multiple unrendered intersphinx class reference in the client_reference.rst document.

Are there changes in behavior for the user?

NO

Related issue number

#5518

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@l1storez
Copy link
Contributor Author

l1storez commented Apr 15, 2021

There are some fixes of "warnings". When I finalize PR, I will change commit messages. PR shows my progress
Looking for:
home/alexe/aiohttp/docs/client_reference.rst:779: WARNING: py:class reference target not found: callable
/home/alexe/aiohttp/docs/client_reference.rst:: WARNING: py:class reference target not found: abc.Mapping
/home/alexe/aiohttp/docs/client_reference.rst:516: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:534: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:541: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:554: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:561: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:574: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:589: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:607: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:626: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:632: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:: WARNING: py:class reference target not found: aiohttp.protocol.HttpVersion
/home/alexe/aiohttp/docs/client_reference.rst:991: WARNING: py:class reference target not found: aiohttp.ClientRequest
/home/alexe/aiohttp/docs/client_reference.rst:1137: WARNING: py:class reference target not found: aiohttp.abc.AbstractResolver
/home/alexe/aiohttp/docs/client_reference.rst:1216: WARNING: py:meth reference target not found: ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:1232: WARNING: py:class reference target not found: HttpVersion
/home/alexe/aiohttp/docs/client_reference.rst:1441: WARNING: py:class reference target not found: callable
/home/alexe/aiohttp/docs/client_reference.rst:1444: WARNING: py:class reference target not found: ClientRequest
/home/alexe/aiohttp/docs/client_reference.rst:1467: WARNING: py:func reference target not found: aiohttp.ws_connect
/home/alexe/aiohttp/docs/client_reference.rst:1483: WARNING: py:meth reference target not found: start
/home/alexe/aiohttp/docs/client_reference.rst:1580: WARNING: py:class reference target not found: callable
/home/alexe/aiohttp/docs/client_reference.rst:1641: WARNING: py:class reference target not found: callable
/home/alexe/aiohttp/docs/client_reference.rst:1713: WARNING: py:class reference target not found: ClientRequest
/home/alexe/aiohttp/docs/client_reference.rst:1747: WARNING: py:meth reference target not found: ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:1920: WARNING: py:class reference target not found: Payload
/home/alexe/aiohttp/docs/client_reference.rst:2105: WARNING: py:meth reference target not found: aiohttp.ClientSession.request
/home/alexe/aiohttp/docs/client_reference.rst:2166: WARNING: py:exc reference target not found: aiohttp.ServerDisconnectionError
/home/alexe/aiohttp/docs/client_reference.rst:2195: WARNING: py:exc reference target not found: ClientHttpProxyError

@webknjaz
Copy link
Member

PR shows my progress

I'm marking this as a draft then.

@webknjaz webknjaz marked this pull request as draft April 15, 2021 22:49
@codecov

This comment has been minimized.

@l1storez
Copy link
Contributor Author

have troubles with callable and abc.Mapping they are not in the designated place


:param aiohttp.BasicAuth auth: an object that represents HTTP Basic
Authorization (optional)

:param version: supported HTTP version, ``HTTP 1.1`` by default.

:param cookie_jar: Cookie Jar, :class:`AbstractCookieJar` instance.
:param cookie_jar: Cookie Jar, :class:`aiohttp.abc.aiohttp.abc.AbstractCookieJar` instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prefix is wrong as discussed in another PR.

Copy link
Contributor Author

@l1storez l1storez Apr 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have warning with aiohttp.abc.AbstractCookieJar and AbstractCookieJar. with a double prefix I don't have a warning. If you insist, I'll leave it as you want

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to fix this warning by removing the prefix from the respective .. class:: definition. It's only duplicated because it's both in the class definition and .. currentmodule:: at the top of the document — they are merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try it later

@webknjaz
Copy link
Member

have troubles with callable and abc.Mapping they are not in the designated place

What do you mean?

@l1storez
Copy link
Contributor Author

I did not find callable in 779, 1441, 1580, 1641. mapping has no string binding

@webknjaz
Copy link
Member

@l1storez
Copy link
Contributor Author

l1storez commented Apr 16, 2021

you don't understand, I did not find it in client_reference.rst Like here

https://github.com/aio-libs/aiohttp/blame/576862b1f2cb919c347851f40807caf7a9b80807/docs/client_reference.rst#L1431

@webknjaz
Copy link
Member

webknjaz commented Apr 16, 2021

By the way, this reference is wrong

      :param callable loads: :func:`callable` used for loading *JSON*
  • it should point to the term instead.

I don't see other places you're talking about. Maybe you forgot to update the list of warnings...

@l1storez
Copy link
Contributor Author

#5620 (comment) actual version of warnings. Other places have the same situation

@webknjaz
Copy link
Member

Just fix the others then.

@l1storez
Copy link
Contributor Author

good

@l1storez
Copy link
Contributor Author

fix aiohttp.abc prefix in accordance with #5610


:param aiohttp.BasicAuth auth: an object that represents HTTP Basic
Authorization (optional)

:param version: supported HTTP version, ``HTTP 1.1`` by default.

:param cookie_jar: Cookie Jar, :class:`AbstractCookieJar` instance.
:param cookie_jar: Cookie Jar, :class:`aiohttp.abc.AbstractCookieJar` instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe prefix this with a tilde?

Suggested change
:param cookie_jar: Cookie Jar, :class:`aiohttp.abc.AbstractCookieJar` instance.
:param cookie_jar: Cookie Jar, :class:`~aiohttp.abc.AbstractCookieJar` instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, original without tilde

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original was rendered as a class name w/o a prefix

@@ -2163,7 +2163,7 @@ Connection errors

Server disconnected.

Derived from :exc:`ServerDisconnectionError`
Derived from :exc:`aiohttp.ServerDisconnectionError`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Derived from :exc:`aiohttp.ServerDisconnectionError`
Derived from :exc:`~aiohttp.ServerDisconnectionError`

@l1storez l1storez force-pushed the 5518-fix-client-reference branch 2 times, most recently from 5b7f7e7 to 5cf3b9d Compare May 17, 2021 21:32
@l1storez
Copy link
Contributor Author

Remaining warnings:

/docs/client_reference.rst:779: WARNING: py:class reference target not found: callable
/docs/client_reference.rst:1137: WARNING: py:class reference target not found: aiohttp.abc.AbstractResolver
/docs/client_reference.rst:1467: WARNING: py:func reference target not found: aiohttp.ws_connect
/docs/client_reference.rst:1483: WARNING: py:meth reference target not found: start
/docs/client_reference.rst:2166: WARNING: py:exc reference target not found: aiohttp.ServerDisconnectionError
/docs/client_reference.rst:2195: WARNING: py:exc reference target not found: ClientHttpProxyError

@l1storez
Copy link
Contributor Author

I think the remaining warnings go to ignore. (callable L779 not found)

@webknjaz
Copy link
Member

I think the remaining warnings go to ignore. (callable L779 not found)

I think it's on line 111

@l1storez
Copy link
Contributor Author

Okay, I try to fix it in l111, another warnings add to ignore list and make the PR ready

@l1storez
Copy link
Contributor Author

Ready for review

@webknjaz
Copy link
Member

There's a button for that

@@ -1213,7 +1213,7 @@ Response object

.. class:: ClientResponse

Client response returned by :meth:`ClientSession.request` and family.
Client response returned by :meth:`~aiohttp.ClientSession.request` and family.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's preserve the original rendering

Suggested change
Client response returned by :meth:`~aiohttp.ClientSession.request` and family.
Client response returned by :meth:`ClientSession.request() <aiohttp.ClientSession.request>` and family.

@@ -1229,7 +1229,7 @@ Response object

.. attribute:: version

Response's version, :class:`HttpVersion` instance.
Response's version, :class:`aiohttp.protocol.HttpVersion` instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Response's version, :class:`aiohttp.protocol.HttpVersion` instance.
Response's version, :class:`~aiohttp.protocol.HttpVersion` instance.

@l1storez
Copy link
Contributor Author

It's just a comment

@webknjaz
Copy link
Member

So it's not really ready for review because it's a draft, right?

@l1storez l1storez marked this pull request as ready for review May 19, 2021 20:57
@webknjaz webknjaz added the documentation Improvements or additions to documentation label May 19, 2021
@l1storez
Copy link
Contributor Author

I forgot to push the button:)

docs/conf.py Outdated
("py:meth", "aiohttp.ClientSession.request"), # undocumented
("py:class", "aiohttp.protocol.HttpVersion"), # undocumented
("py:class", "aiohttp.ClientRequest"), # undocumented
("py:class", "Payload"), # undocumented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a full importable string, not just a class name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean full string "payload"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package_name.module_name.ClassName, just like others.

Copy link
Member

@webknjaz webknjaz May 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:

Suggested change
("py:class", "Payload"), # undocumented
("py:class", "aiohttp.payload.Payload"), # undocumented

(

class Payload(ABC):
)

("py:class", "Payload"), # undocumented
("py:class", "aiohttp.abc.AbstractResolver"), # undocumented
("py:func", "aiohttp.ws_connect"), # undocumented
("py:meth", "start"), # undocumented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: it should have the full context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aiohttp.start.start?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the thing this refers to should actually exist in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, It will be quite hard for me, but I try

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find what it refers to in the context where it's used and that should be it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opposite :meth:(close) refers to aiohttp.WSCloseCode.OK. Not enough context to define start for me

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I did some research and it is indeed unobvious what this refers to. So let's leave it be for now.

docs/conf.py Outdated
("py:func", "aiohttp.ws_connect"), # undocumented
("py:meth", "start"), # undocumented
("py:exc", "aiohttp.ServerDisconnectionError"), # undocumented
("py:exc", "ClientHttpProxyError"), # undocumented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same: it's not clear where it's defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aiohttp. ClientHttpProxyError?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, check via REPL

@l1storez
Copy link
Contributor Author

Can you show an example, please?

docs/client_reference.rst Outdated Show resolved Hide resolved
@webknjaz webknjaz added backport-3.8 bot:chronographer:skip This PR does not need to include a change note labels May 24, 2021
docs/client_reference.rst Outdated Show resolved Hide resolved
@webknjaz webknjaz enabled auto-merge (squash) May 24, 2021 23:04
@webknjaz webknjaz merged commit ff9c117 into aio-libs:master May 24, 2021
@patchback
Copy link
Contributor

patchback bot commented May 24, 2021

Backport to 3.8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.8/ff9c117083d3d82d257dfad6242d7a5ac821f241/pr-5620

Backported as #5734

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request May 24, 2021
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit ff9c117)
webknjaz pushed a commit that referenced this pull request May 25, 2021
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit ff9c117)

Co-authored-by: Olexiy Pohorely <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:skip This PR does not need to include a change note documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants