Skip to content

Running tests using python 3.12 - #81

Merged
feanil merged 8 commits into
openedx:mainfrom
salman2013:salman/update-python-version
Mar 11, 2024
Merged

feanil merged 8 commits into
openedx:mainfrom
salman2013:salman/update-python-version

Conversation

@salman2013

@salman2013 salman2013 commented Feb 19, 2024 •

Copy link
Copy Markdown
Contributor

Description:

Running tests for python 3.11 and 3.12

Ticket: Aximprovements Team (view),
openedx/axim-engineering#1045

@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
Comment thread tox.ini
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
django42: Django>=4.2,<5.0
setuptools

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@feanil feanil linked an issue Apr 20, 2024 that may be closed by this pull request
6 tasks done
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