Skip to content

Commit

Permalink
use toml dep to read version
Browse files Browse the repository at this point in the history
  • Loading branch information
jannikmi committed Jun 15, 2022
1 parent e6e9705 commit 463beaa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
10 changes: 3 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.

import os
import subprocess
import sys

import pkg_resources

# package needs to be installed (with dependencies) for auto documentation
# Note: includes installing the project itself!
# Note: includes installing the project development dependencies
# -> no more requirement for separate requirement.txt for the docs dependencies!
subprocess.run(["poetry", "install"])

# Get the project root dir, which is the parent dir of this
import toml

cwd = os.getcwd()
project_root = os.path.dirname(cwd)
Expand All @@ -40,7 +35,8 @@
author = "Jannik Michelfeit"

# The full version, including alpha/beta/rc tags.
release = pkg_resources.get_distribution(project).version
project_config = toml.load("pyproject.toml")
release = project_config["tool"]["poetry"]["version"]

print("release version:", release)
print(multivar_horner)
Expand Down
6 changes: 5 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
poetry>=1.1
numpy
Sphinx
sphinx-rtd-theme
sphinxcontrib-bibtex
toml
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ numba = { version = "^0.55", optional = true }
pytest = "^6.2.5"
pytest-cov = "^3.0.0"
tox = "^3.24.4"
Sphinx = "^4.3.1"
twine = "^3.6.0"
pre-commit = "^2.15.0"
sphinxcontrib-bibtex = "^2.4.1"
sphinx-rtd-theme = "^1.0.0"
rstcheck = "^3.3.1"
build = "^0.8.0"
# docs
Sphinx = "^4.3.1"
toml = "^0.10.2"
sphinxcontrib-bibtex = "^2.4.1"
sphinx-rtd-theme = "^1.0.0"

[tool.poetry.extras]
numba = ["numba"]
Expand Down

0 comments on commit 463beaa

Please sign in to comment.