Skip to content

Commit 0611643

Browse files
authored
Drop support for python 3.7, add python 3.12-dev (#449)
* fixes for sh 2.* * Drop support for python 3.7 * Add python 3.12 alpha
1 parent 87e5527 commit 0611643

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
os:
1313
- ubuntu-latest
14-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy3.9]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev", pypy3.9]
1515

1616
steps:
1717
- uses: actions/checkout@v3

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ flake8>=2.2.3
55
ipython
66
pytest-cov
77
pytest>=3.9
8-
sh>=1.09
8+
sh>=2
99
tox
1010
twine
1111
wheel

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def read_files(files):
3131
package_data={
3232
'dotenv': ['py.typed'],
3333
},
34-
python_requires=">=3.7",
34+
python_requires=">=3.8",
3535
extras_require={
3636
'cli': ['click>=5.0', ],
3737
},
@@ -45,11 +45,11 @@ def read_files(files):
4545
'Development Status :: 5 - Production/Stable',
4646
'Programming Language :: Python',
4747
'Programming Language :: Python :: 3',
48-
'Programming Language :: Python :: 3.7',
4948
'Programming Language :: Python :: 3.8',
5049
'Programming Language :: Python :: 3.9',
5150
'Programming Language :: Python :: 3.10',
5251
'Programming Language :: Python :: 3.11',
52+
'Programming Language :: Python :: 3.12',
5353
'Programming Language :: Python :: Implementation :: PyPy',
5454
'Intended Audience :: Developers',
5555
'Intended Audience :: System Administrators',

tests/test_cli.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -153,61 +153,61 @@ def test_set_no_file(cli):
153153

154154

155155
def test_get_default_path(tmp_path):
156-
sh.cd(str(tmp_path))
157-
with open(str(tmp_path / ".env"), "w") as f:
158-
f.write("a=b")
156+
with sh.pushd(str(tmp_path)):
157+
with open(str(tmp_path / ".env"), "w") as f:
158+
f.write("a=b")
159159

160-
result = sh.dotenv("get", "a")
160+
result = sh.dotenv("get", "a")
161161

162-
assert result == "b\n"
162+
assert result == "b\n"
163163

164164

165165
def test_run(tmp_path):
166-
sh.cd(str(tmp_path))
167-
dotenv_file = str(tmp_path / ".env")
168-
with open(dotenv_file, "w") as f:
169-
f.write("a=b")
166+
with sh.pushd(str(tmp_path)):
167+
dotenv_file = str(tmp_path / ".env")
168+
with open(dotenv_file, "w") as f:
169+
f.write("a=b")
170170

171-
result = sh.dotenv("run", "printenv", "a")
171+
result = sh.dotenv("run", "printenv", "a")
172172

173-
assert result == "b\n"
173+
assert result == "b\n"
174174

175175

176176
def test_run_with_existing_variable(tmp_path):
177-
sh.cd(str(tmp_path))
178-
dotenv_file = str(tmp_path / ".env")
179-
with open(dotenv_file, "w") as f:
180-
f.write("a=b")
181-
env = dict(os.environ)
182-
env.update({"LANG": "en_US.UTF-8", "a": "c"})
177+
with sh.pushd(str(tmp_path)):
178+
dotenv_file = str(tmp_path / ".env")
179+
with open(dotenv_file, "w") as f:
180+
f.write("a=b")
181+
env = dict(os.environ)
182+
env.update({"LANG": "en_US.UTF-8", "a": "c"})
183183

184-
result = sh.dotenv("run", "printenv", "a", _env=env)
184+
result = sh.dotenv("run", "printenv", "a", _env=env)
185185

186-
assert result == "b\n"
186+
assert result == "b\n"
187187

188188

189189
def test_run_with_existing_variable_not_overridden(tmp_path):
190-
sh.cd(str(tmp_path))
191-
dotenv_file = str(tmp_path / ".env")
192-
with open(dotenv_file, "w") as f:
193-
f.write("a=b")
194-
env = dict(os.environ)
195-
env.update({"LANG": "en_US.UTF-8", "a": "c"})
190+
with sh.pushd(str(tmp_path)):
191+
dotenv_file = str(tmp_path / ".env")
192+
with open(dotenv_file, "w") as f:
193+
f.write("a=b")
194+
env = dict(os.environ)
195+
env.update({"LANG": "en_US.UTF-8", "a": "c"})
196196

197-
result = sh.dotenv("run", "--no-override", "printenv", "a", _env=env)
197+
result = sh.dotenv("run", "--no-override", "printenv", "a", _env=env)
198198

199-
assert result == "c\n"
199+
assert result == "c\n"
200200

201201

202202
def test_run_with_none_value(tmp_path):
203-
sh.cd(str(tmp_path))
204-
dotenv_file = str(tmp_path / ".env")
205-
with open(dotenv_file, "w") as f:
206-
f.write("a=b\nc")
203+
with sh.pushd(str(tmp_path)):
204+
dotenv_file = str(tmp_path / ".env")
205+
with open(dotenv_file, "w") as f:
206+
f.write("a=b\nc")
207207

208-
result = sh.dotenv("run", "printenv", "a")
208+
result = sh.dotenv("run", "printenv", "a")
209209

210-
assert result == "b\n"
210+
assert result == "b\n"
211211

212212

213213
def test_run_with_other_env(dotenv_file):

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
[tox]
2-
envlist = lint,py{37,38,39,310,311},pypy3,manifest,coverage-report
2+
envlist = lint,py{38,39,310,311,312-dev},pypy3,manifest,coverage-report
33

44
[gh-actions]
55
python =
6-
3.7: py37
76
3.8: py38
87
3.9: py39
98
3.10: py310
109
3.11: py311, lint, manifest
10+
3.12-dev: py312-dev
1111
pypy-3.9: pypy3
1212

1313
[testenv]
1414
deps =
1515
pytest
1616
pytest-cov
17-
sh
17+
sh >= 2.0.2, <3
1818
click
19-
py{37,38,39,310,311,pypy3}: ipython
19+
py{38,39,310,311,py312-dev,pypy3}: ipython
2020
commands = pytest --cov --cov-report=term-missing --cov-config setup.cfg {posargs}
2121
depends =
22-
py{37,38,39,310,311},pypy3: coverage-clean
23-
coverage-report: py{35,36,37,38,39,310,311},pypy3
22+
py{38,39,310,311,312-dev},pypy3: coverage-clean
23+
coverage-report: py{38,39,310,311,312-dev},pypy3
2424

2525
[testenv:lint]
2626
skip_install = true
@@ -29,11 +29,11 @@ deps =
2929
mypy
3030
commands =
3131
flake8 src tests
32+
mypy --python-version=3.12 src tests
3233
mypy --python-version=3.11 src tests
3334
mypy --python-version=3.10 src tests
3435
mypy --python-version=3.9 src tests
3536
mypy --python-version=3.8 src tests
36-
mypy --python-version=3.7 src tests
3737

3838
[testenv:manifest]
3939
deps = check-manifest

0 commit comments

Comments
 (0)