Skip to content

Commit

Permalink
Add docs and test extras
Browse files Browse the repository at this point in the history
This makes it easier to install just documentation or test dependencies
without installing all dev dependencies.  It also enforces version
restrictions during nox runs.
  • Loading branch information
carlwgeorge committed May 6, 2022
1 parent 406db6f commit 650f791
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ def check_example(session: nox.Session):

@nox.session(reuse_venv=True)
def docs(session: nox.Session):
session.install(".", "Sphinx")
session.install(".[docs]")
session.run("sphinx-build", "docs", "docs/_build")


@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"], reuse_venv=True)
def test(session: nox.Session):
session.install(".")
session.install("pytest", "hypothesis", "pytz")
session.install(".[test]")
session.run("pytest", "-vv", "--tb=short", "--log-level=INFO")
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ documentation = "https://pyiso8601.readthedocs.io/en/latest/"

[tool.poetry.dependencies]
python = ">=3.6.2,<4.0"
pytest = { version = "^6.2.2", optional = true }
hypothesis = { version = "^6.1.1", optional = true }
pytz = { version = "^2021.1", optional = true }
Sphinx = { version = "^4.2.0", optional = true }

[tool.poetry.dev-dependencies]
mypy = "^0.910"
Expand All @@ -24,6 +28,10 @@ pre-commit = "^2.15.0"
nox = "^2021.10.1"
Sphinx = "^4.2.0"

[tool.poetry.extras]
docs = ["Sphinx"]
test = ["pytest", "hypothesis", "pytz"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand Down

0 comments on commit 650f791

Please sign in to comment.