Skip to content

Commit ece0714

Browse files
Added functionality to test multiple versions of python using tox (#994)
* Adding tox support Adds tox support for testing against multiple versions of python * PR etiquette comment Add example of how to raise a PR. * Add a comment about multi-version local testing Adds a comment about how to run tests locally on multiple versions of python. Ensures it is clear that it only works if particular version of python is installed on the users machine. Recommends `pytest` as a possible way to manage multiple local versions of python. Note the hyperlink out to `setup.cfg` is pinned to commit sha 1297c8c instead of pinning to main branch. --------- Co-authored-by: Nils Braun <[email protected]>
1 parent 13041e6 commit ece0714

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,9 @@ tsfresh/notebooks/data/
6161
# dask
6262
dask-worker-space
6363
dask-worker-space/
64+
65+
# python version files
66+
.python_version
67+
68+
# tox log files
69+
.tox

docs/text/how_to_contribute.rst

+18
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ you have to:
6767
pytest
6868
6969
70+
To test changes across multiple versions of Python, run:
71+
72+
73+
.. code::
74+
75+
tox -r
76+
77+
78+
`tox -r` will execute tests for the Python versions specified in `setup.cfg <https://github.com/blue-yonder/tsfresh/blob/1297c8ca5bd6f8f23b4de50e3f052fb4ec1307f8/setup.cfg>`_ using the `envlist` variable. For example, if `envlist` is set to `py37, py38`, the test suite will run for Python 3.7 and 3.8 on the local development platform, assuming the binaries for those versions are available locally. The exact Python microversions (e.g. `3.7.1` vs `3.7.2`) depend on what is installed on the local development machine.
79+
80+
A recommended way to manage multiple Python versions when testing locally is with `pyenv`, which enables organized installation and switching between versions.
81+
7082
Documentation
7183
'''''''''''''
7284

@@ -90,3 +102,9 @@ We use black and isort for styling. They are automatically triggered on every co
90102

91103

92104
We are looking forward to hear from you! =)
105+
106+
107+
PR Descriptions
108+
'''''''''''''''
109+
110+
The PR should have a clear and descriptive title, along with a detailed description of the changes made, the problem being addressed, and any relevant tips for reviewers. An example of what this might look like is `here. <https://github.com/blue-yonder/tsfresh/pull/994#issue-1509962136>`_

setup.cfg

+20
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,23 @@ max-line-length = 120
140140
# This will be used when updating. Do not change!
141141
version = 3.2.3
142142
package = tsfresh
143+
144+
[tox:tox]
145+
# Tox global conifguration options
146+
minversion = 4.0.0
147+
# Which python versions to test for
148+
envlist = py37, py38, py39, py310, py311
149+
# Don't throw an error if a specific version of python is not installed
150+
skip_missing_interpreters = True
151+
# Ensure that tox uses a virtual environment to build a source distribution
152+
isolated_build = True
153+
154+
# Tox configuration options for each version of python
155+
[testenv]
156+
commands =
157+
# display the python version that tests are being run on
158+
python -V
159+
# install package requirements before running tests
160+
python -m pip install .[testing]
161+
# run the tests
162+
python -m pytest tests/

0 commit comments

Comments
 (0)