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

Attribute assignment with . operator only considers the attribute name #341

Closed
gurukamath opened this issue Jun 20, 2022 · 1 comment
Closed

Comments

@gurukamath
Copy link

While assigning a value to an attribute (in a global context), the generated node name consists only of the attribute name. The object/class name is omitted.

Consider the following example

from temp import A, B

A.y = 10

B.y = 5

The two data nodes generated have the same name y instead of A.y and B.y. Is this how it was intended to be.

If this is not how it was intended, I can raise a PR to fix this. I believe it is better to capture the class/object name in the data nodes name.

@AWhetter
Copy link
Collaborator

Really we shouldn't document these attributes at all. At least not at the module level.

github-actions bot added a commit to MaRDI4NFDI/open-interfaces that referenced this issue Jan 23, 2023
Bumps [sphinx-autoapi](https://github.com/readthedocs/sphinx-autoapi)
from 2.0.0 to 2.0.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/readthedocs/sphinx-autoapi/blob/master/CHANGELOG.rst">sphinx-autoapi's
changelog</a>.</em></p>
<blockquote>
<h2>v2.0.1 (2023-01-16)</h2>
<p>Features
^^^^^^^^</p>
<ul>
<li>Can turn off the addition of documented objects to the TOC
tree.</li>
<li>Added support for Python 3.11.</li>
</ul>
<p>Bug Fixes
^^^^^^^^^</p>
<ul>

<li><code>[#330](readthedocs/sphinx-autoapi#330)
&lt;https://github.com/readthedocs/sphinx-autoapi/issues/330&gt;</code>:
(Python)
Render tuple values as tuples, not lists.</li>

<li><code>[#341](readthedocs/sphinx-autoapi#341)
&lt;https://github.com/readthedocs/sphinx-autoapi/issues/341&gt;</code>:
(Python)
Fix module level assignments to class attributes being documented as
module level attributes.</li>
<li>(Python) Fix &quot;bysource&quot; sort order showing items in
alphabetical order.</li>
<li>(Python) Use the correct directives for a variable type and
value.</li>
</ul>
<p>Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Removed some autogenerated test data from the repository.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/2335e002f8ec2e2fce9ff0e61ba99093929f0764"><code>2335e00</code></a>
Version 2.0.1</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/03aefdf446e648bf98a7c1a4352db660f9402346"><code>03aefdf</code></a>
Fix more tests</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/384966090e78cf9d2dc0621a474f9333b37443be"><code>3849660</code></a>
Fix more tests</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/3f8730aadd2249a7a0c8619f865019c4781da4b9"><code>3f8730a</code></a>
Fix tests</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/94b255aecc96bce235ec5bec9a38b84cc8574fc0"><code>94b255a</code></a>
Added support for Python 3.11</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/1556b17ca8ae3de6a8f0d129774bb49edc76a737"><code>1556b17</code></a>
Use the correct directives for a variable type and value (<a
href="https://github-redirect.dependabot.com/readthedocs/sphinx-autoapi/issues/353">#353</a>)</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/d732b49fd5ae79d3c1e1e639e2c7b82773435163"><code>d732b49</code></a>
Don't force member sort order to alphabetic (<a
href="https://github-redirect.dependabot.com/readthedocs/sphinx-autoapi/issues/362">#362</a>)</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/94295a48cdcec75a057b50d1c3d2ced21f10f2a6"><code>94295a4</code></a>
Don't document module level class attribute assignments</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/0963c6d8a7d679e12b3c37544799e7fa16fa99b3"><code>0963c6d</code></a>
Added missing changelog entry</li>
<li><a
href="https://github.com/readthedocs/sphinx-autoapi/commit/377a38550f02ec3a3cfcbdb04bf3e8346e1b9f4f"><code>377a385</code></a>
Add option autoapi_add_objects_to_toctree (<a
href="https://github-redirect.dependabot.com/readthedocs/sphinx-autoapi/issues/284">#284</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/readthedocs/sphinx-autoapi/compare/v2.0.0...v2.0.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sphinx-autoapi&package-manager=pip&previous-version=2.0.0&new-version=2.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
netbsd-srcmastr referenced this issue in NetBSD/pkgsrc May 6, 2023
v2.1.0 (2023-03-28)
-------------------

Deprecations and Removals
^^^^^^^^^^^^^^^^^^^^^^^^^

- Support for documenting languages other than Python is deprecated. (#248)
- Removed the option to have autoapi generate toctree entries for domain objects.
  Domain objects are now added to the toctree by Sphinx.
  Dropped support for sphinx < 5.2.0. (#369)


Misc
^^^^

- Added basic type checking.
- Integrated towncrier into the release workflow.


v2.0.1 (2023-01-16)
-------------------

Features
^^^^^^^^
- Can turn off the addition of documented objects to the TOC tree.
- Added support for Python 3.11.

Bug Fixes
^^^^^^^^^
- `#330 <https://github.com/readthedocs/sphinx-autoapi/issues/330>`: (Python)
  Render tuple values as tuples, not lists.
- `#341 <https://github.com/readthedocs/sphinx-autoapi/issues/341>`: (Python)
  Fix module level assignments to class attributes being documented as
  module level attributes.
- (Python) Fix "bysource" sort order showing items in alphabetical order.
- (Python) Use the correct directives for a variable type and value.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
- Removed some autogenerated test data from the repository.


v2.0.0 (2022-09-27)
-------------------

Breaking Changes
^^^^^^^^^^^^^^^^

- Dropped support for Sphinx <4.
- `#352 <https://github.com/readthedocs/sphinx-autoapi/issues/352>`: (Python)
  Properties are rendered with the ``property`` directive,
  fixing support for Sphinx 5.2.
  A new ``PythonPythonMapper`` object (``PythonProperty``) has been created
  to support this change. This object can be passed to templates, filters,
  and hooks.
  A new ``property.rst`` template has also been created to support this change.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
- Use https links where possible in documentation.
- Pass correct argument types to ``status_iterator``.


V1.9.0 (2022-07-25)
-------------------

Breaking Changes
^^^^^^^^^^^^^^^^

- Dropped support for Python 3.6.

Features
^^^^^^^^

- Added support for Python 3.10.
- `#222 <https://github.com/readthedocs/sphinx-autoapi/issues/222>`:
  Marked extension as parallel read safe.

Bug Fixes
^^^^^^^^^
- `#324 <https://github.com/readthedocs/sphinx-autoapi/issues/324>`: (Python)
  Fail elegantly when no source files are found.
- (Python) Stop calling ``autodoc-process-docstring`` when docstring is empty.
  Works around sphinx-doc/sphinx#10701.
- `#318 <https://github.com/readthedocs/sphinx-autoapi/issues/318>`: (Python)
  Fixed misaligned argument types on methods/classmethods when using type comments.
- `#278 <https://github.com/readthedocs/sphinx-autoapi/issues/278>`: (Python)
  Limit signatures to 60 characters in summaries.
- Fix keyerror when using markdown sources.
- `#328 <https://github.com/readthedocs/sphinx-autoapi/issues/328>`: (Python)
  Fix kw-only marker getting ignored if first in the signature.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
- Fixed tests in Sphinx 5.
- Fixed many typos throughout the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants