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
Add support for python 3.10 #5379
Conversation
There are two entry points in our build that depend on the generated help files from the The first entrypoint occurs when running The second entrypoint occurs when running the The logic to resolve the parsing is straightforward, and could either be the current implementation which is to grab the correct syntax based on the python version, or just use a regex pattern to match against that contains both strings (leaning towards changing to this). I think the more important factor is how to handle the git diff that results from generating these files on an env with 3.10. The change to the ansible.txt and ansible-playbook.txt files on 3.10 are flagged by the
|
Could we do something to eliminate the diffs in those files? Like post-process the ansible help output to standardize lines with expected diffs before saving it in the "cache" file? |
- use sed to convert 'options:' to 'optional arguments:'
@@ -20,7 +20,7 @@ def _get_help_text(command): | |||
with open(_AVAILABLE_HELP_CACHES[command], 'r', encoding='utf-8') as f: | |||
return f.read() | |||
else: | |||
return subprocess.check_output(command, shell=True) | |||
return subprocess.check_output(command, shell=True).decode('utf-8') |
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.
I added this when playing around with removing the cache entirely as I noticed this returned a byte string previously. At the moment it looks like we never actually invoke this code since only the two ansible commands use this method, and definitely hit the cache. I think this is a safe change, but wanted to flag since it isn't directly related to any 3.10 compatibility.
@@ -32,7 +32,7 @@ | |||
] | |||
test_deps = [ | |||
'modernize', | |||
'nose>=1.3.7', | |||
'nose @ git+https://github.com/dimagi/nose.git@06dff28bbe661b9d032ce839ea0ec8e9eaf6f337', |
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.
Looks like nose
hasn't received an update since 2015. Is it time to remove it from our test stack here? (Not blocking this PR.)
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.
This is a bigger topic, so I agree that it should not block this PR. My vote is to keep nose until pytest has a solution for pytest-dev/pytest#3834
@@ -32,7 +32,7 @@ | |||
] | |||
test_deps = [ | |||
'modernize', | |||
'nose>=1.3.7', | |||
'nose @ git+https://github.com/dimagi/nose.git@06dff28bbe661b9d032ce839ea0ec8e9eaf6f337', |
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.
This is a bigger topic, so I agree that it should not block this PR. My vote is to keep nose until pytest has a solution for pytest-dev/pytest#3834
https://dimagi-dev.atlassian.net/browse/SAAS-13500
First step in upgrading commcare-cloud to work with python 3.10. Once tests pass, we should be able to test this on staging.
ENVIRONMENTS AFFECTED
None