Skip to content

Add support for python 3.13 and drop 3.8 #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ jobs:
matrix:
os:
- ubuntu-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy3.9, pypy3.10]
python-version:
["3.9", "3.10", "3.11", "3.12", "3.13", pypy3.9, pypy3.10]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install tox tox-gh-actions

- name: Test with tox
run: tox
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install dependencies
run: pip install tox tox-gh-actions

- name: Test with tox
run: tox
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

- Drop support for Python 3.8
- Add support for python 3.13
- Enhance `dotenv run`, switch to `execvpe` for better resource management and signal handling ([#523]) by [@eekstunt]

## [1.0.1] - 2024-01-23

**Fixed**

* Gracefully handle code which has been imported from a zipfile ([#456] by [@samwyma])
* Allow modules using load_dotenv to be reloaded when launched in a separate thread ([#497] by [@freddyaboulton])
* Allow modules using `load_dotenv` to be reloaded when launched in a separate thread ([#497] by [@freddyaboulton])
* Fix file not closed after deletion, handle error in the rewrite function ([#469] by [@Qwerty-133])

**Misc**
Expand Down Expand Up @@ -317,7 +324,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.5.1

- Fix find\_dotenv - it now start search from the file where this
- Fix `find_dotenv` - it now start search from the file where this
function is called from.

## 0.5.0
Expand Down Expand Up @@ -346,6 +353,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
[#466]: https://github.com/theskumar/python-dotenv/issues/466
[#454]: https://github.com/theskumar/python-dotenv/issues/454
[#474]: https://github.com/theskumar/python-dotenv/issues/474
[#523]: https://github.com/theskumar/python-dotenv/issues/523

[@alanjds]: https://github.com/alanjds
[@altendky]: https://github.com/altendky
Expand All @@ -356,6 +364,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
[@cjauvin]: https://github.com/cjauvin
[@eaf]: https://github.com/eaf
[@earlbread]: https://github.com/earlbread
[@eekstunt]: https://github.com/eekstunt
[@eggplants]: https://github.com/@eggplants
[@ekohl]: https://github.com/ekohl
[@elbehery95]: https://github.com/elbehery95
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.0
current_version = 1.0.1
commit = True
tag = True

Expand All @@ -24,14 +24,14 @@ relative_files = True
source = dotenv

[coverage:paths]
source =
source =
src/dotenv
.tox/*/lib/python*/site-packages/dotenv
.tox/pypy*/site-packages/dotenv

[coverage:report]
show_missing = True
include = */site-packages/dotenv/*
exclude_lines =
exclude_lines =
if IS_TYPE_CHECKING:
pragma: no cover
70 changes: 39 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,68 @@
def read_files(files):
data = []
for file in files:
with open(file, encoding='utf-8') as f:
with open(file, encoding="utf-8") as f:
data.append(f.read())
return "\n".join(data)


long_description = read_files(['README.md', 'CHANGELOG.md'])
long_description = read_files(["README.md", "CHANGELOG.md"])

meta = {}
with open('./src/dotenv/version.py', encoding='utf-8') as f:
with open("./src/dotenv/version.py", encoding="utf-8") as f:
exec(f.read(), meta)

setup(
name="python-dotenv",
description="Read key-value pairs from a .env file and set them as environment variables",
long_description=long_description,
long_description_content_type='text/markdown',
version=meta['__version__'],
long_description_content_type="text/markdown",
version=meta["__version__"],
author="Saurabh Kumar",
author_email="[email protected]",
url="https://github.com/theskumar/python-dotenv",
keywords=['environment variables', 'deployments', 'settings', 'env', 'dotenv',
'configurations', 'python'],
packages=['dotenv'],
package_dir={'': 'src'},
keywords=[
"environment variables",
"deployments",
"settings",
"env",
"dotenv",
"configurations",
"python",
],
packages=["dotenv"],
package_dir={"": "src"},
package_data={
'dotenv': ['py.typed'],
"dotenv": ["py.typed"],
},
python_requires=">=3.8",
python_requires=">=3.9",
extras_require={
'cli': ['click>=5.0', ],
"cli": [
"click>=5.0",
],
},
entry_points={
"console_scripts": [
"dotenv=dotenv.__main__:cli",
],
},
license='BSD-3-Clause',
license="BSD-3-Clause",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: PyPy',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Topic :: System :: Systems Administration',
'Topic :: Utilities',
'Environment :: Web Environment',
]
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: PyPy",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
"Environment :: Web Environment",
],
)
40 changes: 20 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[tox]
envlist = lint,py{38,39,310,311,312-dev},pypy3,manifest,coverage-report
envlist = lint,py{39,310,311,312,313},pypy3,manifest,coverage-report

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311, lint, manifest
3.12-dev: py312-dev
3.11: py311
3.12: py312
3.13: py313, lint, manifest
pypy-3.9: pypy3

[testenv]
deps =
pytest
pytest-cov
sh >= 2.0.2, <3
click
py{38,39,310,311,py312-dev,pypy3}: ipython
pytest
pytest-cov
sh >= 2.0.2, <3
click
py{39,310,311,312,313,pypy3}: ipython
commands = pytest --cov --cov-report=term-missing --cov-config setup.cfg {posargs}
depends =
py{38,39,310,311,312-dev},pypy3: coverage-clean
coverage-report: py{38,39,310,311,312-dev},pypy3
py{39,310,311,312,313},pypy3: coverage-clean
coverage-report: py{39,310,311,312,313},pypy3

[testenv:lint]
skip_install = true
deps =
flake8
mypy
flake8
mypy
commands =
flake8 src tests
mypy --python-version=3.12 src tests
mypy --python-version=3.11 src tests
mypy --python-version=3.10 src tests
mypy --python-version=3.9 src tests
mypy --python-version=3.8 src tests
flake8 src tests
mypy --python-version=3.13 src tests
mypy --python-version=3.12 src tests
mypy --python-version=3.11 src tests
mypy --python-version=3.10 src tests
mypy --python-version=3.9 src tests

[testenv:manifest]
deps = check-manifest
Expand All @@ -49,4 +49,4 @@ commands = coverage erase
deps = coverage
skip_install = true
commands =
coverage report
coverage report