Skip to content

Commit 1c9cd5d

Browse files
authored
Remove Python 3.7 support and add a new action for mamba. (#323)
1 parent 39bfcdf commit 1c9cd5d

11 files changed

Lines changed: 28 additions & 30 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,22 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
30-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
30+
python-version: ['3.8', '3.9', '3.10', '3.11']
3131

3232
steps:
3333
- uses: actions/checkout@v3
34-
- uses: conda-incubator/setup-miniconda@v2.2.0
34+
- uses: mamba-org/setup-micromamba@v1
3535
with:
36-
auto-update-conda: false
37-
python-version: ${{ matrix.python-version }}
38-
channels: conda-forge,nodefaults
39-
miniforge-variant: Mambaforge
40-
41-
- name: Install core dependencies.
42-
shell: bash -l {0}
43-
run: mamba install -c conda-forge tox-conda coverage
36+
environment-name: gha-testing
37+
condarc: |
38+
channels:
39+
- nodefaults
40+
- conda-forge
41+
create-args: >-
42+
python=${{ matrix.python-version }}
43+
mamba
44+
tox-conda
45+
cache-environment: true
4446

4547
# Unit, integration, and end-to-end tests.
4648

@@ -49,7 +51,7 @@ jobs:
4951
run: tox -e pytest -- -m "unit or (not integration and not end_to_end)" --cov=src --cov=tests --cov-report=xml -n auto
5052

5153
- name: Upload coverage report for unit tests and doctests.
52-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
54+
if: runner.os == 'Linux' && matrix.python-version == '3.10'
5355
shell: bash -l {0}
5456
run: bash <(curl -s https://codecov.io/bash) -F unit -c
5557

@@ -58,7 +60,7 @@ jobs:
5860
run: tox -e pytest -- -m integration --cov=src --cov=tests --cov-report=xml -n auto
5961

6062
- name: Upload coverage reports of integration tests.
61-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
63+
if: runner.os == 'Linux' && matrix.python-version == '3.10'
6264
shell: bash -l {0}
6365
run: bash <(curl -s https://codecov.io/bash) -F integration -c
6466

@@ -67,6 +69,6 @@ jobs:
6769
run: tox -e pytest -- -m end_to_end --cov=src --cov=tests --cov-report=xml -n auto
6870

6971
- name: Upload coverage reports of end-to-end tests.
70-
if: runner.os == 'Linux' && matrix.python-version == '3.8'
72+
if: runner.os == 'Linux' && matrix.python-version == '3.10'
7173
shell: bash -l {0}
7274
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
rev: v3.9.0
3131
hooks:
3232
- id: reorder-python-imports
33-
args: [--py37-plus, --add-import, 'from __future__ import annotations']
33+
args: [--py38-plus, --add-import, 'from __future__ import annotations']
3434
- repo: https://github.com/asottile/setup-cfg-fmt
3535
rev: v2.3.0
3636
hooks:

docs/rtd_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- nodefaults
44

55
dependencies:
6-
- python >=3.7
6+
- python >=3.8
77
- pip
88
- setuptools_scm
99
- toml

docs/source/changes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask).
77

8-
## 0.3.2 - 2023-xx-xx
8+
## 0.4.0 - 2023-xx-xx
9+
10+
- {pull}`323` remove Python 3.7 support and use a new Github action to provide mamba.
11+
12+
## 0.3.2 - 2023-06-07
913

1014
- {pull}`345` updates the version numbers in animations.
1115
- {pull}`352` publishes `db` that is required by pytask-environment.

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
- nodefaults
66

77
dependencies:
8-
- python >=3.7
8+
- python >=3.8
99
- pip
1010
- setuptools_scm
1111
- toml

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ignore-words-list = "falsy, hist, ines, unparseable"
2929

3030

3131
[tool.ruff]
32-
target-version = "py37"
32+
target-version = "py38"
3333
select = ["ALL"]
3434
fix = true
3535
extend-ignore = [

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ install_requires =
4040
pybaum>=0.1.1
4141
rich
4242
tomli>=1.0.0
43-
python_requires = >=3.7
43+
python_requires = >=3.8
4444
include_package_data = True
4545
package_dir =
4646
=src

src/_pytask/capture.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from tempfile import TemporaryFile
3535
from typing import Any
3636
from typing import AnyStr
37+
from typing import final
3738
from typing import Generator
3839
from typing import Generic
3940
from typing import Iterator
@@ -46,14 +47,6 @@
4647
from _pytask.nodes import Task
4748

4849

49-
if sys.version_info >= (3, 8):
50-
from typing import final
51-
else:
52-
53-
def final(f: Any) -> Any:
54-
return f
55-
56-
5750
class _CaptureMethod(enum.Enum):
5851
FD = "fd"
5952
NO = "no"

src/_pytask/nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def state(self) -> str | None:
9898
return None
9999

100100
@classmethod
101-
@functools.lru_cache()
101+
@functools.lru_cache
102102
def from_path(cls, path: Path) -> FilePathNode:
103103
"""Instantiate class from path to file.
104104

src/_pytask/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def find_common_ancestor(*paths: str | Path) -> Path:
100100
return common_ancestor
101101

102102

103-
@functools.lru_cache()
103+
@functools.lru_cache
104104
def find_case_sensitive_path(path: Path, platform: str) -> Path:
105105
"""Find the case-sensitive path.
106106

0 commit comments

Comments
 (0)