-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnoxfile.py
49 lines (36 loc) · 1.19 KB
/
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
46
47
48
49
import pathlib
import shutil
import os
import nox
ON_GITHUB = "GITHUB_ACTIONS" in os.environ
PY_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
@nox.session(python=PY_VERSIONS, reuse_venv=not ON_GITHUB)
def tests(session: nox.Session) -> None:
"""
Ensure we test our code.
"""
session.install("-e", ".[dev]")
session.run("ward", "test", "--test-output-style=dots-global", "--order=standard")
@nox.session(reuse_venv=not ON_GITHUB)
def black(session: nox.Session) -> None:
"""
Lint.
"""
session.run("black", ".", "--config", "pyproject.toml")
@nox.session(reuse_venv=not ON_GITHUB)
def mypy(session: nox.Session) -> None:
"""
Lint.
"""
session.run("mypy", "./src/thoughtspot_tml")
# session.run("mypy", "--install-types")
@nox.session(reuse_venv=not ON_GITHUB)
def build(session: nox.Session) -> None:
"""
Deploy.
"""
package_dir = pathlib.Path(__package__).resolve()
session.run("python", package_dir.joinpath("setup.py").as_posix(), "sdist", "bdist_wheel")
# session.run("twine", "upload", "-r", "pypi", package_dir.joinpath("build").as_posix())
shutil.rmtree(package_dir / "build")
shutil.rmtree(package_dir / "dist")