From f8487373a195698f03eff374be69208f816bad42 Mon Sep 17 00:00:00 2001 From: Scott-Simmons <52365471+Scott-Simmons@users.noreply.github.com> Date: Sat, 24 Dec 2022 17:16:45 +1300 Subject: [PATCH 1/3] Adding tox support Adds tox support for testing against multiple versions of python --- .gitignore | 6 ++++++ setup.cfg | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.gitignore b/.gitignore index fd9f611b..54a044db 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,9 @@ tsfresh/notebooks/data/ # dask dask-worker-space dask-worker-space/ + +# python version files +.python_version + +# tox log files +.tox diff --git a/setup.cfg b/setup.cfg index 0043f036..6bbe7d5a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -140,3 +140,23 @@ max-line-length = 120 # This will be used when updating. Do not change! version = 3.2.3 package = tsfresh + +[tox:tox] +# Tox global conifguration options +minversion = 4.0.0 +# Which python versions to test for +envlist = py37, py38, py39, py310, py311 +# Don't throw an error if a specific version of python is not installed +skip_missing_interpreters = True +# Ensure that tox uses a virtual environment to build a source distribution +isolated_build = True + +# Tox configuration options for each version of python +[testenv] +commands = + # display the python version that tests are being run on + python -V + # install package requirements before running tests + python -m pip install .[testing] + # run the tests + python -m pytest tests/ From b7de7d0607156028e1761a7c6a3d2988d67e9980 Mon Sep 17 00:00:00 2001 From: Scott-Simmons <52365471+Scott-Simmons@users.noreply.github.com> Date: Sun, 10 Nov 2024 22:20:33 +1100 Subject: [PATCH 2/3] PR etiquette comment Add example of how to raise a PR. --- docs/text/how_to_contribute.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/text/how_to_contribute.rst b/docs/text/how_to_contribute.rst index 25ab5957..a6a5cdc6 100644 --- a/docs/text/how_to_contribute.rst +++ b/docs/text/how_to_contribute.rst @@ -90,3 +90,9 @@ We use black and isort for styling. They are automatically triggered on every co We are looking forward to hear from you! =) + + +PR Descriptions +''''''''''''''' + +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. `_ From 1e9c3bce4a6bc8c13aa37365e73e54b8afc1d23d Mon Sep 17 00:00:00 2001 From: Scott-Simmons <52365471+Scott-Simmons@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:57:10 +1100 Subject: [PATCH 3/3] 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 1297c8ca5bd6f8f23b4de50e3f052fb4ec1307f8 instead of pinning to main branch. --- docs/text/how_to_contribute.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/text/how_to_contribute.rst b/docs/text/how_to_contribute.rst index a6a5cdc6..0633784f 100644 --- a/docs/text/how_to_contribute.rst +++ b/docs/text/how_to_contribute.rst @@ -67,6 +67,18 @@ you have to: pytest +To test changes across multiple versions of Python, run: + + +.. code:: + + tox -r + + +`tox -r` will execute tests for the Python versions specified in `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. + +A recommended way to manage multiple Python versions when testing locally is with `pyenv`, which enables organized installation and switching between versions. + Documentation '''''''''''''