Skip to content

Commit 38782cb

Browse files
committed
docs: finish up source_dirs. bump to 7.8.0
1 parent 7aea2f3 commit 38782cb

File tree

7 files changed

+13
-15
lines changed

7 files changed

+13
-15
lines changed

CHANGES.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ upgrading your version of coverage.py.
2323
Unreleased
2424
----------
2525

26+
- Added a new ``source_dirs`` setting for symmetry with the existing
27+
``source_pkgs`` setting. It's preferable to the existing ``source`` setting,
28+
because you'll get a clear error when directories don't exist. Fixes `issue
29+
1942`_. Thanks, `Jeremy Fleischman <pull 1943_>`_.
30+
2631
- Fix: the PYTHONSAFEPATH environment variable new in Python 3.11 is properly
2732
supported, closing `issue 1696`_. Thanks, `Philipp A. <pull 1700_>`_. This
2833
works properly except for a detail when using the ``coverage`` command on
@@ -31,14 +36,8 @@ Unreleased
3136

3237
.. _issue 1696: https://github.com/nedbat/coveragepy/issues/1696
3338
.. _pull 1700: https://github.com/nedbat/coveragepy/pull/1700
34-
35-
- Added a new ``source_dirs`` setting for symmetry with the existing
36-
``source_pkgs`` setting. It's preferable to the existing ``source`` setting,
37-
because you'll get a clear error when directories don't exist. Fixes `issue
38-
1942`_.
39-
4039
.. _issue 1942: https://github.com/nedbat/coveragepy/issues/1942
41-
40+
.. _pull 1943: https://github.com/nedbat/coveragepy/pull/1943
4241

4342
.. start-releases
4443

CONTRIBUTORS.txt

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ James Valleroy
110110
Jan Kühle
111111
Jan Rusak
112112
Janakarajan Natarajan
113+
Jeremy Fleischman
113114
Jerin Peter George
114115
Jessamyn Smith
115116
Joanna Ejzel

coverage/control.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def __init__( # pylint: disable=too-many-arguments
240240
.. versionadded:: 7.7
241241
The `plugins` parameter.
242242
243-
.. versionadded:: ???
243+
.. versionadded:: 7.8
244244
The `source_dirs` parameter.
245245
"""
246246
# Start self.config as a usable default configuration. It will soon be

coverage/inorout.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ def __init__(
196196
# Canonicalize everything in `source_dirs`.
197197
# Also confirm that they actually are directories.
198198
for i, src in enumerate(self.source_dirs):
199-
self.source_dirs[i] = canonical_filename(src)
200-
201199
if not os.path.isdir(src):
202-
raise ConfigError(f"Source dir doesn't exist, or is not a directory: {src}")
203-
200+
raise ConfigError(f"Source dir is not a directory: {src!r}")
201+
self.source_dirs[i] = canonical_filename(src)
204202

205203
self.source_pkgs_unmatched = self.source_pkgs[:]
206204

coverage/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# version_info: same semantics as sys.version_info.
1010
# _dev: the .devN suffix if any.
11-
version_info = (7, 7, 2, "alpha", 0)
11+
version_info = (7, 8, 0, "alpha", 0)
1212
_dev = 1
1313

1414

doc/config.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ ambiguities between packages and directories.
485485
Operates the same as ``source``, but only names directories, for resolving
486486
ambiguities between packages and directories.
487487

488-
.. versionadded:: ???
488+
.. versionadded:: 7.8
489489

490490

491491
.. _config_run_timid:

tests/test_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ def test_source_dirs(self) -> None:
975975
def test_non_existent_source_dir(self) -> None:
976976
with pytest.raises(
977977
ConfigError,
978-
match=re.escape("Source dir doesn't exist, or is not a directory: i-do-not-exist"),
978+
match=re.escape("Source dir is not a directory: 'i-do-not-exist'"),
979979
):
980980
self.coverage_usepkgs_counts(source_dirs=["i-do-not-exist"])
981981

0 commit comments

Comments
 (0)