Skip to content

Commit

Permalink
add __version__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Crisci committed Sep 9, 2020
1 parent ff165aa commit 837d332
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 53 deletions.
8 changes: 8 additions & 0 deletions dbus_next/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__title__ = 'dbus_next'
__description__ = 'A zero-dependency DBus library for Python with asyncio support'
__url__ = 'https://github.com/altdesktop/python-dbus-next'
__version__ = '0.1.3'
__author__ = 'Tony Crisci'
__author_email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright 2019 Tony Crisci'
37 changes: 12 additions & 25 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))

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

# -- Project information -----------------------------------------------------

project = 'dbus-next'
copyright = '2019, Tony Crisci'
author = 'Tony Crisci'
project = _project_slug
copyright = __copyright__
author = __author__

# The short X.Y version
version = ''
version = __version__
# The full version, including alpha/beta/rc tags
release = '0.1.3'

release = __version__

# -- General configuration ---------------------------------------------------

Expand All @@ -39,10 +40,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinxcontrib.asyncio',
'sphinxcontrib.fulltoc'
'sphinx.ext.autodoc', 'sphinx.ext.githubpages', 'sphinxcontrib.asyncio', 'sphinxcontrib.fulltoc'
]

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


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -101,13 +98,11 @@
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

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


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
Expand All @@ -132,31 +127,23 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'dbus-next.tex', 'dbus-next Documentation',
'Tony Crisci', 'manual'),
(master_doc, 'dbus-next.tex', 'dbus-next Documentation', __author__, 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'dbus-next', 'dbus-next Documentation',
[author], 1)
]

man_pages = [(master_doc, _project_slug, 'dbus-next Documentation', [author], 1)]

# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'dbus-next', 'dbus-next Documentation',
author, 'dbus-next', 'One line description of project.',
'Miscellaneous'),
(master_doc, _project_slug, 'dbus-next Documentation', author, _project_slug,
'One line description of project.', 'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------
37 changes: 9 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
from setuptools import setup, find_packages

# Package meta-data.
NAME = 'dbus_next'
DESCRIPTION = 'A zero-dependency DBus library for Python with asyncio support'
URL = 'https://github.com/acrisci/python-dbus-next'
EMAIL = '[email protected]'
AUTHOR = 'Tony Crisci'
REQUIRES_PYTHON = '>=3.6.0'
VERSION = '0.1.3'

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

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

# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except FileNotFoundError:
long_description = DESCRIPTION

# Load the package's __version__.py module as a dictionary.
about = {}
if not VERSION:
project_slug = NAME.lower().replace('-', '_').replace(' ', '_')
with open(os.path.join(here, project_slug, '__version__.py')) as f:
exec(f.read(), about)
else:
about['__version__'] = VERSION
with open(os.path.join(here, 'dbus_next', '__version__.py')) as f:
exec(f.read(), about)

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

# Where the magic happens:
setup(
name=NAME,
name=about['__title__'],
version=about['__version__'],
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
author=AUTHOR,
author_email=EMAIL,
author=about['__author__'],
author_email=about['__author_email__'],
python_requires=REQUIRES_PYTHON,
url=URL,
url=about['__url__'],
packages=find_packages(exclude=['test', '*.test', '*.test.*', 'test.*']),
install_requires=REQUIRED,
extras_require=EXTRAS,
include_package_data=True,
license='MIT',
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 3 - Alpha',
'Environment :: X11 Applications',
Expand All @@ -78,5 +60,4 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
]
)
])

0 comments on commit 837d332

Please sign in to comment.