Skip to content

Commit

Permalink
add black to the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aryarm authored Mar 15, 2024
1 parent d99d0dd commit 4395e6d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Nox sessions."""
import os
import shutil
from pathlib import Path

import nox
Expand All @@ -9,9 +10,12 @@

package = "core"
python_versions = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
locked_python_version = "3.8"
nox.needs_version = ">= 2022.11.21"
nox.options.sessions = (
"docs",
"tests",
"lint",
)


Expand All @@ -21,6 +25,28 @@
]



@session(python=locked_python_version)
def docs(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "docs/_build"]
if not session.posargs and "FORCE_COLOR" in os.environ:
args.insert(0, "--color")

build_dir = Path("docs", "_build")
if build_dir.exists():
shutil.rmtree(build_dir)

session.run("sphinx-build", *args)


@session(python=locked_python_version)
def lint(session: Session) -> None:
"""Lint our code."""
session.install("black")
session.run("black", "--verbose", "--check", ".")


def install_handle_python(session):
"""
handle incompatibilities between python and other packages
Expand Down

0 comments on commit 4395e6d

Please sign in to comment.