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

Running tests using python 3.12 #81

Merged
merged 8 commits into from
Mar 11, 2024

Conversation

salman2013
Copy link
Contributor

@salman2013 salman2013 commented Feb 19, 2024

@salman2013 salman2013 changed the title chore: update python version to support tests with 3.11, 3.12 Running tests using python 3.11 and 3.12 Feb 20, 2024
@salman2013 salman2013 marked this pull request as ready for review February 20, 2024 10:24
@salman2013 salman2013 requested review from farhan and feanil February 20, 2024 10:24
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
django42: Django>=4.2,<5.0
setuptools
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the deal with requiring setuptools here, should it be in the base requirements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is available in requirement pip.in but the tests was failing even after upgrading it to new version. I read the documentation and found this solution

https://docs.python.org/dev/whatsnew/3.12.html#summary-release-highlights

Important deprecations, removals or restrictions:

PEP 623: Remove wstr from Unicode objects in Python’s C API, reducing the size of every str object by at least 8 bytes.

PEP 632: Remove the distutils package. See the migration guide for advice replacing the APIs it provided. The third-party Setuptools package continues to provide distutils, if you still require it in Python 3.12 and beyond.

gh-95299: Do not pre-install setuptools in virtual environments created with venv. This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environment.

The asynchat, asyncore, and imp modules have been removed, along with several unittest.TestCase method aliases.

assert excinfo.value.args == (
"Error determining metadata from message headers: "
"__init__() missing 1 required positional argument: 'event_type'",
expected_error_pattern = re.compile(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you using a regex here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test was failing due to a format change in 3.12 so i found this solution to work with both 3.8 and 3.12

@salman2013 salman2013 changed the title Running tests using python 3.11 and 3.12 Running tests using python 3.12 Feb 22, 2024
@salman2013 salman2013 requested a review from feanil March 5, 2024 09:56
@feanil feanil merged commit f303bf4 into openedx:main Mar 11, 2024
12 checks passed
@feanil feanil linked an issue Apr 20, 2024 that may be closed by this pull request
6 tasks
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.

Test event-bus-redis on Python 3.11/3.12
2 participants