clean up setuptools usage
This commit is contained in:
parent
5789436c9a
commit
995d9dea2f
15
doc/conf.py
15
doc/conf.py
@ -15,11 +15,9 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from importlib.metadata import version as imp_version
|
||||||
|
|
||||||
on_rtd = os.getenv("READTHEDOCS") == "True"
|
on_rtd = os.getenv("READTHEDOCS") == "True"
|
||||||
if on_rtd:
|
|
||||||
import escpos
|
|
||||||
else:
|
|
||||||
from setuptools_scm import get_version
|
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# 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
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
@ -75,14 +73,9 @@ copyright = u"2016, Manuel F Martinez and others"
|
|||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
if on_rtd:
|
release = imp_version("python-escpos")
|
||||||
# The full version, including alpha/beta/rc tags.
|
|
||||||
release = escpos.__version__
|
|
||||||
else:
|
|
||||||
# locally setuptools_scm should work
|
|
||||||
release = get_version(root=root)
|
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = ".".join(release.split(".")[:2]) # The short X.Y version.
|
version = ".".join(release.split(".")[:2])
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
1
tox.ini
1
tox.ini
@ -31,6 +31,7 @@ deps = sphinx>=3.0.0
|
|||||||
setuptools_scm
|
setuptools_scm
|
||||||
python-barcode
|
python-barcode
|
||||||
sphinxcontrib-spelling>=7.2.0
|
sphinxcontrib-spelling>=7.2.0
|
||||||
|
sphinx_rtd_theme
|
||||||
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
|
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user