Skip to content
Snippets Groups Projects
Commit b4422167 authored by Honza Mach's avatar Honza Mach
Browse files

Modified conf.py and setup.py configuration files to include current version directly from package.

The conf.py configuration file for Sphinx-doc and setup.py configuration file for setuptools now fetch current package version directly from package. This means, that from this point forward it is necessary to change version number only on one place, the package __init__ file.
parent 120af156
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# This file is part of PyZenKit package.
#
# PyZenKit - Python script and daemon toolkit documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 15 10:49:01 2017.
# Copyright (C) since 2016 CESNET, z.s.p.o (http://www.ces.net/)
# Copyright (C) since 2015 Jan Mach <honza.mach.ml@gmail.com>
# Use of this package is governed by the MIT license, see LICENSE file.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# This project was initially written for personal use of the original author. Later
# it was developed much further and used for project of author`s employer.
#-------------------------------------------------------------------------------
# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
import json
#
# Import local version of pynspect library, so that we can insert correct version
# number into documentation.
#
sys.path.insert(0, os.path.abspath('.'))
import pyzenkit
# -- Load custom metadata ------------------------------------------------------
with open('metadata.json') as json_metadata_file:
......@@ -65,7 +65,7 @@ master_doc = 'manual'
# General information about the project.
project = u'PyZenKit - Python script and daemon toolkit'
copyright = u'2016, Jan Mach'
copyright = u'since 2016, Jan Mach'
author = u'Jan Mach'
# The version info for the project you're documenting, acts as replacement for
......@@ -73,9 +73,9 @@ author = u'Jan Mach'
# built documents.
#
# The short X.Y version.
version = u'0.37'
version = pyzenkit.__version__
# The full version, including alpha/beta/rc tags.
release = u'0.37'
release = pyzenkit.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -109,7 +109,6 @@ rst_epilog = """
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
......@@ -127,7 +126,7 @@ html_static_path = ['doc/_static']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'PyZenKit-Pythonscriptanddaemontoolkitdoc'
htmlhelp_basename = 'PyZenKit'
# -- Options for LaTeX output ---------------------------------------------
......@@ -154,7 +153,7 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'PyZenKit-Pythonscriptanddaemontoolkit.tex', u'PyZenKit - Python script and daemon toolkit Documentation',
(master_doc, 'pyzenkit.tex', u'PyZenKit - Python script and daemon toolkit - Documentation',
u'Jan Mach', 'manual'),
]
......@@ -164,7 +163,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'zenkit', u'PyZenKit - Python script and daemon toolkit - Documentation',
(master_doc, 'pyzenkit', u'PyZenKit - Python script and daemon toolkit - Documentation',
[author], 1)
]
......@@ -175,8 +174,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'PyZenKit-Pythonscriptanddaemontoolkit', u'PyZenKit - Python script and daemon toolkit Documentation',
author, 'PyZenKit-Pythonscriptanddaemontoolkit', 'One line description of project.',
(master_doc, 'pyzenkit', u'PyZenKit - Python script and daemon toolkit - Documentation',
author, 'PyZenKit', 'One line description of project.',
'Miscellaneous'),
]
......
......@@ -15,21 +15,32 @@
# https://packaging.python.org/en/latest/
# https://python-packaging.readthedocs.io/en/latest/index.html
import sys
import os
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
#
# Import local version of pynspect library, so that we can insert correct version
# number into documentation.
#
sys.path.insert(0, os.path.abspath('.'))
import pyzenkit
here = os.path.abspath(os.path.dirname(__file__))
#-------------------------------------------------------------------------------
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name = 'pyzenkit',
version = '0.37',
version = pyzenkit.__version__,
description = 'Python 3 script and daemon toolkit',
long_description = long_description,
classifiers = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment