GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(python): autogenerate docs/index.rst by parthea · Pull Request #1114 · googleapis/synthtool

Conversation

@parthea

@parthea parthea commented Jun 14, 2021

Copy link
Copy Markdown
Contributor

This PR is a first step towards auto generating docs/index.rst for most python repos.

The function detect_versions in synthtool/languages/python.py is identical to the one used by node here so alternatively, we could consider moving the existing function detect_versions outside of node.py.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@parthea
parthea requested review from SurferJeffAtGoogle, bcoe and chingor13 as code owners June 14, 2021 00:43
@parthea
parthea requested review from a team June 14, 2021 00:43
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 14, 2021
@parthea parthea mentioned this pull request Jun 14, 2021
chore: autogenerate docs/index.rst googleapis/python-memcache#68
Closed
@parthea
parthea requested a review from busunkim96 June 14, 2021 00:45
@parthea

parthea commented Jun 14, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

As an example, I ran the version of synthtool in this PR in the python-memcache repo and auto generated the docs/index.rst file. You can see the result here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parthea
chore(python): autogenerate docs/index.rst
c0af3ab
@parthea
parthea force-pushed the add-docs-index-rst-to-template branch from 70020e2 to c0af3ab Compare June 14, 2021 00:49
@parthea parthea assigned busunkim96 Jun 14, 2021
busunkim96
busunkim96 reviewed Jun 14, 2021
View reviewed changes
Comment thread synthtool/languages/python.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread synthtool/languages/python.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread synthtool/languages/python.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/test_python_library.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/test_python_library.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@busunkim96 busunkim96 assigned parthea Jul 12, 2021
@parthea parthea unassigned busunkim96 Jul 12, 2021
parthea added 4 commits September 29, 2021 15:53
@parthea
set default path to owl-bot-staging
bdee7a8
@parthea
Merge branch 'master' into add-docs-index-rst-to-template
4bc1061
@parthea
optimize code using glob
fb23307
@parthea
move the default_version to the front of the list
89e2bc4
@parthea parthea removed their assignment Sep 29, 2021
@parthea
parthea marked this pull request as draft September 29, 2021 16:45
parthea added 2 commits September 29, 2021 16:55
@parthea
Drop redundant default_version argument
9a6f82f
@parthea
remove unused imports
52541cc
This was referenced Sep 30, 2021
chore(python): add .github/CODEOWNERS as a templated file #1201
Merged
chore: add default_version and codeowner_team to .repo-metadata.json googleapis/google-auth-library-python-oauthlib#156
Merged
chore: add default_version and codeowner_team to .repo-metadata.json googleapis/google-resumable-media-python#276
Merged
chore: add default_version and codeowner_team to .repo-metadata.json googleapis/google-api-python-client#1547
Merged
chore: add default_version and codeowner_team to .repo-metadata.json googleapis/google-auth-library-python-httplib2#46
Merged
chore: add default_version and codeowner_team to .repo-metadata.json googleapis/python-access-approval#123
Merged
chore: add default_version and codeowner_team to .repo-metadata.json googleapis/python-access-context-manager#87
Merged
bcoe
bcoe approved these changes Oct 13, 2021
View reviewed changes

@bcoe bcoe left a comment

Copy link
Copy Markdown

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread synthtool/languages/python.py Outdated
return sample_metadata


def detect_versions(path: str = "./google/cloud") -> List[str]:

@bcoe bcoe Oct 13, 2021

Copy link
Copy Markdown

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

parthea reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@parthea parthea Oct 14, 2021

Copy link
Copy Markdown
Contributor Author

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bcoe reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 13, 2021
parthea added 5 commits October 13, 2021 23:59
@parthea
consolidate the duplicated detect_versions function
8af8e95
@parthea
remove unused import
d66ea79
@parthea
remove unused imports
b8c20e0
@parthea
Merge branch 'master' into add-docs-index-rst-to-template
4a9688f
@parthea
update comments
fc607c0
@parthea parthea removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 14, 2021
parthea added 2 commits October 14, 2021 00:16
@parthea
remove unused import
b992238
@parthea
run black
c79fc51
@parthea
parthea requested a review from bcoe October 14, 2021 00:35
@parthea parthea assigned bcoe and unassigned chingor13 and busunkim96 Oct 14, 2021
bcoe
bcoe approved these changes Oct 14, 2021
View reviewed changes

@bcoe bcoe left a comment

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

parthea reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@parthea
parthea merged commit c1e5e1c into master Oct 14, 2021
@parthea
parthea deleted the add-docs-index-rst-to-template branch October 14, 2021 16:06
This was referenced Oct 15, 2021
chore(python): include docs/UPGRADING.md in docs/index.rst if it exists #1245
Merged
chore(python): fix autogenerated docs/index.rst to support nested dir #1246
Merged
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
@parthea @abdelmegahedgoogle
chore: add default_version and codeowner_team to .repo-metadata.json (g…
383be7b
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Jun 4, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
b3381ba
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Jun 4, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
d5b0561
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Jun 4, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
22f0759
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Jun 4, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
c99960f
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Jun 4, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
2690d27
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Jun 4, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
de0fcb1
…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
vchudnov-g pushed a commit to googleapis/google-cloud-python that referenced this pull request Sep 20, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
4a4370e
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Sep 22, 2023
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
d5bcf22
…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
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Nov 24, 2025
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
e61d3cb
…345)

Set codeowner_team to @googleapis/api-bigquery as codeowner. This change is needed for the following synthtool PRs.

googleapis/synthtool#1201
googleapis/synthtool#1114
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Mar 6, 2026
@parthea
chore: add default_version and codeowner_team to .repo-metadata.json (#…
0d27883
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes
@dandhlee dandhlee dandhlee approved these changes
@chingor13 chingor13 Awaiting requested review from chingor13
@SurferJeffAtGoogle SurferJeffAtGoogle Awaiting requested review from SurferJeffAtGoogle
+2 more reviewers
@bcoe bcoe bcoe approved these changes
@busunkim96 busunkim96 busunkim96 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@bcoe bcoe

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@parthea @bcoe @tswast @busunkim96 @dandhlee @chingor13
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.