Skip to content

Commit a0215d9

Browse files
committed
Make names more explicit as just for python files
1 parent 097b817 commit a0215d9

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

exasol/toolbox/config.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ class BaseConfig(BaseModel):
4949
default=False,
5050
description="If true, creates also the major version tags (v*) automatically",
5151
)
52-
addition_to_excluded_paths: tuple[str, ...] = Field(
52+
add_to_excluded_python_paths: tuple[str, ...] = Field(
5353
default=(),
5454
description="""
55-
This is used to extend the default excluded_paths. If a more general path that
56-
would be seen in other projects, like .venv, needs to be added into this
57-
argument, please instead modify the
55+
This is used to extend the default excluded_python_paths. If a more general
56+
path that would be seen in other projects, like .venv, needs to be added into
57+
this argument, please instead modify the
5858
:meth:`exasol.toolbox.config.BaseConfig.excluded_paths` attribute.
5959
""",
6060
)
@@ -76,7 +76,7 @@ def minimum_python_version(self) -> str:
7676

7777
@computed_field
7878
@property
79-
def excluded_paths(self) -> tuple[str, ...]:
79+
def excluded_python_paths(self) -> tuple[str, ...]:
8080
"""
8181
There are certain nox sessions:
8282
- lint:code
@@ -96,7 +96,9 @@ def excluded_paths(self) -> tuple[str, ...]:
9696
".sonar",
9797
".html-documentation",
9898
}
99-
return tuple(default_excluded_paths.union(set(self.addition_to_excluded_paths)))
99+
return tuple(
100+
default_excluded_paths.union(set(self.add_to_excluded_python_paths))
101+
)
100102

101103
@computed_field # type: ignore[misc]
102104
@property

exasol/toolbox/nox/_shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ def python_files(project_root: Path) -> Iterable[str]:
4343
"""
4444
Returns iterable of python files after removing unwanted paths
4545
"""
46-
check_for_config_attribute(config=PROJECT_CONFIG, attribute="excluded_paths")
46+
check_for_config_attribute(config=PROJECT_CONFIG, attribute="excluded_python_paths")
4747
files = project_root.glob("**/*.py")
4848
return [
4949
f"{path}"
5050
for path in files
51-
if not set(path.parts).intersection(PROJECT_CONFIG.excluded_paths)
51+
if not set(path.parts).intersection(PROJECT_CONFIG.excluded_python_paths)
5252
]
5353

5454

noxconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Config(BaseConfig):
6060

6161

6262
PROJECT_CONFIG = Config(
63-
addition_to_excluded_paths=(
63+
add_to_excluded_python_paths=(
6464
# The cookiecutter placeholders do not work well with checks.
6565
# Instead, the format & linting are checked in the
6666
# ``test.integration.project-template``.

test/unit/nox/_shared_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def path_filter_directory():
2929

3030
@pytest.fixture(scope="session")
3131
def directories(package_directory, path_filter_directory):
32-
yield set(BaseConfig().excluded_paths).union(
32+
yield set(BaseConfig().excluded_python_paths).union(
3333
{package_directory, path_filter_directory}
3434
)
3535

@@ -51,7 +51,7 @@ def create_files(tmp_directory, directories):
5151
def test_python_files(
5252
tmp_directory, create_files, package_directory, path_filter_directory
5353
):
54-
config = BaseConfig(addition_to_excluded_paths=(path_filter_directory,))
54+
config = BaseConfig(add_to_excluded_python_paths=(path_filter_directory,))
5555

5656
with patch("exasol.toolbox.nox._shared.PROJECT_CONFIG", config):
5757
actual = python_files(tmp_directory)

0 commit comments

Comments
 (0)