Skip to content

Commit 837d332

Browse files
author
Tony Crisci
committed
add __version__.py
1 parent ff165aa commit 837d332

File tree

3 files changed

+29
-53
lines changed

3 files changed

+29
-53
lines changed

dbus_next/__version__.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
__title__ = 'dbus_next'
2+
__description__ = 'A zero-dependency DBus library for Python with asyncio support'
3+
__url__ = 'https://github.com/altdesktop/python-dbus-next'
4+
__version__ = '0.1.3'
5+
__author__ = 'Tony Crisci'
6+
__author_email__ = '[email protected]'
7+
__license__ = 'MIT'
8+
__copyright__ = 'Copyright 2019 Tony Crisci'

docs/conf.py

+12-25
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616
import sys
1717
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))
1818

19+
from dbus_next.__version__ import __title__, __author__, __version__, __copyright__
20+
_project_slug = __title__.replace('_', '-')
1921

2022
# -- Project information -----------------------------------------------------
2123

22-
project = 'dbus-next'
23-
copyright = '2019, Tony Crisci'
24-
author = 'Tony Crisci'
24+
project = _project_slug
25+
copyright = __copyright__
26+
author = __author__
2527

2628
# The short X.Y version
27-
version = ''
29+
version = __version__
2830
# The full version, including alpha/beta/rc tags
29-
release = '0.1.3'
30-
31+
release = __version__
3132

3233
# -- General configuration ---------------------------------------------------
3334

@@ -39,10 +40,7 @@
3940
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4041
# ones.
4142
extensions = [
42-
'sphinx.ext.autodoc',
43-
'sphinx.ext.githubpages',
44-
'sphinxcontrib.asyncio',
45-
'sphinxcontrib.fulltoc'
43+
'sphinx.ext.autodoc', 'sphinx.ext.githubpages', 'sphinxcontrib.asyncio', 'sphinxcontrib.fulltoc'
4644
]
4745

4846
# Add any paths that contain templates here, relative to this directory.
@@ -72,7 +70,6 @@
7270
# The name of the Pygments (syntax highlighting) style to use.
7371
pygments_style = 'sphinx'
7472

75-
7673
# -- Options for HTML output -------------------------------------------------
7774

7875
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -101,13 +98,11 @@
10198
#
10299
# html_sidebars = {}
103100

104-
105101
# -- Options for HTMLHelp output ---------------------------------------------
106102

107103
# Output file base name for HTML help builder.
108104
htmlhelp_basename = 'dbus-nextdoc'
109105

110-
111106
# -- Options for LaTeX output ------------------------------------------------
112107

113108
latex_elements = {
@@ -132,31 +127,23 @@
132127
# (source start file, target name, title,
133128
# author, documentclass [howto, manual, or own class]).
134129
latex_documents = [
135-
(master_doc, 'dbus-next.tex', 'dbus-next Documentation',
136-
'Tony Crisci', 'manual'),
130+
(master_doc, 'dbus-next.tex', 'dbus-next Documentation', __author__, 'manual'),
137131
]
138132

139-
140133
# -- Options for manual page output ------------------------------------------
141134

142135
# One entry per manual page. List of tuples
143136
# (source start file, name, description, authors, manual section).
144-
man_pages = [
145-
(master_doc, 'dbus-next', 'dbus-next Documentation',
146-
[author], 1)
147-
]
148-
137+
man_pages = [(master_doc, _project_slug, 'dbus-next Documentation', [author], 1)]
149138

150139
# -- Options for Texinfo output ----------------------------------------------
151140

152141
# Grouping the document tree into Texinfo files. List of tuples
153142
# (source start file, target name, title, author,
154143
# dir menu entry, description, category)
155144
texinfo_documents = [
156-
(master_doc, 'dbus-next', 'dbus-next Documentation',
157-
author, 'dbus-next', 'One line description of project.',
158-
'Miscellaneous'),
145+
(master_doc, _project_slug, 'dbus-next Documentation', author, _project_slug,
146+
'One line description of project.', 'Miscellaneous'),
159147
]
160148

161-
162149
# -- Extension configuration -------------------------------------------------

setup.py

+9-28
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
from setuptools import setup, find_packages
88

99
# Package meta-data.
10-
NAME = 'dbus_next'
1110
DESCRIPTION = 'A zero-dependency DBus library for Python with asyncio support'
12-
URL = 'https://github.com/acrisci/python-dbus-next'
13-
14-
AUTHOR = 'Tony Crisci'
1511
REQUIRES_PYTHON = '>=3.6.0'
16-
VERSION = '0.1.3'
1712

1813
# What packages are required for this module to be executed?
1914
REQUIRED = []
@@ -28,42 +23,29 @@
2823

2924
here = os.path.abspath(os.path.dirname(__file__))
3025

31-
# Import the README and use it as the long-description.
32-
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
33-
try:
34-
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
35-
long_description = '\n' + f.read()
36-
except FileNotFoundError:
37-
long_description = DESCRIPTION
38-
39-
# Load the package's __version__.py module as a dictionary.
4026
about = {}
41-
if not VERSION:
42-
project_slug = NAME.lower().replace('-', '_').replace(' ', '_')
43-
with open(os.path.join(here, project_slug, '__version__.py')) as f:
44-
exec(f.read(), about)
45-
else:
46-
about['__version__'] = VERSION
27+
with open(os.path.join(here, 'dbus_next', '__version__.py')) as f:
28+
exec(f.read(), about)
4729

30+
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
31+
long_description = '\n' + f.read()
4832

49-
# Where the magic happens:
5033
setup(
51-
name=NAME,
34+
name=about['__title__'],
5235
version=about['__version__'],
5336
description=DESCRIPTION,
5437
long_description=long_description,
5538
long_description_content_type='text/markdown',
56-
author=AUTHOR,
57-
author_email=EMAIL,
39+
author=about['__author__'],
40+
author_email=about['__author_email__'],
5841
python_requires=REQUIRES_PYTHON,
59-
url=URL,
42+
url=about['__url__'],
6043
packages=find_packages(exclude=['test', '*.test', '*.test.*', 'test.*']),
6144
install_requires=REQUIRED,
6245
extras_require=EXTRAS,
6346
include_package_data=True,
6447
license='MIT',
6548
classifiers=[
66-
# Trove classifiers
6749
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
6850
'Development Status :: 3 - Alpha',
6951
'Environment :: X11 Applications',
@@ -78,5 +60,4 @@
7860
'Programming Language :: Python :: 3.7',
7961
'Programming Language :: Python :: Implementation :: CPython',
8062
'Programming Language :: Python :: Implementation :: PyPy'
81-
]
82-
)
63+
])

0 commit comments

Comments
 (0)