1
1
from __future__ import annotations
2
2
3
3
import argparse
4
+ import logging
4
5
import sys
5
- import webbrowser
6
6
from argparse import ArgumentParser
7
7
from pathlib import Path
8
- from shutil import rmtree
9
8
from tempfile import TemporaryDirectory
10
9
11
10
# fmt: off
17
16
sys .path .append (f"{ SCRIPTS } " )
18
17
# fmt: on
19
18
20
- from typing import Iterator
21
19
22
20
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
27
21
from nox import Session
28
22
from nox .sessions import SessionRunner
29
- from version_check import (
30
- version_from_poetry ,
31
- version_from_python_module ,
32
- version_from_string ,
33
- )
34
23
35
24
from exasol .odbc import (
36
25
ODBC_DRIVER ,
39
28
40
29
# imports all nox task provided by the toolbox
41
30
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
42
34
43
35
# default actions to be run if nothing is explicitly specified with the -s option
44
36
nox .options .sessions = ["project:fix" ]
45
37
46
38
47
- from noxconfig import PROJECT_CONFIG
39
+ from noxconfig import (
40
+ PROJECT_CONFIG ,
41
+ Config ,
42
+ )
43
+
44
+ _log = logging .getLogger (__name__ )
48
45
49
46
50
47
def find_session_runner (session : Session , name : str ) -> SessionRunner :
@@ -55,13 +52,6 @@ def find_session_runner(session: Session, name: str) -> SessionRunner:
55
52
session .error (f"Could not find a nox session by the name { name !r} " )
56
53
57
54
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
-
65
55
@nox .session (name = "db:start" , python = False )
66
56
def start_db (session : Session ) -> None :
67
57
"""Start a test database. For more details append '-- -h'"""
@@ -158,16 +148,6 @@ def parser() -> ArgumentParser:
158
148
)
159
149
160
150
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
-
171
151
@nox .session (name = "test:exasol" , python = False )
172
152
def exasol_tests (session : Session ) -> None :
173
153
"""Run the integration tests with a specific connector. For more details append '-- -h'"""
@@ -294,17 +274,6 @@ def report_skipped(session: Session) -> None:
294
274
)
295
275
296
276
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
-
308
277
@nox .session (name = "docs:links" , python = False )
309
278
def list_links (session : Session ) -> None :
310
279
"""List all the links within the documentation."""
@@ -328,17 +297,8 @@ def check_links(session: Session) -> None:
328
297
)
329
298
330
299
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
-
340
300
def _connector_matrix (config : Config ):
341
- CONNECTORS = [' websocket' ]
301
+ CONNECTORS = [" websocket" ]
342
302
attr = "connectors"
343
303
connectors = getattr (config , attr , CONNECTORS )
344
304
if not hasattr (config , attr ):
@@ -349,11 +309,6 @@ def _connector_matrix(config: Config):
349
309
)
350
310
return {"connector" : connectors }
351
311
352
- from exasol .toolbox .nox ._ci import (
353
- exasol_matrix ,
354
- python_matrix ,
355
- )
356
-
357
312
358
313
@nox .session (name = "matrix:all" , python = False )
359
314
def full_matrix (session : Session ) -> None :
@@ -364,9 +319,8 @@ def full_matrix(session: Session) -> None:
364
319
_exasol_matrix ,
365
320
_python_matrix ,
366
321
)
322
+
367
323
matrix = _python_matrix (PROJECT_CONFIG )
368
324
matrix .update (_exasol_matrix (PROJECT_CONFIG ))
369
325
matrix .update (_connector_matrix (PROJECT_CONFIG ))
370
326
print (json .dumps (matrix ))
371
-
372
- # fmt: on
0 commit comments