diff --git a/docs/Makefile b/docs/Makefile index 56c37d0..37e8de2 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -6,6 +6,7 @@ SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build +PIP = pip # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) @@ -53,36 +54,42 @@ clean: .PHONY: html html: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp htmlhelp: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ @@ -90,6 +97,7 @@ htmlhelp: .PHONY: qthelp qthelp: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ @@ -100,6 +108,7 @@ qthelp: .PHONY: applehelp applehelp: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @@ -109,6 +118,7 @@ applehelp: .PHONY: devhelp devhelp: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @@ -119,12 +129,14 @@ devhelp: .PHONY: epub epub: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: latex latex: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @@ -133,6 +145,7 @@ latex: .PHONY: latexpdf latexpdf: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @@ -140,6 +153,7 @@ latexpdf: .PHONY: latexpdfja latexpdfja: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @@ -147,18 +161,21 @@ latexpdfja: .PHONY: text text: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo texinfo: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @@ -167,6 +184,7 @@ texinfo: .PHONY: info info: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @@ -174,6 +192,7 @@ info: .PHONY: gettext gettext: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." @@ -205,12 +224,14 @@ coverage: .PHONY: xml xml: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: + $(PIP) install .. --no-deps $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/conf.py b/docs/conf.py index 6b3e50f..f36b586 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,6 +14,8 @@ import sys import os +from importlib.metadata import version +from packaging.version import Version # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -54,17 +56,19 @@ # General information about the project. project = u'omf' -copyright = u'2017, Global Mining Standards and Guidelines Group' +project_copyright = ( + u'2017, Global Mining Standards and Guidelines Group\n' + u'%Y, Mira Geoscience') author = u'Global Mining Standards and Guidelines Group' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -# -# The short X.Y version. -version = u'3.4.0' -# The full version, including alpha/beta/rc tags. -release = u'3.4.0-alpha.2' + +# The full version. +release = version("mira-omf") +# The base X.Y.Z version. +version = Version(release).base_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/test_docs.py b/docs/test_docs.py index e389c48..68d285a 100644 --- a/docs/test_docs.py +++ b/docs/test_docs.py @@ -1,7 +1,7 @@ import os import subprocess import unittest - +from pathlib import Path class TestDoc(unittest.TestCase): @property @@ -10,6 +10,8 @@ def docs_dir(self): return os.path.sep.join(dirname.split(os.path.sep)[:-1] + ["docs"]) def setUp(self): + self.src_root = Path(__file__).resolve().parents[1] + self.build_dir = os.path.sep.join(self.docs_dir.split(os.path.sep) + ["_build"]) if not os.path.isdir(self.build_dir): os.makedirs(f"{self.build_dir}") @@ -24,6 +26,17 @@ def setUp(self): if not os.path.isdir(self.html_dir): os.makedirs(f"{self.html_dir}") + check = subprocess.call( + [ + "pip", + "install", + f"{self.src_root}", + "--no-deps", + ] + ) + assert check == 0 + + def test_html(self): check = subprocess.call( [ diff --git a/omf/__init__.py b/omf/__init__.py index 4eef6aa..e34363c 100644 --- a/omf/__init__.py +++ b/omf/__init__.py @@ -44,7 +44,7 @@ from .volume import VolumeElement, VolumeGridGeometry -__version__ = "3.3.1-alpha.1" +__version__ = "3.3.1-alpha.2" __author__ = "Global Mining Standards and Guidelines Group, Mira Geoscience Ltd." __license__ = "MIT License" __copyright__ = ( diff --git a/pyproject.toml b/pyproject.toml index 69daed8..9012c20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mira-omf" -version = "3.3.1-alpha.1" +version = "3.3.1-alpha.2" description = "API Library for Open Mining Format" license = "MIT" authors = [ @@ -55,7 +55,7 @@ vectormath = "0.2.*" ## dependencies from Git repositories #------------------------------------ -#geoh5py = {version = ">=0.11.0a1, <0.12.dev", allow-prereleases = true} +#geoh5py = {version = ">=0.11.0a3, <0.12.dev", allow-prereleases = true} geoh5py = {git = "https://github.com/MiraGeoscience/geoh5py.git", rev = "release/0.11.0"} #geoh5py = {path = "../geoh5py", develop = true} diff --git a/recipe.yaml b/recipe.yaml index b505475..3782c94 100644 --- a/recipe.yaml +++ b/recipe.yaml @@ -2,7 +2,7 @@ schema_version: 1 context: name: "mira-omf" - version: "3.3.1a1" + version: "3.3.1a2" python_min: "3.10" package: