-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathnoxfile.py
41 lines (35 loc) · 1.12 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
"""
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
"""
# type: ignore
import nox
def install_torch_packages(session):
session.install(
"-f",
"https://pytorch-geometric.com/whl/torch-1.4.0.html",
"-f",
"https://download.pytorch.org/whl/torch_stable.html",
"-r",
"requirements/torch.txt",
)
@nox.session()
def lint(session):
session.install("--upgrade", "setuptools", "pip")
install_torch_packages(session)
session.install("-r", "requirements/base.txt")
session.install("-r", "requirements/dev.txt")
session.run("flake8", "graphlog")
session.run("black", "--check", "graphlog")
session.run("mypy", "--strict", "graphlog")
@nox.session()
def test(session) -> None:
session.install("--upgrade", "setuptools", "pip")
install_torch_packages(session)
session.install("-r", "requirements/base.txt")
session.install("-r", "requirements/dev.txt")
session.run("python", "-m", "pytest", "tests")