Page MenuHomeSoftware Heritage

Migrate tox.ini to extras = xxx instead of deps = .[testing]
ClosedPublic

Authored by olasd on Nov 21 2019, 11:32 AM.

Diff Detail

Repository
rDDEP Push deposit
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont added inline comments.
tox.ini
2 ↗(On Diff #7987)

is py3 the default name of the testenv below?

23 ↗(On Diff #7987)

Can't we keep that environment?

It's less verbose expecially for dev purposes when there are errors (less scrolling backward to read the errors)...

-> because it skips the coverage report.

Split commits; remove coverage for -dev environment

tox.ini
2 ↗(On Diff #7987)

envlist is only the list of environments that tox runs by default when called with no arguments. It's overridden (and ignored) if you pass the -e option on the command-line. (It's also what's returned by tox -a).

The [testenv] section is the one that is used for default settings. [testenv:foo] is used for settings that are only used for tox -e foo.

Using the plain [testenv] section allows us to run, for example, tox -e py38 to run the tests with Python 3.8, or tox -e pypy3, or tox -e py36-dev, and get a sensible behavior.

You can tweak the settings for different environments in the [testenv] by matching "factors". factors are the bits of the environment name separated by dashes:

  • environment py3 has factors py3
  • environment pypy3-dev has factors pypy3 and dev

All tox settings can be controlled by factors, by prefixing the line with <factor-match>:. This is what happens at line 11: the ipdb dependency is only enabled when using an environment with the dev factor.

23 ↗(On Diff #7987)

Fair enough, although we don't really _need_ a separate environment for that, you can just pass --no-cov to pytest by calling tox -e py3 -- --no-cov.

Thanks and thx for the thorough explanation.

I'm sold on using the --no-cov instead of adding a dev environment if you want to remove it.

Cheers,

This revision is now accepted and ready to land.Nov 21 2019, 12:24 PM