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

PYTHON-4504 Use a venv for mod_wsgi test #1687

Merged
merged 6 commits into from
Jun 14, 2024

Conversation

blink1073
Copy link
Member

No description provided.

@@ -45,3 +47,5 @@ ${PYTHON_BINARY} ${PROJECT_DIRECTORY}/test/mod_wsgi_test/test_client.py -n 25000
${PYTHON_BINARY} ${PROJECT_DIRECTORY}/test/mod_wsgi_test/test_client.py -n 25000 serial \
Copy link
Member

Choose a reason for hiding this comment

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

Replace these PYTHON_BINARY usages with "python".

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

${PYTHON_BINARY} -m pip install -e .
${PYTHON_BINARY} -m venv .venv
source .venv/bin/activate
python -m pip install -e .
Copy link
Member

@ShaneHarvey ShaneHarvey Jun 14, 2024

Choose a reason for hiding this comment

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

I suspect we need to create the venv with --system-site-packages so that the toolchain installed version of mod_wsgi can be used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@ShaneHarvey
Copy link
Member

Python 3.8 is failing:

 [2024/06/14 13:42:33.753] + python -m pip install -e .
 [2024/06/14 13:42:38.601]     ERROR: Command errored out with exit status 1:
 [2024/06/14 13:42:38.601]      command: /data/mci/81cd2316d38fbbd146938bff32a636d1/src/.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"'; __file__='"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
 [2024/06/14 13:42:38.601]          cwd: /data/mci/81cd2316d38fbbd146938bff32a636d1/src/
 [2024/06/14 13:42:38.601]     Complete output (5 lines):
 [2024/06/14 13:42:38.601]     Traceback (most recent call last):
 [2024/06/14 13:42:38.601]       File "<string>", line 1, in <module>
 [2024/06/14 13:42:38.601]       File "/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py", line 5, in <module>
 [2024/06/14 13:42:38.601]         raise RuntimeError(msg)
 [2024/06/14 13:42:38.601]     RuntimeError: PyMongo>=4.8 no longer supports building via setup.py, use python -m pip install <path/to/pymongo> instead
 [2024/06/14 13:42:38.601]     ----------------------------------------
 [2024/06/14 13:42:38.601] ERROR: Command errored out with exit status 1: /data/mci/81cd2316d38fbbd146938bff32a636d1/src/.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"'; __file__='"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
 [2024/06/14 13:42:38.607] WARNING: You are using pip version 21.1.1; however, version 24.0 is available.

Does this mean we need to revert the hatch change and bring back setup.py?

@blink1073
Copy link
Member Author

Does this mean we need to revert the hatch change and bring back setup.py?

Trying with an updated pip, which I think is a fair requirement to build from source.

@ShaneHarvey
Copy link
Member

I opened https://jira.mongodb.org/browse/PYTHON-4507 to document the new pip requirements.

@ShaneHarvey
Copy link
Member

Do you know why the import time check is failing?

[2024/06/14 10:53:52.026] + python -X importtime -c 'import pymongo'
[2024/06/14 10:53:52.292] + git checkout 8b6bb832ac50ef50ed864e7b45223532fae88e36
[2024/06/14 10:53:52.292] error: Your local changes to the following files would be overwritten by checkout:
[2024/06/14 10:53:52.292] 	.evergreen/run-mod-wsgi-tests.sh
[2024/06/14 10:53:52.292] Please commit your changes or stash them before you switch branches.
[2024/06/14 10:53:52.292] Aborting

@blink1073
Copy link
Member Author

Do you know why the import time check is failing?

I'm not sure what changed, I thought I had accounted for git state originally.

@blink1073
Copy link
Member Author

Ready to merge, since we have PYTHON-4508, and it was pre-existing?

@ShaneHarvey
Copy link
Member

ShaneHarvey commented Jun 14, 2024

I thought you might want to fix it in this PR since the import check started failing in the first mod_wsgi change: #1684

Fewer backports that way.

@blink1073 blink1073 merged commit bba5f81 into mongodb:master Jun 14, 2024
32 of 34 checks passed
@blink1073 blink1073 deleted the PYTHON-4504-venv branch June 14, 2024 23:58
blink1073 added a commit to blink1073/mongo-python-driver that referenced this pull request Jun 14, 2024
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.

2 participants