4
4
import nox
5
5
from nox .sessions import Session
6
6
7
- PYTHON_VERSIONS = ("3.8" , "3.7" , "3.6" )
7
+ PYTHON_VERSIONS = ("3.8" , "3.7" )
8
8
LOCATIONS = ("noxfile.py" , "tests" , "sockit" )
9
9
10
10
nox .options .sessions = ("lint" , "mypy" , "pytype" , "tests" )
11
11
12
12
13
13
def install_with_constraints (
14
- session : Session , * args : str , ** kwargs : Any
14
+ session : Session , * args : str , ** kwargs : Any # noqa: ANN401
15
15
) -> None :
16
16
with tempfile .NamedTemporaryFile () as requirements :
17
17
session .run (
18
18
"poetry" ,
19
19
"export" ,
20
- "--dev" ,
21
- "--format=requirements.txt" ,
20
+ "--with" ,
21
+ "dev" ,
22
+ "--without-hashes" ,
23
+ "--format=constraints.txt" ,
22
24
f"--output={ requirements .name } " ,
23
25
external = True ,
24
26
)
@@ -28,7 +30,7 @@ def install_with_constraints(
28
30
@nox .session (python = PYTHON_VERSIONS )
29
31
def tests (session : Session ) -> None :
30
32
args = session .posargs or ["--cov" ]
31
- session .run ("poetry" , "install" , "--no-dev " , external = True )
33
+ session .run ("poetry" , "install" , "--only" , "main " , external = True )
32
34
install_with_constraints (session , "coverage[toml]" , "pytest" , "pytest-cov" )
33
35
session .run ("pytest" , * args )
34
36
0 commit comments