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

Update to Python 3.12.x (#5736) #5951

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

dsotirho-ucsc
Copy link
Contributor

@dsotirho-ucsc dsotirho-ucsc commented Feb 10, 2024

Connected issues: #5736

Checklist

Author

  • PR is a draft
  • Target branch is develop
  • Name of PR branch matches issues/<GitHub handle of author>/<issue#>-<slug>
  • On ZenHub, PR is connected to all issues it (partially) resolves
  • PR description links to connected issues
  • PR title matches1 that of a connected issue or comment in PR explains why they're different
  • PR title references all connected issues
  • For each connected issue, there is at least one commit whose title references that issue

Author (partiality)

  • Added p tag to titles of partial commits
  • Added partial label to PR or this PR completely resolves all connected issues
  • All connected issues are resolved partially or this PR does not have the partial label

1 when the issue title describes a problem, the corresponding PR
title is Fix: followed by the issue title

Author (reindex, API changes)

  • Added r tag to commit title or this PR does not require reindexing
  • Added reindex label to PR or this PR does not require reindexing
  • PR and connected issue are labeled API or this PR does not modify a REST API
  • Added a (A) tag to commit title for backwards (in)compatible changes or this PR does not modify a REST API
  • Updated REST API version number in app.py or this PR does not modify a REST API

Author (chains)

  • This PR is blocked by previous PR in the chain or this PR is not chained to another PR
  • Added base label to the blocking PR or this PR is not chained to another PR
  • Added chained label to this PR or this PR is not chained to another PR

Author (upgrading deployments)

  • Documented upgrading of deployments in UPGRADING.rst or this PR does not require upgrading deployments
  • Added u tag to commit title or this PR does not require upgrading deployments
  • Added upgrade label to PR or this PR does not require upgrading deployments

Author (operator tasks)

  • Added checklist items for additional operator tasks or this PR does not require additional tasks

Author (hotfixes)

  • Added F tag to main commit title or this PR does not include permanent fix for a temporary hotfix
  • Reverted the temporary hotfixes for any connected issues or the prod branch has no temporary hotfixes for any connected issues

Author (before every review)

  • Rebased PR branch on develop, squashed old fixups
  • Ran make requirements_update or this PR does not touch requirements*.txt, common.mk, Makefile and Dockerfile
  • Added R tag to commit title or this PR does not touch requirements*.txt
  • Added reqs label to PR or this PR does not touch requirements*.txt
  • make integration_test passes in personal deployment or this PR does not touch functionality that could break the IT

Peer reviewer (after requesting changes)

Uncheck the Author (before every review) checklists.

Peer reviewer (after approval)

  • PR is not a draft
  • Ticket is in Review requested column
  • Requested review from system administrator
  • PR is assigned to system administrator

System administrator (after requesting changes)

Uncheck the before every review checklists. Update the N reviews label.

System administrator (after approval)

  • Actually approved the PR
  • Labeled connected issues as demo or no demo
  • Commented on connected issues about demo expectations or all connected issues are labeled no demo
  • Decided if PR can be labeled no sandbox
  • PR title is appropriate as title of merge commit
  • N reviews label is accurate
  • Moved ticket to Approved column
  • PR is assigned to current operator

Operator (before pushing merge the commit)

  • Checked reindex label and r commit title tag
  • Checked that demo expectations are clear or all connected issues are labeled no demo
  • PR has checklist items for upgrading instructions or PR is not labeled upgrade
  • Squashed PR branch and rebased onto develop
  • Sanity-checked history
  • Pushed PR branch to GitHub
  • Selected dev.shared and ran CI_COMMIT_REF_NAME=develop make -C terraform/shared apply_keep_unused
  • Selected anvildev.shared and ran CI_COMMIT_REF_NAME=develop make -C terraform/shared apply_keep_unused
  • Selected anvilprod.shared and ran CI_COMMIT_REF_NAME=develop make -C terraform/shared apply_keep_unused
  • Added sandbox label or PR is labeled no sandbox
  • Pushed PR branch to GitLab dev or PR is labeled no sandbox
  • Pushed PR branch to GitLab anvildev or PR is labeled no sandbox
  • Pushed PR branch to GitLab anvilprod or PR is labeled no sandbox
  • Build passes in sandbox deployment or PR is labeled no sandbox
  • Build passes in anvilbox deployment or PR is labeled no sandbox
  • Build passes in hammerbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in sandbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in anvilbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in hammerbox deployment or PR is labeled no sandbox
  • Deleted unreferenced indices in sandbox or this PR does not remove catalogs or otherwise causes unreferenced indices in dev
  • Deleted unreferenced indices in anvilbox or this PR does not remove catalogs or otherwise causes unreferenced indices in anvildev
  • Deleted unreferenced indices in hammerbox or this PR does not remove catalogs or otherwise causes unreferenced indices in anvilprod
  • Started reindex in sandbox or this PR does not require reindexing dev
  • Started reindex in anvilbox or this PR does not require reindexing anvildev
  • Started reindex in hammerbox or this PR does not require reindexing anvilprod
  • Checked for failures in sandbox or this PR does not require reindexing dev
  • Checked for failures in anvilbox or this PR does not require reindexing anvildev
  • Checked for failures in hammerbox or this PR does not require reindexing anvilprod
  • Title of merge commit starts with title from this PR
  • Added PR reference to merge commit title
  • Collected commit title tags in merge commit title but only include p if the PR is labeled partial
  • Moved connected issues to Merged lower column in ZenHub
  • Moved blocked issues to Triage or no issues are blocked on the connected issues
  • Pushed merge commit to GitHub

Operator (chain shortening)

  • Changed the target branch of the blocked PR to develop or this PR is not labeled base
  • Removed the chained label from the blocked PR or this PR is not labeled base
  • Removed the blocking relationship from the blocked PR or this PR is not labeled base
  • Removed the base label from this PR or this PR is not labeled base

Operator (after pushing the merge commit)

  • Pushed merge commit to GitLab dev or PR is labeled no sandbox
  • Pushed merge commit to GitLab anvildev or PR is labeled no sandbox
  • Pushed merge commit to GitLab anvilprod or PR is labeled no sandbox
  • Build passes on GitLab dev1
  • Reviewed build logs for anomalies on GitLab dev1
  • Build passes on GitLab anvildev1
  • Reviewed build logs for anomalies on GitLab anvildev1
  • Build passes on GitLab anvilprod1
  • Reviewed build logs for anomalies on GitLab anvilprod1
  • Selected dev.shared and ran make -C terraform/shared apply
  • Selected anvildev.shared and ran make -C terraform/shared apply
  • Selected anvilprod.shared and ran make -C terraform/shared apply
  • Deleted PR branch from GitHub
  • Deleted PR branch from GitLab dev
  • Deleted PR branch from GitLab anvildev
  • Deleted PR branch from GitLab anvilprod

1 When pushing the merge commit is skipped due to the PR being
labelled no sandbox, the next build triggered by a PR whose merge commit is
pushed determines this checklist item.

Operator (reindex)

  • Deleted unreferenced indices in dev or this PR does not remove catalogs or otherwise causes unreferenced indices in dev
  • Deleted unreferenced indices in anvildev or this PR does not remove catalogs or otherwise causes unreferenced indices in anvildev
  • Deleted unreferenced indices in anvilprod or this PR does not remove catalogs or otherwise causes unreferenced indices in anvilprod
  • Considered deindexing individual sources in dev or this PR does not merely remove sources from existing catalogs in dev
  • Considered deindexing individual sources in anvildev or this PR does not merely remove sources from existing catalogs in anvildev
  • Considered deindexing individual sources in anvilprod or this PR does not merely remove sources from existing catalogs in anvilprod
  • Considered indexing individual sources in dev or this PR does not merely add sources to existing catalogs in dev
  • Considered indexing individual sources in anvildev or this PR does not merely add sources to existing catalogs in anvildev
  • Considered indexing individual sources in anvilprod or this PR does not merely add sources to existing catalogs in anvilprod
  • Started reindex in dev or this PR does not require reindexing dev
  • Started reindex in anvildev or this PR does not require reindexing anvildev
  • Started reindex in anvilprod or this PR does not require reindexing anvilprod
  • Checked for and triaged indexing failures in dev or this PR does not require reindexing dev
  • Checked for and triaged indexing failures in anvildev or this PR does not require reindexing anvildev
  • Checked for and triaged indexing failures in anvilprod or this PR does not require reindexing anvilprod
  • Emptied fail queues in dev deployment or this PR does not require reindexing dev
  • Emptied fail queues in anvildev deployment or this PR does not require reindexing anvildev
  • Emptied fail queues in anvilprod deployment or this PR does not require reindexing anvilprod

Operator

  • Added CL item to prod promotion PR:
  • Deployed prod.shared
  • PR is assigned to no one

Shorthand for review comments

  • L line is too long
  • W line wrapping is wrong
  • Q bad quotes
  • F other formatting problem

@github-actions github-actions bot added the orange [process] Done by the Azul team label Feb 10, 2024
@dsotirho-ucsc dsotirho-ucsc added reqs [process] PR includes commit requiring ``make requirements`` upgrade [process] PR includes commit requiring manual upgrade labels Feb 10, 2024
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch 4 times, most recently from b810ca2 to c09e7d4 Compare February 13, 2024 17:17
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 85.37%. Comparing base (319995f) to head (92489a0).

Files with missing lines Patch % Lines
...llatlas/data/metadata/helpers/schema_validation.py 85.71% 2 Missing ⚠️
test/integration_test.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5951      +/-   ##
===========================================
- Coverage    85.38%   85.37%   -0.01%     
===========================================
  Files          155      155              
  Lines        20754    20764      +10     
===========================================
+ Hits         17720    17728       +8     
- Misses        3034     3036       +2     
Flag Coverage Δ
85.37% <82.35%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

coveralls commented Feb 13, 2024

Coverage Status

coverage: 85.395% (-0.003%) from 85.398%
when pulling 92489a0 on issues/dsotirho-ucsc/5736-update-python-to-3-12
into 319995f on develop.

@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch from c09e7d4 to e4c1675 Compare February 14, 2024 22:45
@hannes-ucsc hannes-ucsc force-pushed the develop branch 3 times, most recently from 0762297 to 3f7f6ce Compare May 28, 2024 06:58
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch from e4c1675 to 3ab9f81 Compare August 8, 2024 17:40
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch from 3ab9f81 to ca1c534 Compare August 19, 2024 17:03
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch 2 times, most recently from c6c31f6 to 9dd4804 Compare August 27, 2024 18:25
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch 11 times, most recently from af1fdf3 to b2bb083 Compare September 20, 2024 19:59
"docker.io/library/python:3.11.10-slim-bullseye": {
"digest": "sha256:21e2cc29feabc9fa1335feb5efd98ebaf323a5963b8670a2212289b1db74cf73",
"mirror_digest": "sha256:ccb0c6383303002a6d15d2f52a24eb240f46a16f38984b04012a46c6a3b81560",
"docker.io/library/python:3.12.6-slim-bullseye": {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you forgot to address #5736 (comment) which is a pretty significant unforced error, since I specifically remember triaging that comment with you to make sure you're aware of it.

@hannes-ucsc hannes-ucsc added the 1 review [process] Lead requested changes once label Sep 25, 2024
@hannes-ucsc hannes-ucsc removed their assignment Sep 25, 2024
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch from d0aeae3 to 4e3b463 Compare September 25, 2024 21:03
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch 3 times, most recently from 1d3ad1a to 5fe3df4 Compare September 26, 2024 00:32
@dsotirho-ucsc
Copy link
Contributor Author

5951_IT_2024-09-25.txt

@@ -2319,10 +2319,10 @@ If you add a dependency on a package with native code, you need to build the
wheel manually:
```
(.venv) ~/workspace/hca/azul$ docker run -it -v ${project_root}/:/root/azul python:3.11.6-bullseye bash
(.venv) ~/workspace/hca/azul$ docker run -it -v ${project_root}/:/root/azul python:3.12.6-slim-bullseye bash
Copy link
Member

Choose a reason for hiding this comment

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

Fulfills transitive requirement of distutils, which Python 3.12 removed from the standard library
For Python 3.12 support
Resolves error during `make requirements`:

  × Building wheel for jq (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [1390 lines of output]
      running bdist_wheel
      running build
      running build_ext
...
      jq.c:12124:55: error: no member named 'ob_digit' in 'struct _longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      jq.c:13608:47: error: no member named 'ob_digit' in 'struct _longobject'
          const digit* digits = ((PyLongObject*)b)->ob_digit;
                                ~~~~~~~~~~~~~~~~~~  ^
      41 warnings and 7 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for jq
Resolves errors originating from flake8 failing to parse f-strings:

E122 continuation line missing indentation or outdented
E131 continuation line unaligned for hanging indent
E202 whitespace before ')'
E202 whitespace before ']'
E202 whitespace before '}'
E203 whitespace before ':'
E221 multiple spaces before operator
E222 multiple spaces after operator
E225 missing whitespace around operator
E231 missing whitespace after ','
E231 missing whitespace after ':'
E231 missing whitespace after ';'
E271 multiple spaces after keyword
E272 multiple spaces before keyword
E702 multiple statements on one line (semicolon)
E713 test for membership should be 'not in'
W604 backticks are deprecated, use 'repr()'
Resolves error during `make requirements_update`:

19.11 Building wheels for collected packages: fastavro
19.11   Building wheel for fastavro (pyproject.toml): started
36.96   Building wheel for fastavro (pyproject.toml): finished with status 'error'
36.97   error: subprocess-exited-with-error
36.97
36.97   × Building wheel for fastavro (pyproject.toml) did not run successfully.
36.97   │ exit code: 1
36.97   ╰─> [73 lines of output]
36.97       <string>:31: SyntaxWarning: invalid escape sequence '\('
36.97       running bdist_wheel
36.97       running build
…
36.97       gcc: internal compiler error: Illegal instruction signal terminated program as
36.97       Please submit a full bug report,
36.97       with preprocessed source if appropriate.
36.97       See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
36.97       error: command '/usr/bin/gcc' failed with exit code 4
36.97       [end of output]
Resolves error during test:

ERROR: test_openapi (integration_test.OpenAPIIntegrationTest.test_openapi) (component='service')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/daniel/repo/azul1/test/integration_test.py", line 1856, in test_openapi
    validate_spec(spec)
  File "/Users/daniel/repo/azul1/.venv/lib/python3.12/site-packages/openapi_spec_validator/shortcuts.py", line 17, in validate_spec
    return validator.validate(spec, spec_url=spec_url)
...
AttributeError: '_io.BufferedReader' object has no attribute 'decode'
Resolves DeprecationWarning during schema validation:

Traceback (most recent call last):
  File "/Users/daniel/.pyenv/versions/3.12.6/lib/python3.12/unittest/suite.py", line 306, in _tearDownPreviousClass
    tearDownClass()
AssertionError: ["{message : DeprecationWarning('Automatically retrieving remote references can be a security vulnerability and is discouraged by the JSON Schema specifications. Relying on this behavior is deprecated and will shortly become an error. If you are sure you want to remotely retrieve your reference and that it is safe to do so, you can find instructions for doing so via referencing.Registry in the referencing documentation (https://referencing.readthedocs.org).'), category : 'DeprecationWarning', filename : '/Users/daniel/repo/azul1/.venv/lib/python3.12/site-packages/jsonschema/exceptions.py', lineno : 475, line : None}", ...]
Resolves finding during `make pep8`:

F842 local variable 'cs' is annotated but never used
Silences finding during `make pep8`:

E122 continuation line missing indentation or outdented
Resolves error during test:

AttributeError: 'not_called' is not a valid assertion. Use a spec for the mock if 'not_called' is meant to be an attribute.
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/dsotirho-ucsc/5736-update-python-to-3-12 branch from 5fe3df4 to 92489a0 Compare September 28, 2024 01:45
@dsotirho-ucsc
Copy link
Contributor Author

5951_IT_2024-09-27.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 review [process] Lead requested changes once orange [process] Done by the Azul team reqs [process] PR includes commit requiring ``make requirements`` upgrade [process] PR includes commit requiring manual upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants