-
Notifications
You must be signed in to change notification settings - Fork 84
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
chore(python): autogenerate docs/index.rst #1114
Conversation
As an example, I ran the version of synthtool in this PR in the |
70020e2
to
c0af3ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like from Sphinx side not much has changed, I'll take that as a good thing. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker for me on landing this, but ideally we'd DRY up the detect version logic.
If you don't opt to do so in this PR, mind creating a tracking issue to do so?
synthtool/languages/python.py
Outdated
@@ -93,6 +94,50 @@ def _get_sample_readme_metadata(sample_dir: Path) -> dict: | |||
return sample_metadata | |||
|
|||
|
|||
def detect_versions(path: str = "./google/cloud") -> List[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be for us to pull this into a common file, if the logic is identical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please could you take another look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for cleaning this up @parthea 👏 , reading through the current owlbot
logic, I saw that versions is actually loaded in a separate code path:
# Collect the subdirectories of the src directory.
src = Path("src")
versions = [v.name for v in src.iterdir() if v.is_dir()]
# Reorder the versions so the default version always comes last.
versions = [v for v in versions if v != default_version] + [default_version]
logger.info(f"Collected versions ${versions} from ${src}")
So I think you've gotten rid of some code that would have otherwise have hung around indefinitely.
…oogleapis#1001) Set codeowner_team to googleapis/api-bigquery as codeowner. Set default_version to v2. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…33) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…29) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…47) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…116) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…92) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…118) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…411) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
…267) By default the code owner will be googleapis/yoshi-python. This change is needed for the following synthtool PRs. googleapis/synthtool#1201 googleapis/synthtool#1114
This PR is a first step towards auto generating
docs/index.rst
for most python repos.The function
detect_versions
insynthtool/languages/python.py
is identical to the one used bynode
here so alternatively, we could consider moving the existing functiondetect_versions
outside ofnode.py
.