-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnoxfile.py
45 lines (31 loc) · 1014 Bytes
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
from os import environ, name, path
import nox
def is_win() -> bool:
"""Determine if current operating system is windows
Returns:
True if on a windows machine; False otherwise
"""
return name == "nt"
nox.options.envdir = ".nox_win" if is_win() else ".nox"
IS_GITLAB_CI = "GITLAB_CI" in environ
PWD = path.abspath(path.dirname(__file__))
PKG_DIRPATH = path.join(PWD, "h5")
TESTS_DIRPATH = path.join(PWD, "tests")
VENV_BACKEND = None if is_win() else "conda"
REUSE_TEST_ENVS = True
@nox.session(venv_backend=VENV_BACKEND, reuse_venv=True)
def flake(session: nox.Session) -> None:
session.install("flake8")
session.install("flake8-print")
session.install("flake8-eradicate")
session.run("flake8", PKG_DIRPATH)
@nox.session(venv_backend=VENV_BACKEND, reuse_venv=True)
def pytest(session: nox.Session) -> None:
session.install("pytest")
session.run(
"pytest",
"-m",
"not optdeps",
TESTS_DIRPATH,
)