-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: initial nox and pylint support
- Loading branch information
Showing
4 changed files
with
204 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"severity": "warning", | ||
"pattern": [ | ||
{ | ||
"regexp": "^([^:]+):(\\d+):(\\d+): ([A-DF-Z]\\d+): \\033\\[[\\d;]+m([^\\033]+).*$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"code": 4, | ||
"message": 5 | ||
} | ||
], | ||
"owner": "pylint-warning" | ||
}, | ||
{ | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^([^:]+):(\\d+):(\\d+): (E\\d+): \\033\\[[\\d;]+m([^\\033]+).*$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"code": 4, | ||
"message": 5 | ||
} | ||
], | ||
"owner": "pylint-error" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import nox | ||
|
||
ALL_PYTHONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
nox.options.sessions = ["lint", "tests"] | ||
|
||
|
||
@nox.session(python=ALL_PYTHONS) | ||
def tests(session): | ||
""" | ||
Run the unit and regular tests. | ||
""" | ||
session.install(".[test]", "numba") | ||
session.run("pytest", *session.posargs if session.posargs else ["tests"]) | ||
|
||
|
||
@nox.session | ||
def lint(session): | ||
""" | ||
Run the linter. | ||
""" | ||
session.install("pre-commit") | ||
session.run("pre-commit", "run", "--all-files", *session.posargs) | ||
|
||
|
||
@nox.session | ||
def pylint(session): | ||
""" | ||
Run the pylint process. | ||
""" | ||
|
||
session.install(".") | ||
session.install("pylint==2.12.2") | ||
session.run("pylint", "src", *session.posargs) | ||
|
||
|
||
@nox.session(python=ALL_PYTHONS) | ||
def coverage(session): | ||
""" | ||
Run the unit and regular tests. | ||
""" | ||
session.install(".[test]", "pytest-cov") | ||
session.run( | ||
"pytest", "tests", "--cov=awkward", "--cov-report=xml", *session.posargs | ||
) | ||
|
||
|
||
@nox.session | ||
def docs(session): | ||
""" | ||
Build the docs. Pass "serve" to serve. | ||
""" | ||
|
||
session.chdir("docs") | ||
session.install("-r", "requirements.txt") | ||
session.run("sphinx-build", "-M", "html", ".", "_build") | ||
|
||
if session.posargs: | ||
if "serve" in session.posargs: | ||
session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit") | ||
session.run("python", "-m", "http.server", "8000", "-d", "_build/html") | ||
else: | ||
session.error("Unsupported argument to docs") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters