Skip to content

Commit 5151b7c

Browse files
committed
Include version in generated documentation.
1 parent 6df7f8f commit 5151b7c

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
recursive-include src/StreamDeck
2-
include *.md
32
include src/example.py
3+
include *.md
4+
include VERSION

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.2.3

doc/source/conf.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222

2323
import sphinx_rtd_theme
2424

25-
sys.path.insert(0, os.path.abspath('../../src'))
25+
ROOT_PATH = os.path.join("..", "..")
26+
27+
with open(os.path.join(ROOT_PATH, "VERSION"), 'r') as f:
28+
package_version = f.read().strip()
29+
30+
sys.path.insert(0, os.path.abspath(os.path.join(ROOT_PATH, 'src')))
2631

2732

2833
# -- General configuration ------------------------------------------------
@@ -58,9 +63,9 @@
5863
# built documents.
5964
#
6065
# The short X.Y version.
61-
version = ''
66+
version = package_version
6267
# The full version, including alpha/beta/rc tags.
63-
release = ''
68+
release = package_version
6469

6570
# The language for content autogenerated by Sphinx. Refer to documentation
6671
# for a list of supported languages.
@@ -101,9 +106,7 @@
101106
# so a file named "default.css" will overwrite the built-in "default.css".
102107
html_static_path = []
103108

104-
html_extra_path = ['../../ExampleDeck.jpg']
105-
106-
html_extra_path = ['../../ExampleDeck.jpg']
109+
html_extra_path = [os.path.join(ROOT_PATH, 'ExampleDeck.jpg')]
107110

108111
# Custom sidebar templates, must be a dictionary that maps document names
109112
# to template names.
@@ -148,7 +151,7 @@
148151
# (source start file, target name, title,
149152
# author, documentclass [howto, manual, or own class]).
150153
latex_documents = [
151-
(master_doc, 'python-elgato-streamdeck.tex', 'python-elgato-streamdeck Documentation',
154+
(master_doc, 'python-elgato-streamdeck.tex', 'StreamDeck Package Documentation',
152155
'Dean Camera', 'manual'),
153156
]
154157

@@ -158,7 +161,7 @@
158161
# One entry per manual page. List of tuples
159162
# (source start file, name, description, authors, manual section).
160163
man_pages = [
161-
(master_doc, 'python-elgato-streamdeck', 'python-elgato-streamdeck Documentation',
164+
(master_doc, 'python-elgato-streamdeck', 'StreamDeck Package Documentation',
162165
[author], 1)
163166
]
164167

@@ -169,10 +172,7 @@
169172
# (source start file, target name, title, author,
170173
# dir menu entry, description, category)
171174
texinfo_documents = [
172-
(master_doc, 'python-elgato-streamdeck', 'python-elgato-streamdeck Documentation',
173-
author, 'python-elgato-streamdeck', 'One line description of project.',
175+
(master_doc, 'python-elgato-streamdeck', 'StreamDeck Package Documentation',
176+
author, 'python-elgato-streamdeck', 'Library to control Elgato StreamDeck devices.',
174177
'Miscellaneous'),
175178
]
176-
177-
178-

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import setuptools
22

3+
with open("VERSION", 'r') as f:
4+
version = f.read().strip()
5+
36
with open("README.md", 'r') as f:
47
long_description = f.read()
58

69
setuptools.setup(
710
name='streamdeck',
8-
version='0.2.3',
11+
version=version,
912
description='Library to control Elgato StreamDeck devices.',
1013
author='Dean Camera',
1114
author_email='[email protected]',

0 commit comments

Comments
 (0)