Skip to content

Commit 2f36c08

Browse files
eggplantstheskumar
andauthored
Drop Python 3.5 and 3.6 and upgrade GA (#393)
* Drop Python 3.5 and 3.6 * Tox and GitHub Actions upgrade * Fix pypy version Co-authored-by: Saurabh Kumar <theskumar@users.noreply.github.com>
1 parent a50a3bf commit 2f36c08

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
matrix:
1111
os:
1212
- ubuntu-latest
13-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11.0-alpha - 3.11", pypy3]
13+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0-beta.4 - 3.11", pypy3.9]
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020
- name: Install dependencies
21-
run: |
21+
run:
2222
python -m pip install --upgrade pip
2323
pip install tox tox-gh-actions
2424
- name: Test with tox

setup.py

Lines changed: 1 addition & 3 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.5",
34+
python_requires=">=3.7",
3535
extras_require={
3636
'cli': ['click>=5.0', ],
3737
},
@@ -45,8 +45,6 @@ def read_files(files):
4545
'Development Status :: 5 - Production/Stable',
4646
'Programming Language :: Python',
4747
'Programming Language :: Python :: 3',
48-
'Programming Language :: Python :: 3.5',
49-
'Programming Language :: Python :: 3.6',
5048
'Programming Language :: Python :: 3.7',
5149
'Programming Language :: Python :: 3.8',
5250
'Programming Language :: Python :: 3.9',

src/dotenv/main.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414

1515
logger = logging.getLogger(__name__)
1616

17-
if sys.version_info >= (3, 6):
18-
_PathLike = os.PathLike
19-
else:
20-
_PathLike = str
21-
2217

2318
def with_warn_for_invalid_lines(mappings: Iterator[Binding]) -> Iterator[Binding]:
2419
for mapping in mappings:
@@ -33,14 +28,14 @@ def with_warn_for_invalid_lines(mappings: Iterator[Binding]) -> Iterator[Binding
3328
class DotEnv():
3429
def __init__(
3530
self,
36-
dotenv_path: Optional[Union[str, _PathLike]],
31+
dotenv_path: Optional[Union[str, os.PathLike]],
3732
stream: Optional[IO[str]] = None,
3833
verbose: bool = False,
3934
encoding: Union[None, str] = None,
4035
interpolate: bool = True,
4136
override: bool = True,
4237
) -> None:
43-
self.dotenv_path = dotenv_path # type: Optional[Union[str, _PathLike]]
38+
self.dotenv_path = dotenv_path # type: Optional[Union[str, os.PathLike]]
4439
self.stream = stream # type: Optional[IO[str]]
4540
self._dict = None # type: Optional[Dict[str, Optional[str]]]
4641
self.verbose = verbose # type: bool
@@ -113,7 +108,7 @@ def get(self, key: str) -> Optional[str]:
113108

114109

115110
def get_key(
116-
dotenv_path: Union[str, _PathLike],
111+
dotenv_path: Union[str, os.PathLike],
117112
key_to_get: str,
118113
encoding: Optional[str] = "utf-8",
119114
) -> Optional[str]:
@@ -127,7 +122,7 @@ def get_key(
127122

128123
@contextmanager
129124
def rewrite(
130-
path: Union[str, _PathLike],
125+
path: Union[str, os.PathLike],
131126
encoding: Optional[str],
132127
) -> Iterator[Tuple[IO[str], IO[str]]]:
133128
try:
@@ -146,7 +141,7 @@ def rewrite(
146141

147142

148143
def set_key(
149-
dotenv_path: Union[str, _PathLike],
144+
dotenv_path: Union[str, os.PathLike],
150145
key_to_set: str,
151146
value_to_set: str,
152147
quote_mode: str = "always",
@@ -195,7 +190,7 @@ def set_key(
195190

196191

197192
def unset_key(
198-
dotenv_path: Union[str, _PathLike],
193+
dotenv_path: Union[str, os.PathLike],
199194
key_to_unset: str,
200195
quote_mode: str = "always",
201196
encoding: Optional[str] = "utf-8",
@@ -310,7 +305,7 @@ def _is_interactive():
310305

311306

312307
def load_dotenv(
313-
dotenv_path: Union[str, _PathLike, None] = None,
308+
dotenv_path: Union[str, os.PathLike, None] = None,
314309
stream: Optional[IO[str]] = None,
315310
verbose: bool = False,
316311
override: bool = False,
@@ -348,7 +343,7 @@ def load_dotenv(
348343

349344

350345
def dotenv_values(
351-
dotenv_path: Union[str, _PathLike, None] = None,
346+
dotenv_path: Union[str, os.PathLike, None] = None,
352347
stream: Optional[IO[str]] = None,
353348
verbose: bool = False,
354349
interpolate: bool = True,

tox.ini

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ envlist = lint,py{35,36,37,38,39,310,311},pypy3,manifest,coverage-report
33

44
[gh-actions]
55
python =
6-
3.5: py35, coverage-report
7-
3.6: py36, coverage-report
86
3.7: py37, coverage-report
97
3.8: py38, coverage-report
108
3.9: py39, coverage-report
119
3.10: py310, lint, manifest, coverage-report
1210
3.11: py311, coverage-report
13-
pypy3: pypy3, coverage-report
11+
pypy-3.9: pypy3, coverage-report
1412

1513
[testenv]
1614
deps =
1715
pytest
1816
coverage
1917
sh
2018
click
21-
py{35,36,37,38,39,310,311,py3}: ipython
19+
py{37,38,39,310,311,py3}: ipython
2220
commands = coverage run --parallel -m pytest {posargs}
2321

2422
[testenv:lint]
@@ -33,8 +31,6 @@ commands =
3331
mypy --python-version=3.9 src tests
3432
mypy --python-version=3.8 src tests
3533
mypy --python-version=3.7 src tests
36-
mypy --python-version=3.6 src tests
37-
mypy --python-version=3.5 src tests
3834

3935
[testenv:manifest]
4036
deps = check-manifest

0 commit comments

Comments
 (0)