Skip to content

Commit 76999e7

Browse files
committed
Move more config pyproject.toml
1 parent 222ce2c commit 76999e7

File tree

6 files changed

+58
-42
lines changed

6 files changed

+58
-42
lines changed

.bumpversion.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[bumpversion]
2+
current_version = 1.2.0
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:src/dotenv/version.py]

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: clean-pyc clean-build test
1+
.PHONY: clean-pyc clean-build test fmt
22

33
clean: clean-build clean-pyc
44

@@ -21,6 +21,9 @@ test:
2121
ruff check .
2222
pytest tests/
2323

24+
fmt:
25+
ruff format src tests
26+
2427
coverage:
2528
coverage run --source=dotenv --omit='*tests*' -m py.test tests/ -v --tb=native
2629
coverage report

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,31 @@ package-data = {dotenv = ["py.typed"]}
5959
[tool.setuptools.dynamic]
6060
version = {attr = "dotenv.version.__version__"}
6161
readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"}
62+
63+
[tool.pytest.ini_options]
64+
testpaths = [
65+
"tests",
66+
]
67+
68+
[tool.coverage.run]
69+
relative_files = true
70+
source = ["dotenv"]
71+
72+
[tool.coverage.paths]
73+
source = [
74+
"src/dotenv",
75+
".tox/*/lib/python*/site-packages/dotenv",
76+
".tox/pypy*/site-packages/dotenv",
77+
]
78+
79+
[tool.coverage.report]
80+
show_missing = true
81+
include = ["*/site-packages/dotenv/*"]
82+
exclude_lines = [
83+
"if IS_TYPE_CHECKING:",
84+
"pragma: no cover",
85+
]
86+
87+
[tool.mypy]
88+
check_untyped_defs = true
89+
ignore_missing_imports = true

setup.cfg

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/test_main.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ def test_load_dotenv_existing_file(dotenv_path):
263263
)
264264
def test_load_dotenv_disabled(dotenv_path, flag_value):
265265
expected_environ = {"PYTHON_DOTENV_DISABLED": flag_value}
266-
with mock.patch.dict(os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True):
266+
with mock.patch.dict(
267+
os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True
268+
):
267269
dotenv_path.write_text("a=b")
268270

269271
result = dotenv.load_dotenv(dotenv_path)
@@ -289,7 +291,9 @@ def test_load_dotenv_disabled(dotenv_path, flag_value):
289291
],
290292
)
291293
def test_load_dotenv_disabled_notification(dotenv_path, flag_value):
292-
with mock.patch.dict(os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True):
294+
with mock.patch.dict(
295+
os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True
296+
):
293297
dotenv_path.write_text("a=b")
294298

295299
logger = logging.getLogger("dotenv.main")
@@ -298,7 +302,7 @@ def test_load_dotenv_disabled_notification(dotenv_path, flag_value):
298302

299303
assert result is False
300304
mock_debug.assert_called_once_with(
301-
"python-dotenv: .env loading disabled by PYTHON_DOTENV_DISABLED environment variable"
305+
"python-dotenv: .env loading disabled by PYTHON_DOTENV_DISABLED environment variable"
302306
)
303307

304308

@@ -321,7 +325,9 @@ def test_load_dotenv_disabled_notification(dotenv_path, flag_value):
321325
)
322326
def test_load_dotenv_enabled(dotenv_path, flag_value):
323327
expected_environ = {"PYTHON_DOTENV_DISABLED": flag_value, "a": "b"}
324-
with mock.patch.dict(os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True):
328+
with mock.patch.dict(
329+
os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True
330+
):
325331
dotenv_path.write_text("a=b")
326332

327333
result = dotenv.load_dotenv(dotenv_path)
@@ -348,7 +354,9 @@ def test_load_dotenv_enabled(dotenv_path, flag_value):
348354
],
349355
)
350356
def test_load_dotenv_enabled_no_notification(dotenv_path, flag_value):
351-
with mock.patch.dict(os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True):
357+
with mock.patch.dict(
358+
os.environ, {"PYTHON_DOTENV_DISABLED": flag_value}, clear=True
359+
):
352360
dotenv_path.write_text("a=b")
353361

354362
logger = logging.getLogger("dotenv.main")

tox.ini

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ deps =
2929
ruff
3030
mypy
3131
commands =
32-
ruff check src
33-
ruff check tests
32+
ruff check src tests
33+
ruff format --check src tests
3434
mypy --python-version=3.14 src tests
3535
mypy --python-version=3.13 src tests
3636
mypy --python-version=3.12 src tests
3737
mypy --python-version=3.11 src tests
3838
mypy --python-version=3.10 src tests
3939
mypy --python-version=3.9 src tests
4040

41+
[testenv:format]
42+
skip_install = true
43+
deps = ruff
44+
commands = ruff format src tests
45+
4146
[testenv:manifest]
4247
deps = check-manifest
4348
skip_install = true

0 commit comments

Comments
 (0)