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

Update project to support django 5.0 #153

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

ldynia
Copy link

@ldynia ldynia commented Jan 17, 2024

Update project to support django 5.0 and python 3.12

tox.ini Outdated
py3{8,9,10,11}-django42
py3{8,9,10,11,12}-django41
py3{8,9,10,11,12}-django42
py3{8,9,10,11,12}-django50
Copy link
Member

Choose a reason for hiding this comment

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

Django 5.0 requires Python >= 3.10 according to the package metadata on PyPI.

After adjusting this line you also need to exclude Python < 3.10 for Django 5.0 in the test matrix of GHA.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks. I have made relevant changes.

@ldynia ldynia force-pushed the django-5.0-and-python-3.12 branch 2 times, most recently from ecad83d to cd7ea82 Compare January 18, 2024 23:23
@ldynia ldynia changed the title Update project to support django 5.0 and python 3.12 Update project to support django 5.0 Jan 19, 2024
@bittner bittner self-requested a review January 21, 2024 09:26
Copy link
Member

@bittner bittner left a comment

Choose a reason for hiding this comment

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

Great, looks good, thank you!

Could you update the test matrix also with the Python version, i.e. add Python 3.12, please? Django 5.0 and 4.2 officially support 3.12, Django 4.1 only goes up to 3.11, Django 3.2 only to 3.10.

@ldynia ldynia force-pushed the django-5.0-and-python-3.12 branch 2 times, most recently from 8914f21 to 83feb69 Compare January 22, 2024 08:26
@ldynia
Copy link
Author

ldynia commented Jan 22, 2024

I have update the matrix please review

Copy link
Member

@bittner bittner left a comment

Choose a reason for hiding this comment

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

You're a hero! 🥇

Now, the tests for Python 3.12 fail for something that is not your fault! It would be awesome if you could fix that too, anyway.

The problem comes from deprecated aliases that were finally dropped in Python 3.12.

AFAICS, according to the tests, assertEquals needs to be replaced by assertEqual in the acceptance tests of the project.

          File "tests/acceptance/steps/context-urlhelper.py", line 29, in is_baseurl_value
            context.test.assertEquals(context.result, context.base_url)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
        AttributeError: 'BehaviorDrivenTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
          File "tests/acceptance/steps/context-urlhelper.py", line 34, in baseurl_plus_path
            context.test.assertEquals(context.result, context.base_url + url_path)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
        AttributeError: 'BehaviorDrivenTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
          File "tests/acceptance/steps/context-urlhelper.py", line 54, in explicit_reverse
            context.test.assertEquals(context.result, context.get_url(path))
            ^^^^^^^^^^^^^^^^^^^^^^^^^
        AttributeError: 'BehaviorDrivenTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
          File "tests/acceptance/steps/context-urlhelper.py", line 60, in get_model_url
            context.test.assertEquals(context.result, context.get_url(path))
            ^^^^^^^^^^^^^^^^^^^^^^^^^
        AttributeError: 'BehaviorDrivenTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

If you'd replace assertEquals in those places by assertEqual then the two failing test jobs for Python 3.12 will also pass.

@ldynia
Copy link
Author

ldynia commented Jan 23, 2024

I have made the changes from assertEquals to assertEqual

@bittner bittner merged commit c7e705b into behave:main Jan 24, 2024
24 checks passed
@bittner
Copy link
Member

bittner commented Jan 24, 2024

Thank you for contributing! 💯 🥇

@ldynia
Copy link
Author

ldynia commented Jan 24, 2024

My motto is Live long and Pull Request :)

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