treebeardtech / nbmake

📝 Pytest plugin for testing notebooks
https://pypi.org/project/nbmake/
Apache License 2.0
184 stars 18 forks source link

pytest deprecation warning #68

Closed carlodri closed 2 years ago

carlodri commented 2 years ago

Describe the bug Deprecation warning appears when starting pytest using platform: darwin, Python 3.10.4, pytest 7.1.2, pytest-sugar 0.9.4 and nbmake-1.3.0:

../../xxxx/python3.10/site-packages/nbmake/pytest_plugin.py:48
  /Users/xxxx/python3.10/site-packages/nbmake/pytest_plugin.py:48: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to NotebookFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return NotebookFile.from_parent(parent, fspath=path)

Desktop (please complete the following information):

alex-treebeard commented 2 years ago

Thanks for raising this @carlodri, It seems that we can't remove fspath without breaking pytest 6 users.

I reckon we either leave it as is for the moment or pivot off the version number with pkg_resources.get_distribution("pytest").version

Are you able to silence this warning for now?

Ygilany commented 2 years ago

you can silence the warning with --disable-warnings but since this is deprecated, it means it will be removed from upcoming releases. you can either introduce a backward compatible solution that works for both versions. Or pytest 6 can continue using this version of nbmake. You need to be able to progress the project.

alex-treebeard commented 2 years ago

Hi @ygilany, do you think future releases of nbmake need to support pytest 6?

carlodri commented 2 years ago

@alex-treebeard thank you, it's not a big problem for me. Just reporting because at a certain point it will require some changes to adapt to future versions of pytest.

Thank you for the great package by the way!

Ygilany commented 2 years ago

@alex-treebeard sorry for not seeing this sooner. I do believe the library should be able to keep upgrading to newer packages. Ultimately the decision is yours as the library maintainer. But your alternatives are (stating the obvious but verbalizing it):

alex-treebeard commented 2 years ago

Thanks for bumping this @Ygilany, I've gone with option 3, released on 1.3.3