thoth-station / thoth-ops-infra

Infrastructure project to have collections of container images.
GNU General Public License v3.0
0 stars 9 forks source link

Pytest runs compatible with full pyproject.toml #74

Closed VannTen closed 1 year ago

VannTen commented 1 year ago

Invoking setup.py is deprecated (see https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html )

Besides, when converting fully to pyproject.toml, we need another way anyway.

The simplest would be to run pipenv run pytest, that work locally. Or you can check some "env manager" tools like tox and friends @goern @harshad16 @codificat /priority important-soon (because high impact on CI)

goern commented 1 year ago

tox has the advantage of testing on multiple python environments, which might be nice for libraries (say, to check upfront if storages will work with py3.11). if we want that, we should go with tox, otherwise with a much simpler pipenv run. if we go with pipenv running pytest, does that mean we have to put all the test dependencies in Pipfile?

VannTen commented 1 year ago

On Tue, Jan 17, 2023 at 02:25:28AM -0800, Christoph Görn wrote:

if we go with pipenv running pytest, does that mean we have to put all the test dependencies in Pipfile?

Don't we do that already (in --dev dependencies) ?

goern commented 1 year ago

On Tue, Jan 17, 2023 at 02:25:28AM -0800, Christoph Görn wrote: if we go with pipenv running pytest, does that mean we have to put all the test dependencies in Pipfile? Don't we do that already (in --dev dependencies) ?

idk if that is true for all repos

VannTen commented 1 year ago

What I do know is that some repos have disynchronized deps between Pipfile and requirements.txt, usually with Pipfile up to date and requirements stale. (some of those I converted to pyproject.toml for instance)

goern commented 1 year ago

@VannTen could you go ahead and reach out to the Fedora Python SIG and see what their point of view/good practice is?

/assign @VannTen

VannTen commented 1 year ago

Will do

EDIT: Hum. But on what ? pipenv run pytest vs tox ? IMO they're unlikely to have an opinion, both have pros and cons depending on what we want to do.

On the "Where we should put our dependencies", I personally have a strong opinion that we should not have them in two different places (Pipfile + requirements.txt) because those two will (in fact, already have in some cases) diverge. EDIT2: And since we use pipenv, we could ditch requirements.txt and be done with it.

goern commented 1 year ago

right, then... let's go ahead and use Pipfile for all