-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
50 lines (35 loc) · 1.6 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
50
from typing import List
import nox
import nox_poetry
LATEST = "@latest"
def with_python_versions(python_versions: List[str], st_version: str):
return [(python_version, st_version) for python_version in python_versions]
PYTHON_ST_TQDM_VERSIONS = (
with_python_versions(["3.7", "3.8", "3.9"], "==0.65.*")
+ with_python_versions(["3.7", "3.8", "3.9"], "==1.2.*")
+ with_python_versions(["3.7", "3.8", "3.9"], "==1.3.*")
+ with_python_versions(["3.7", "3.8", "3.9"], "==1.4.*")
+ with_python_versions(["3.8", "3.9", "3.10"], "==1.8.*")
+ with_python_versions(["3.9", "3.10"], LATEST)
)
@nox_poetry.session
@nox.parametrize(["python", "streamlit_version"], PYTHON_ST_TQDM_VERSIONS)
def tests(session: nox_poetry.Session, streamlit_version):
dependencies_to_install_with_pip: List[str] = [
name if version == LATEST else name + version for name, version in [("streamlit", streamlit_version)]
]
session.install("pytest", "pytest-cov", ".")
session.run("pip", "install", "-U", *dependencies_to_install_with_pip)
session.run("pytest", "--cov-fail-under=15", "--cov=st_compat", "--cov-report=xml:codecov.xml")
@nox_poetry.session(python=None)
def isort(session: nox.Session):
session.install("isort")
session.run("isort", ".", "--check")
@nox_poetry.session(python=None)
def black(session: nox.Session):
session.install("black")
session.run("black", ".", "--check")
@nox_poetry.session(python=None)
def lint(session: nox.Session):
session.install("pylint", "nox", "nox_poetry", "tqdm", "streamlit")
session.run("pylint", "st_compat", "tests", "noxfile.py")