python-pytest-cases icon indicating copy to clipboard operation
python-pytest-cases copied to clipboard

Remove circular dependency for tests

Open fabaff opened this issue 4 years ago • 4 comments

pytest-cases depends on decopatch and makefun. decopatch and makefun depends on pytest-cases. This is problematic for distributions as constellationa like that require additional work or don't allow to run the test suite.

Thanks

fabaff avatar May 04 '21 10:05 fabaff

Thanks @fabaff for your feedback.

makefun does not require any of the other two at runtime (see installation requirements here)

decopatch solely requires makefun at runtime (see installation requirements here)

And finally pytest-cases requires both (see here).

So there is no circular dependency, and this is why the three packages can be released on PyPi and Conda forge without issues.

What do you try to achieve and why ?

smarie avatar May 04 '21 14:05 smarie

makefun does not require any of the other two at runtime (see installation requirements here)

Not for runtime but for the tests as mentioned in the first comment (I updated the title to reflect that). pytest-cases is a test requirement for makefun.

It's works for PyPI and other distribution channels as they don't require to run the tests. For most operating system distributions is preferred to run the test suite when ever possible during the build process for the packages to rise the quality.

I know that distro packaging is no the primary concern of developers :wink:

fabaff avatar May 05 '21 11:05 fabaff

See https://github.com/smarie/python-decopatch/issues/20#issuecomment-832856125 that might be related. It is basically a matter of what you choose to package in RPMs: applications (including all the libraries they require) or individual libraries. If you choose to package individual python libraries, then the best quality you can aim for is the one of PyPi and conda, the reference repositories.

That being said, for the present situation, I would recommend to separate

  • the test dependencies (where you do not need to ensure compat with the versions installed in the distro)
  • from the runtime dependencies, where indeed it is good that you check compliance with the distribution at hand

To reach this objective you could run the tests in a venv/virtualenv. That way the test dependencies can be anything (any version).

smarie avatar May 05 '21 17:05 smarie

Hi @fabaff coming back to you about this issue: how does it sound to run the tests of each package in a venv/virtualenv ? Would it solve your circular deps issue for packaging ? Let me know.

Note that for most of my projects I try to migrate to using github actions and nox, so it is relatively easy to run the tests: simply running nox does the trick.

smarie avatar Jun 01 '21 08:06 smarie