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

PytestRemovedIn8Warning: #325

Conversation

Hadatko
Copy link
Member

@Hadatko Hadatko commented Nov 23, 2022

Signed-off-by: Cervenka Dusan [email protected]

Pull request

Choose Correct

  • bug
  • feature

Describe the pull request

The (fspath: py.path.local) argument to ErpcgenFile is deprecated. Please use the (path: pathlib.Path) argument instead.

  • formatted code
  • added paramaters types

To Reproduce

Run pytest tests without modification

Expected behavior

No warning

Screenshots

Desktop (please complete the following information):

  • OS:
  • eRPC Version:

Steps you didn't forgot to do

  • I checked if other PR isn't solving this issue.
  • I read Contribution details and did appropriate actions.
  • PR code is tested.
  • PR code is formatted.
  • Allow edits from maintainers pull request option is set (recommended).

Additional context

The (fspath: py.path.local) argument to ErpcgenFile is deprecated.
Please use the (path: pathlib.Path) argument instead.

Signed-off-by: Cervenka Dusan <[email protected]>
@Hadatko Hadatko added this to the 1.11.0 milestone Nov 23, 2022
@Hadatko Hadatko self-assigned this Nov 23, 2022
@Hadatko Hadatko force-pushed the feature/solved_python_warning branch 5 times, most recently from 51d2df6 to dfeee2d Compare November 23, 2022 16:50
Signed-off-by: Cervenka Dusan <[email protected]>
@Hadatko Hadatko force-pushed the feature/solved_python_warning branch from dfeee2d to cc8ee16 Compare November 23, 2022 16:58
@Hadatko
Copy link
Member Author

Hadatko commented Nov 23, 2022

@MichalPrincNXP i think this one can be merged.

Copy link
Member

@MichalPrincNXP MichalPrincNXP left a comment

Choose a reason for hiding this comment

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

Do you have an idea what causes this error when running erpcgen tests?

24-Jan-2023 14:42:06 | class ErpcgenTestSpec(object):
24-Jan-2023 14:42:06 | conftest.py:317: in ErpcgenTestSpec
24-Jan-2023 14:42:06 | def __init__(self, name: str, path: path.local, spec: dict[str, typing.Any], verbosity: int = 0):
24-Jan-2023 14:42:06 | E   TypeError: 'type' object is not subscriptable

@Hadatko
Copy link
Member Author

Hadatko commented Jan 24, 2023

Where do you see that message? I don't see it

@MichalPrincNXP
Copy link
Member

MichalPrincNXP commented Jan 24, 2023

Where do you see that message? I don't see it

when executing erpc\erpcgen\test>py.test

@Hadatko
Copy link
Member Author

Hadatko commented Jan 25, 2023

Are you executing it on your machine? I don't see any of these messages in circleci logs

@Hadatko
Copy link
Member Author

Hadatko commented Jan 25, 2023

If you are executing it on your machine, be sure you are using pytest for python3

@MichalPrincNXP
Copy link
Member

We are using Python 3.8.10, pytest-7.1.2, pluggy-1.0.0, this seems to be quite latest setup

@MichalPrincNXP
Copy link
Member

CircelCI is using Python 3.10.6, pytest-7.2.0, pluggy-1.0.0

@Hadatko
Copy link
Member Author

Hadatko commented Jan 25, 2023

Coudl you add print directly under init?

print(f"name:{name} path:{path} spec:{spec} verbosity:{verbosity}")

I think spec is crucial.

@Hadatko
Copy link
Member Author

Hadatko commented Jan 25, 2023

acrios_cervennka@acrios-cervennka-ThinkPad-P50:~/repozitare/acrios-erpc/erpcgen/test$ python3.8 -m pytest 
ImportError while loading conftest '/home/acrios_cervennka/repozitare/acrios-erpc/erpcgen/test/conftest.py'.
conftest.py:301: in <module>
    class ErpcgenTestSpec(object):
conftest.py:317: in ErpcgenTestSpec
    def __init__(self, name: str, path: path.local, spec: dict[str, typing.Any], verbosity: int = 0):
E   TypeError: 'type' object is not subscriptable

I am able to reproduce error. Issue is with python3.8 version not pytest version. I will take a look

@Hadatko
Copy link
Member Author

Hadatko commented Jan 25, 2023

The issue is with using typing.Any. Python3.8 is not able to parse it correctly. I pushed fix for 3.8 (removing data types definition)

@Hadatko Hadatko force-pushed the feature/solved_python_warning branch from 8f9b88e to a1ea8b3 Compare January 25, 2023 09:43
@MichalPrincNXP
Copy link
Member

Thank you Dusan for the effort and the latest fix for Python 3.8. We have now switched to the ubuntu22+python3.10 like in CircleCI for internal testing, to be on the same page. The old setup with ubuntu20+python3.8 is kept and I have been able to validate your latest fix for python 3.8

@MichalPrincNXP MichalPrincNXP merged commit 2fd9303 into EmbeddedRPC:develop Jan 25, 2023
@Hadatko Hadatko deleted the feature/solved_python_warning branch January 25, 2023 12:02
@Hadatko
Copy link
Member Author

Hadatko commented Jan 25, 2023

Yeah i wanted ubuntu 20.04 lts but it was not available on circle ci so i moved to latest lts 22.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants