diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a997503..fbbdbc99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,20 +27,22 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2.2.0 + - uses: mamba-org/setup-micromamba@v1 with: - auto-update-conda: false - python-version: ${{ matrix.python-version }} - channels: conda-forge,nodefaults - miniforge-variant: Mambaforge - - - name: Install core dependencies. - shell: bash -l {0} - run: mamba install -c conda-forge tox-conda coverage + environment-name: gha-testing + condarc: | + channels: + - nodefaults + - conda-forge + create-args: >- + python=${{ matrix.python-version }} + mamba + tox-conda + cache-environment: true # Unit, integration, and end-to-end tests. @@ -49,7 +51,7 @@ jobs: run: tox -e pytest -- -m "unit or (not integration and not end_to_end)" --cov=src --cov=tests --cov-report=xml -n auto - name: Upload coverage report for unit tests and doctests. - if: runner.os == 'Linux' && matrix.python-version == '3.8' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F unit -c @@ -58,7 +60,7 @@ jobs: run: tox -e pytest -- -m integration --cov=src --cov=tests --cov-report=xml -n auto - name: Upload coverage reports of integration tests. - if: runner.os == 'Linux' && matrix.python-version == '3.8' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F integration -c @@ -67,6 +69,6 @@ jobs: run: tox -e pytest -- -m end_to_end --cov=src --cov=tests --cov-report=xml -n auto - name: Upload coverage reports of end-to-end tests. - if: runner.os == 'Linux' && matrix.python-version == '3.8' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 329859e2..dac51200 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: rev: v3.9.0 hooks: - id: reorder-python-imports - args: [--py37-plus, --add-import, 'from __future__ import annotations'] + args: [--py38-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/setup-cfg-fmt rev: v2.3.0 hooks: diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 0808dd98..803d0221 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -3,7 +3,7 @@ channels: - nodefaults dependencies: - - python >=3.7 + - python >=3.8 - pip - setuptools_scm - toml diff --git a/docs/source/changes.md b/docs/source/changes.md index f0b23b6e..c0b83b04 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -5,7 +5,11 @@ chronological order. Releases follow [semantic versioning](https://semver.org/) releases are available on [PyPI](https://pypi.org/project/pytask) and [Anaconda.org](https://anaconda.org/conda-forge/pytask). -## 0.3.2 - 2023-xx-xx +## 0.4.0 - 2023-xx-xx + +- {pull}`323` remove Python 3.7 support and use a new Github action to provide mamba. + +## 0.3.2 - 2023-06-07 - {pull}`345` updates the version numbers in animations. - {pull}`352` publishes `db` that is required by pytask-environment. diff --git a/environment.yml b/environment.yml index 9d801969..09a9838d 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ channels: - nodefaults dependencies: - - python >=3.7 + - python >=3.8 - pip - setuptools_scm - toml diff --git a/pyproject.toml b/pyproject.toml index fe63803c..8dc8092d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ ignore-words-list = "falsy, hist, ines, unparseable" [tool.ruff] -target-version = "py37" +target-version = "py38" select = ["ALL"] fix = true extend-ignore = [ diff --git a/setup.cfg b/setup.cfg index 6c065c0e..09600d21 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ install_requires = pybaum>=0.1.1 rich tomli>=1.0.0 -python_requires = >=3.7 +python_requires = >=3.8 include_package_data = True package_dir = =src diff --git a/src/_pytask/capture.py b/src/_pytask/capture.py index a4bf76e6..777c76c7 100644 --- a/src/_pytask/capture.py +++ b/src/_pytask/capture.py @@ -34,6 +34,7 @@ from tempfile import TemporaryFile from typing import Any from typing import AnyStr +from typing import final from typing import Generator from typing import Generic from typing import Iterator @@ -46,14 +47,6 @@ from _pytask.nodes import Task -if sys.version_info >= (3, 8): - from typing import final -else: - - def final(f: Any) -> Any: - return f - - class _CaptureMethod(enum.Enum): FD = "fd" NO = "no" diff --git a/src/_pytask/nodes.py b/src/_pytask/nodes.py index 53bb5e74..2d330f02 100644 --- a/src/_pytask/nodes.py +++ b/src/_pytask/nodes.py @@ -98,7 +98,7 @@ def state(self) -> str | None: return None @classmethod - @functools.lru_cache() + @functools.lru_cache def from_path(cls, path: Path) -> FilePathNode: """Instantiate class from path to file. diff --git a/src/_pytask/path.py b/src/_pytask/path.py index 3e7864c9..576f2f79 100644 --- a/src/_pytask/path.py +++ b/src/_pytask/path.py @@ -100,7 +100,7 @@ def find_common_ancestor(*paths: str | Path) -> Path: return common_ancestor -@functools.lru_cache() +@functools.lru_cache def find_case_sensitive_path(path: Path, platform: str) -> Path: """Find the case-sensitive path. diff --git a/tests/test_debugging.py b/tests/test_debugging.py index 41a15f84..6687bd0d 100644 --- a/tests/test_debugging.py +++ b/tests/test_debugging.py @@ -133,7 +133,6 @@ def task_example(depends_on): @pytest.mark.end_to_end() @pytest.mark.skipif(not IS_PEXPECT_INSTALLED, reason="pexpect is not installed.") @pytest.mark.skipif(sys.platform == "win32", reason="pexpect cannot spawn on Windows.") -@pytest.mark.skipif(sys.version_info < (3, 7), reason="breakpoint is Python 3.7+ only.") def test_breakpoint(tmp_path): source = """ def task_example():