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

Meta-ticket: Adopt mainstream Python testing/linting infrastructure: tox, pytest, ..., describe in Developer's Guide #28936

Open
mkoeppe opened this issue Jan 1, 2020 · 38 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 1, 2020

This metaticket proposes to use mainstream Python testing and linting infrastructure for Sage -- by adding configuration files and documentation.

tox:

pytest:

Other tickets:

Documentation tickets:

Infrastructure tickets:

See also:

CC: @jdemeyer @dimpase @embray @videlec @fchapoton @tscrim @jm58660 @tobiasdiez @kliem @nthiery @tornaria

Component: doctest framework

Issue created by migration from https://trac.sagemath.org/ticket/28936

@mkoeppe mkoeppe added this to the sage-9.0 milestone Jan 1, 2020
@mkoeppe mkoeppe modified the milestones: sage-9.0, sage-9.1 Jan 4, 2020
@mkoeppe mkoeppe changed the title Create tox plugin for running the sage doctester Create tox / pytest plugins for running the sage doctester Jan 4, 2020
@embray
Copy link
Contributor

embray commented Jan 6, 2020

Replying to @mkoeppe:

tox seems to be the preferred interface for running tests - see for example pypa/setuptools#931 (deprecation of setup.py test).

I don't know what you mean by "preferred interface" here. There isn't really any such thing as a preferred interface. It's just being proposed here as a recommendation over setup.py test. Sage doesn't use setup.py test anyways so there's nothing that needs to be "replaced" with a different interface if/when setup.py goes away.

The main advantage to tox is the ability to run a package's tests across multiple runtime environments (esp. different Python versions). This isn't really possible currently with Sage; it would actually be very difficult to use tox in any sensible manner with Sage.

If someone wants to do this anyways I don't see the harm really, but I'm not sure what problem it would be solving.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 11, 2020

comment:4

A first step: #28987

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 13, 2020

comment:5

Replying to @embray:

Replying to @mkoeppe:
The main advantage to tox is the ability to run a package's tests across multiple runtime environments (esp. different Python versions). This isn't really possible currently with Sage; it would actually be very difficult to use tox in any sensible manner with Sage.

FWIW, I managed to use tox on top of the sage installation, see https://github.com/mkoeppe/sage-numerical-backends-gurobi/blob/master/tox.ini: The trick is to run tox with sitepackages = true and an install_command that installs into the user scheme. With this trick, after all, no new plugin for tox is needed to handle the sage environment.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 13, 2020

comment:6

I have broadened the ticket description.

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Create tox / pytest plugins for running the sage doctester Meta-ticket: Adopt mainstream Python testing/linting infrastructure Jan 13, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 14, 2020

comment:8

pushing these forward to 9.2

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 Apr 14, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Meta-ticket: Adopt mainstream Python testing/linting infrastructure Meta-ticket: Adopt mainstream Python testing/linting infrastructure, describe in Developer's Guide Apr 16, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@tobiasdiez

This comment has been minimized.

@tobiasdiez

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@tobiasdiez

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 May 10, 2021
@mkoeppe

This comment has been minimized.

@tobiasdiez
Copy link
Contributor

comment:31

What do you think about using pytest-cov for generating the test coverage report? The results can then be uploded to codecov as part of the build process (github action). This gives a nice overview of the actual test coverage (i.e. code covered by tests) and could replace the sage-coverage scripts in the future.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 28, 2021

comment:32

+1 on investigating this. Myself I have no experience with the available tools (including the sage-coverage scripts even though I have fixed them up at least once). As usual, it's best to build a prototype and then demonstrate to the sage-devel community that it is useful.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

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

No branches or pull requests

3 participants