-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into addTH1Fhelpers
- Loading branch information
Showing
7 changed files
with
109 additions
and
33 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,8 @@ | ||
|
||
|
||
[flake8] | ||
ignore = E203, E231, E501, E722, W503, B950 | ||
select = C,E,F,W,T,B,B9,I | ||
per-file-ignores = | ||
tests/*: T | ||
noxfile.py: T |
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
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,65 @@ | ||
import shutil | ||
from pathlib import Path | ||
|
||
import nox | ||
|
||
ALL_PYTHONS = ["3.6", "3.7", "3.8", "3.9"] | ||
|
||
nox.options.sessions = ["lint", "tests"] | ||
|
||
|
||
DIR = Path(__file__).parent.resolve() | ||
|
||
|
||
@nox.session | ||
def lint(session): | ||
""" | ||
Run the linter. | ||
""" | ||
session.install("pre-commit") | ||
session.run("pre-commit", "run", "--all-files") | ||
|
||
|
||
@nox.session(python=ALL_PYTHONS) | ||
def tests(session): | ||
""" | ||
Run the unit and regular tests. | ||
""" | ||
session.install(".[test]") | ||
session.run("pytest") | ||
|
||
|
||
@nox.session | ||
def docs(session): | ||
""" | ||
Build the docs. Pass "serve" to serve. | ||
""" | ||
|
||
session.install(".[docs]") | ||
session.chdir("docs") | ||
session.run("sphinx-build", "-M", "html", ".", "_build") | ||
|
||
if session.posargs: | ||
if "serve" in session.posargs: | ||
print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit") | ||
session.run("python", "-m", "http.server", "8000", "-d", "_build/html") | ||
else: | ||
print("Unsupported argument to docs") | ||
|
||
|
||
@nox.session | ||
def build(session): | ||
""" | ||
Build an SDist and wheel. | ||
""" | ||
|
||
build_p = DIR.joinpath("build") | ||
if build_p.exists(): | ||
shutil.rmtree(build_p) | ||
|
||
dist_p = DIR.joinpath("dist") | ||
if dist_p.exists(): | ||
shutil.rmtree(dist_p) | ||
|
||
session.install("build") | ||
session.run("python", "-m", "build") |
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