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 Babel package #486

Merged
merged 5 commits into from
Apr 2, 2023
Merged

update Babel package #486

merged 5 commits into from
Apr 2, 2023

Conversation

kvchitrapu
Copy link
Collaborator

@kvchitrapu kvchitrapu commented Apr 1, 2023

Upgrade the Babel package to version ^2.12 in response to the Python version upgrade. Fixes #483

@kvchitrapu kvchitrapu changed the title fixes #483 update Babel package Apr 1, 2023
@kvchitrapu kvchitrapu requested a review from akprasad April 1, 2023 04:26
@kvchitrapu
Copy link
Collaborator Author

@akprasad , python unit tests are failing. You probably noticed it. I don't think this PR broke them.

Copy link
Contributor

@akprasad akprasad left a comment

Choose a reason for hiding this comment

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

looks good, will approve once the tests pass

@akprasad
Copy link
Contributor

akprasad commented Apr 1, 2023

@akprasad , python unit tests are failing. You probably noticed it. I don't think this PR broke them.

It did, see the logs:

        babel = Babel(app)
>       babel.init_app(app, locale_selector=get_locale)
E       TypeError: Babel.init_app() got an unexpected keyword argument 'locale_selector'

I'll take a look.

@akprasad
Copy link
Contributor

akprasad commented Apr 1, 2023

@kvchitrapu reverting changes to ambuda/__init__.py fixes the tests locally for me.

@akprasad
Copy link
Contributor

akprasad commented Apr 1, 2023

@kvchitrapu I updated the PR so tests pass, but docker fails further in:

curl: (52) Empty reply from server
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (56) Recv failure: Connection reset by peer
Error: Process completed with exit code 124.

@kvchitrapu
Copy link
Collaborator Author

kvchitrapu commented Apr 2, 2023

@kvchitrapu I updated the PR so tests pass, but docker fails further in:

curl: (52) Empty reply from server
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (56) Recv failure: Connection reset by peer
Error: Process completed with exit code 124.

@akprasad Python 3.10 dependencies have to stabilized. Reverting changes to ambuda/__init__.py fixed unit tests but broke the web app in this manner:

# Extensions
    babel = Babel(app)

    @babel.localeselector
    def get_locale():
        return session.get("locale", config_spec.BABEL_DEFAULT_LOCALE)

Exception:

ambuda-local-ambuda-web-1  | [0]   File "/app/ambuda/__init__.py", line 117, in create_app
ambuda-local-ambuda-web-1  | [0]     @babel.localeselector
ambuda-local-ambuda-web-1  | [0] AttributeError: 'Babel' object has no attribute 'localeselector'

Searching for a solution.

@akprasad
Copy link
Contributor

akprasad commented Apr 2, 2023

Oh, I think my changes to __init__.py are in error -- please revert them, sorry for the noise. (They are in error because they use the older version of requirements.txt. If we update that file to use the latest version of flask-babel, I think your changes are correct.)

@kvchitrapu
Copy link
Collaborator Author

Oh, I think my changes to __init__.py are in error -- please revert them, sorry for the noise. (They are in error because they use the older version of requirements.txt. If we update that file to use the latest version of flask-babel, I think your changes are correct.)

All set. We need to change the Babel instantiation in init.py. The unit tests were working on my laptop, but they were not working in GitHub Actions, as the Ubuntu image is still pulling Flask-Babel v2.x. I forgot to update the requirements.txt file. GitHub Actions should now pull v3.0.1, and the unit tests should succeed.

@kvchitrapu
Copy link
Collaborator Author

kvchitrapu commented Apr 2, 2023

@akprasad My bad. I should have dug a little deeper on the unit tests failing in GH actions. All good now. Review and merge when you get a chance.

@akprasad
Copy link
Contributor

akprasad commented Apr 2, 2023

Thanks! Looks like the PR history has been mixed with some other work, as I see 27 files changed -- can you clean this up? Once it's pared down I'll merge it in.

Edit: I'll fix this then merge it in.

@akprasad akprasad merged commit 5c83907 into ambuda-org:main Apr 2, 2023
@kvchitrapu kvchitrapu deleted the defect-483 branch April 2, 2023 13:09
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.

Fix docker image build in PRs
2 participants