-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4976 Replace hatch with uv as our python environment and workfow tool #2068
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
Conversation
| test_encryption: "true" | ||
| test_encryption_pyopenssl: "true" | ||
| PYTHON_BINARY: /opt/python/3.12/bin/python3 | ||
| - name: encryption-rhel8-pypy3.9 |
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.
Should we keep this variant with PyPy3.10 instead?
| SSL: ssl | ||
| TOPOLOGY: server | ||
| VERSION: latest | ||
| PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 |
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.
Can we split the PyPy3.9 deprecation out into a separate PR? It would be cleaner to separate that from switching to uv.
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: #2070
| export LIBMONGOCRYPT_URL=https://s3.amazonaws.com/mciuploads/libmongocrypt/debian11/master/latest/libmongocrypt.tar.gz | ||
| SKIP_SERVERS=1 bash $HERE/setup-encryption.sh | ||
| tar czf /tmp/mongo-python-driver.tgz . | ||
| # Set up the remote files to test. |
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.
Are these changes related to the uv conversion?
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.
No, I created https://jira.mongodb.org/browse/PYTHON-5050
| SKIP_SERVERS=1 bash $HERE/setup-encryption.sh | ||
| tar czf /tmp/mongo-python-driver.tgz . | ||
| GCPKMS_SRC=/tmp/mongo-python-driver.tgz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh | ||
| # Set up the remote files to test. |
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.
Same here as above.
| set -eu | ||
| file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" | ||
| # Don't use ${file} syntax here because evergreen treats it as an empty expansion. | ||
| [ -f "$file" ] && bash "$file" || echo "$file not available, skipping" |
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.
Is this an intended change?
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.
Yes, to avoid masking an error if the script failed to run. It is known to exist.
| popd | ||
|
|
||
| # # Copy PyMongo's test certificates over driver-evergreen-tools' | ||
| # cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/ |
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.
Intended commenting?
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.
No, removing
| "mypy==1.14.1", | ||
| "pyright==1.1.391", | ||
| "typing_extensions" | ||
| ] |
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.
Do we need a test group here as well?
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.
It is already an extra. I'll remove the typing group since we already have the extra.
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.
Got it.
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.
Actually typing was not already an extra, not should we make it one. There isn't a way to have dependency groups depend on extras, so we're stuck with the weird incantation stored in the justfile.
|
Toggling CI |
| test *args: | ||
| {{hatch_bin}} run test:test {{args}} | ||
| test *args="-v --durations=5 --maxfail=10": | ||
| {{uv_run}} --extra test pytest {{args}} |
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.
If there isn't a test extra, is this --extra test option correct?
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.
There is a test extra already. Ideally we'd convert it to a group but that would be a breaking change.
Adopting
uvallows us to use dependency groups, a fantastic feature added by PEP-735.Full run: https://spruce.mongodb.com/version/6790291613c55d000759cb7d/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC