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

tests; fix csrf tests #138

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

jrcastro2
Copy link
Contributor

No description provided.

@@ -12,6 +12,7 @@
from __future__ import absolute_import, print_function

import json
import typing as t # Required for tests to pass
Copy link
Contributor

Choose a reason for hiding this comment

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

why is it not passing without it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is independent of the changes, it looks like it started failing recently with this:
image

After checking it looks it's caused by HTTPException that has the t.Optional (we are inheriting from them): https://github.com/pallets/werkzeug/blob/main/src/werkzeug/exceptions.py#L76-L77

I couldn't find a better way to fix this, any ideas are welcomed!

Copy link
Contributor

Choose a reason for hiding this comment

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

that seems strange to me. i tested without import typing as t with python3.12 and python3.9, both worked. i checked for python3.9 the pip freeze diff. the only difference was that on github two additional packages were installed, mock and requirements-builder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can see it in the actions history that it failed, you can check it here: https://github.com/inveniosoftware/invenio-rest/actions/runs/9908547353/job/27374557091

It was also failing locally with the same error.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah i checked that in the github actions. it is strange that it worked on my local installation and it doesn't work on your local machine and on github.

could you still reproduce it on your local machine?

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, same issue locally with python 3.9 and linux

Copy link
Contributor

Choose a reason for hiding this comment

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

hm strange. i have managed to reproduce it on another linux machine now. i solved it with

nitpick_ignore = [
    ("py:class", "t.Optional"),
]

added to docs/conf.py. i am not sure which solution is the better. normally i would go with docs/conf.py because it doesn't add not used imports in a py file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for sharing this! Indeed it's better to do this for the moment.

@utnapischtim
Copy link
Contributor

btw the cern copyright notice could be updated too

@jrcastro2
Copy link
Contributor Author

btw the cern copyright notice could be updated too

Done! 👍

@alejandromumo alejandromumo merged commit 44f812d into inveniosoftware:master Jul 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants