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

[ml] Enable strict sphinx check #34688

Merged
merged 13 commits into from
Mar 12, 2024
Merged

Conversation

diondrapeck
Copy link
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@diondrapeck diondrapeck linked an issue Mar 7, 2024 that may be closed by this pull request
@diondrapeck
Copy link
Member Author

@kristapratico The only remaining issues we're seeing for azure-ai-ml strict_sphinx compliance is a "duplicate object description" warning. It seems the root of this is having an object exported in multiple module namespaces (i.e. __init__.py files); however, removing an object from an __init__.py file would be a breaking change.

image

The error messages suggest using :no_index: in the docstring, but I haven't found a way to make that work and I don't see any examples in the azure-sdk-for-python repository of other packages using it. What's your recommendation for dealing with this error?

@kristapratico
Copy link
Member

@kristapratico The only remaining issues we're seeing for azure-ai-ml strict_sphinx compliance is a "duplicate object description" warning. It seems the root of this is having an object exported in multiple module namespaces (i.e. __init__.py files); however, removing an object from an __init__.py file would be a breaking change.

image

The error messages suggest using :no_index: in the docstring, but I haven't found a way to make that work and I don't see any examples in the azure-sdk-for-python repository of other packages using it. What's your recommendation for dealing with this error?

@diondrapeck we should not have the same object exported in multiple module namespaces. We need to figure out for each type whether it should be imported at the parent or child namespace, and then we can use some init-level getattr magic to remove the type from dunder all (see here for an example) and include a deprecation warning to say that the specific type being imported will eventually be removed.

cc @annatisch

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-ai-ml

@diondrapeck
Copy link
Member Author

diondrapeck commented Mar 8, 2024

@kristapratico The only remaining issues we're seeing for azure-ai-ml strict_sphinx compliance is a "duplicate object description" warning. It seems the root of this is having an object exported in multiple module namespaces (i.e. __init__.py files); however, removing an object from an __init__.py file would be a breaking change.
image
The error messages suggest using :no_index: in the docstring, but I haven't found a way to make that work and I don't see any examples in the azure-sdk-for-python repository of other packages using it. What's your recommendation for dealing with this error?

@diondrapeck we should not have the same object exported in multiple module namespaces. We need to figure out for each type whether it should be imported at the parent or child namespace, and then we can use some init-level getattr magic to remove the type from dunder all (see here for an example) and include a deprecation warning to say that the specific type being imported will eventually be removed.

cc @annatisch

Done! Thank you.

image

@luigiw luigiw merged commit dc7fc74 into Azure:main Mar 12, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure-ai-ml needs docstring updates for sphinx
6 participants