Skip to content

Commit

Permalink
Responded to PR review
Browse files Browse the repository at this point in the history
- Remove the python PATCH version from makefile
- Move calls to `make clean` to be part of the docker test invokation instead of within local test commands
- Removed the one line makefile commands (the docs have enough info on the development process so will not bother using `make` for these.
- Updated hyperlink to point to main instead of specific commit sha
  • Loading branch information
Scott-Simmons committed Nov 18, 2024
1 parent 27f02b9 commit 3ddad59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 33 deletions.
38 changes: 8 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@ WORKDIR := /tsfresh
TEST_IMAGE := tsfresh-test-image
TEST_DOCKERFILE := Dockerfile.testing
TEST_CONTAINER := tsfresh-test-container
# >= 3.9.2 ---> https://github.com/dask/distributed/issues/7956
PYTHON_VERSIONS := "3.7.12 3.8.12 3.9.12 3.10.12 3.11.0"
BLACK_VERSION := 22.12.0
# Isort 5.12.0 not supported with python 3.7.12
ISORT_VERSION := 5.12.0
PYTHON_VERSIONS := "3.7 3.8 3.9 3.10 3.11"

build-testenv:
# Tests `PYTHON_VERSIONS`, provided they are also
# specified in setup.cfg `envlist`
test-all-testenv: build-docker-testenv run-docker-tests clean

build-docker-testenv:
docker build \
-f $(TEST_DOCKERFILE) \
-t $(TEST_IMAGE) \
--build-arg PYTHON_VERSIONS=$(PYTHON_VERSIONS) \
.

# Tests `PYTHON_VERSIONS`, provided they are also
# specified in setup.cfg `envlist`
test-all-testenv: clean build-testenv
run-docker-tests:
docker run --rm \
--name $(TEST_CONTAINER) \
-v .:$(WORKDIR) \
Expand All @@ -26,28 +24,8 @@ test-all-testenv: clean build-testenv
-v egg_artifacts:$(WORKDIR)/tsfresh.egg-info \
$(TEST_IMAGE)

# Tests the python binaries installed
# on local machine, provided they are also
# specified in setup.cfg `envlist`
test-all-local: clean
tox -r -p auto

# Tests for python version on local machine in
# current context (e.g. global or local version of
# python set by pyenv, or the python version in
# the active virtualenv).
test-local: clean
pip install .[testing]
pytest

clean:
rm -rf .tox build/ dist/ *.egg-info

install-formatters:
pip install black==$(BLACK_VERSION) isort==$(ISORT_VERSION)

format: install-formatters
black --extend-exclude \.docs .
isort --profile black --skip-glob="docs" .

.PHONY: clean test-all-local test-local test-all-testenv format install-formatters
.PHONY: build-docker-testenv clean run-docker-tests test-all-testenv
6 changes: 3 additions & 3 deletions docs/text/how_to_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ you have to:

.. code::
make test-local
pytest
To test changes across multiple versions of Python, run:


.. code::
make test-all-local
tox -r -p auto
This 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.
This will execute tests for the Python versions specified in `setup.cfg <https://github.com/blue-yonder/tsfresh/blob/main/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.

Expand Down

0 comments on commit 3ddad59

Please sign in to comment.