Skip to content

chore: update docfx minimum Python version#1891

Merged
dandhlee merged 5 commits intomasterfrom
update_docfx_minimum_version
Nov 3, 2023
Merged

chore: update docfx minimum Python version#1891
dandhlee merged 5 commits intomasterfrom
update_docfx_minimum_version

Conversation

@dandhlee
Copy link
Copy Markdown
Contributor

@dandhlee dandhlee commented Nov 2, 2023

Sphinx plugin now requires Python3.10 as the minimum version, which is run in docfx sessions. This change is required to accommodate for the breaking change for upgrade in the version. See googleapis/sphinx-docfx-yaml#335.

For split repos, only the docfx session is updated to run in 3.10, and will respect what the split repo maintainer chooses to use as the default version.

For the monorepo, 3.10 will be used as the default version in general. Both split and monorepo uses Ubuntu22.04, which has Python3.10 as the built in Python version.

Unblocks major release for googleapis/sphinx-docfx-yaml#335.

@dandhlee dandhlee requested a review from parthea November 2, 2023 22:59
@dandhlee dandhlee marked this pull request as ready for review November 2, 2023 23:14
@dandhlee dandhlee requested a review from a team November 2, 2023 23:14
@dandhlee dandhlee requested a review from a team November 2, 2023 23:14
@parthea
Copy link
Copy Markdown
Contributor

parthea commented Nov 2, 2023

@dandhlee I tried creating a similar PR in google-cloud-python but ran into errors. Please could you check the changes made in PR googleapis/google-cloud-python#11978?

Could not import extension docfx_yaml.extension (exception: cannot import name 'Callable' from 'collections' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/collections/__init__.py))
ImportError: cannot import name 'Union' from 'types' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/types.py)

@parthea
Copy link
Copy Markdown
Contributor

parthea commented Nov 3, 2023

Updating sphinx to 4.5.0 fixes the error ImportError: cannot import name 'Union' from 'types'

@parthea
Copy link
Copy Markdown
Contributor

parthea commented Nov 3, 2023

Could not import extension docfx_yaml.extension (exception: cannot import name 'Callable' from 'collections' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/collections/__init__.py)) will be resolved once googleapis/sphinx-docfx-yaml#335 is merged.

@parthea parthea assigned dandhlee and unassigned chingor13 Nov 3, 2023
Copy link
Copy Markdown
Contributor

@parthea parthea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only one observation that the minimum version of sphinx should be updated in the docs build from 4.0.1 to 4.5.0

@dandhlee
Copy link
Copy Markdown
Contributor Author

dandhlee commented Nov 3, 2023

Done! Bumped monorepo to 4.5 - I suppose this is because the default is now Python3.10 for both docs and docfx sessions. I'll leave it for split repos because it has caused issues for some libraries before and docs will still work with Python3.9. Please take a look again.

@dandhlee dandhlee requested a review from parthea November 3, 2023 00:46
@parthea parthea enabled auto-merge (squash) November 3, 2023 00:47
@dandhlee dandhlee disabled auto-merge November 3, 2023 00:49
@dandhlee dandhlee enabled auto-merge (squash) November 3, 2023 00:49
@dandhlee dandhlee merged commit bc07fd4 into master Nov 3, 2023
@dandhlee dandhlee deleted the update_docfx_minimum_version branch November 3, 2023 00:52
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Nov 3, 2023
This PR updates the post processor image to the latest one which is
`gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo@sha256:2425930c45520a5acb255bd2876c078681f90e6e259dee2739e86d60a94a2a10`.

The latest image includes the following fix to update the default python
version to 3.10 in `noxfile.py`:
googleapis/synthtool#1891

Run the following commands to obtain the latest sha256
```
docker pull gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
```

```
partheniou@partheniou-vm-3:~/git/google-cloud-python$ docker inspect --format='{{.RepoDigests}}' gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
[gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo@sha256:2425930c45520a5acb255bd2876c078681f90e6e259dee2739e86d60a94a2a10]
```
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.

3 participants