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 docs warning about multiple OptimizeOptions targets #270

Conversation

michaeldiamant
Copy link
Contributor

Fixes make html warnings about OptimizationOptions shown below by fully qualifying the ambiguous reference.

~/dev/pyteal/docs master *3 ?3 ──────────────────────────────────────────────────────────────────────────────────────────  pyteal 03:14:55 PM
❯ make html
Running Sphinx v4.5.0
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] compiler_optimization
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
/Users/michael/dev/pyteal/docs/compiler_optimization.rst:15: WARNING: more than one target found for 'any' cross-reference 'OptimizeOptions': could be :py:class:`pyteal.OptimizeOptions` or :py:class:`pyteal.compiler.optimizer.optimizer.OptimizeOptions`
/Users/michael/dev/pyteal/docs/compiler_optimization.rst:15: WARNING: more than one target found for 'any' cross-reference 'OptimizeOptions': could be :py:class:`pyteal.OptimizeOptions` or :py:class:`pyteal.compiler.optimizer.optimizer.OptimizeOptions`
/Users/michael/dev/pyteal/docs/compiler_optimization.rst:15: WARNING: more than one target found for 'any' cross-reference 'OptimizeOptions': could be :py:class:`pyteal.OptimizeOptions` or :py:class:`pyteal.compiler.optimizer.optimizer.OptimizeOptions`
generating indices... genindex py-modindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 3 warnings.

The HTML pages are in _build/html.

@michaeldiamant
Copy link
Contributor Author

Request for reviewers - If there's a different way to export OptimizationOptions that avoids the ambiguity, let me know. I don't know enough about Python's module system to (easily) suggest a different solution.

@jasonpaulos
Copy link
Contributor

I think an alternative solution would be to add OptimizeOptions.__module__ = "pyteal" to pyteal/compiler/optimizer/optimizer.py. And if that works, I'd prefer that solution

@michaeldiamant
Copy link
Contributor Author

@jasonpaulos Thanks for the suggestion - it works. Closing the PR and providing a new one with the fix: #271.

@michaeldiamant michaeldiamant deleted the optimization_rst_warnings branch April 12, 2022 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants