Skip to content

Commit d4f4c71

Browse files
authored
Bug/564 remove overlapping nox target (#565)
* Replace nox test:unit with the from exasol-toolbox * Remove unused import from noxfile.py associated with full_matrix * Remove unused imports from noxfile.py * Remove unused _documentation imports * Remove _python_files as handled in exasol-toolbox * Remove no longer used scripts/git_helpers.py * Remove unneeded imports from version_check - In future, can remove version_check when nox task
1 parent efd68f8 commit d4f4c71

File tree

3 files changed

+13
-73
lines changed

3 files changed

+13
-73
lines changed

doc/changes/unreleased.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
## 🧰 Internal
99

1010
- #548: Replaced pytest-exasol-itde with pytest-backend
11+
- #564: Replaced nox test:unit with that from exasol-toolbox
1112

noxfile.py

+12-58
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import annotations
22

33
import argparse
4+
import logging
45
import sys
5-
import webbrowser
66
from argparse import ArgumentParser
77
from pathlib import Path
8-
from shutil import rmtree
98
from tempfile import TemporaryDirectory
109

1110
# fmt: off
@@ -17,20 +16,10 @@
1716
sys.path.append(f"{SCRIPTS}")
1817
# fmt: on
1918

20-
from typing import Iterator
2119

2220
import nox
23-
from git_helpers import tags
24-
from links import check as _check
25-
from links import documentation as _documentation
26-
from links import urls as _urls
2721
from nox import Session
2822
from nox.sessions import SessionRunner
29-
from version_check import (
30-
version_from_poetry,
31-
version_from_python_module,
32-
version_from_string,
33-
)
3423

3524
from exasol.odbc import (
3625
ODBC_DRIVER,
@@ -39,12 +28,20 @@
3928

4029
# imports all nox task provided by the toolbox
4130
from exasol.toolbox.nox.tasks import * # type: ignore
31+
from scripts.links import check as _check
32+
from scripts.links import documentation as _documentation
33+
from scripts.links import urls as _urls
4234

4335
# default actions to be run if nothing is explicitly specified with the -s option
4436
nox.options.sessions = ["project:fix"]
4537

4638

47-
from noxconfig import PROJECT_CONFIG
39+
from noxconfig import (
40+
PROJECT_CONFIG,
41+
Config,
42+
)
43+
44+
_log = logging.getLogger(__name__)
4845

4946

5047
def find_session_runner(session: Session, name: str) -> SessionRunner:
@@ -55,13 +52,6 @@ def find_session_runner(session: Session, name: str) -> SessionRunner:
5552
session.error(f"Could not find a nox session by the name {name!r}")
5653

5754

58-
def _python_files(path: Path) -> Iterator[Path]:
59-
files = filter(lambda path: "dist" not in path.parts, PROJECT_ROOT.glob("**/*.py"))
60-
files = filter(lambda path: ".eggs" not in path.parts, files)
61-
files = filter(lambda path: "venv" not in path.parts, files)
62-
return files
63-
64-
6555
@nox.session(name="db:start", python=False)
6656
def start_db(session: Session) -> None:
6757
"""Start a test database. For more details append '-- -h'"""
@@ -158,16 +148,6 @@ def parser() -> ArgumentParser:
158148
)
159149

160150

161-
@nox.session(name="test:unit", python=False)
162-
def unit_tests(session: Session) -> None:
163-
"""Run the unit tests"""
164-
session.run(
165-
"pytest",
166-
f"{PROJECT_ROOT / 'test' / 'unit'}",
167-
external=True,
168-
)
169-
170-
171151
@nox.session(name="test:exasol", python=False)
172152
def exasol_tests(session: Session) -> None:
173153
"""Run the integration tests with a specific connector. For more details append '-- -h'"""
@@ -294,17 +274,6 @@ def report_skipped(session: Session) -> None:
294274
)
295275

296276

297-
# fmt: off
298-
from exasol.toolbox.nox._documentation import (
299-
build_docs,
300-
build_multiversion,
301-
clean_docs,
302-
open_docs,
303-
)
304-
305-
# fmt: on
306-
307-
308277
@nox.session(name="docs:links", python=False)
309278
def list_links(session: Session) -> None:
310279
"""List all the links within the documentation."""
@@ -328,17 +297,8 @@ def check_links(session: Session) -> None:
328297
)
329298

330299

331-
# fmt: off
332-
from exasol.toolbox.nox._documentation import (
333-
build_docs,
334-
build_multiversion,
335-
clean_docs,
336-
open_docs,
337-
)
338-
339-
340300
def _connector_matrix(config: Config):
341-
CONNECTORS = ['websocket']
301+
CONNECTORS = ["websocket"]
342302
attr = "connectors"
343303
connectors = getattr(config, attr, CONNECTORS)
344304
if not hasattr(config, attr):
@@ -349,11 +309,6 @@ def _connector_matrix(config: Config):
349309
)
350310
return {"connector": connectors}
351311

352-
from exasol.toolbox.nox._ci import (
353-
exasol_matrix,
354-
python_matrix,
355-
)
356-
357312

358313
@nox.session(name="matrix:all", python=False)
359314
def full_matrix(session: Session) -> None:
@@ -364,9 +319,8 @@ def full_matrix(session: Session) -> None:
364319
_exasol_matrix,
365320
_python_matrix,
366321
)
322+
367323
matrix = _python_matrix(PROJECT_CONFIG)
368324
matrix.update(_exasol_matrix(PROJECT_CONFIG))
369325
matrix.update(_connector_matrix(PROJECT_CONFIG))
370326
print(json.dumps(matrix))
371-
372-
# fmt: on

scripts/git_helpers.py

-15
This file was deleted.

0 commit comments

Comments
 (0)