Skip to content

Commit

Permalink
fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
jadbin committed Jul 15, 2018
1 parent 5b59ba2 commit 8bbc2a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
27 changes: 10 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
from os import path
sys.path.insert(0, path.dirname(path.dirname(__file__)))
from os.path import join, abspath, dirname

sys.path.insert(0, dirname(abspath(dirname(__file__))))

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

Expand Down Expand Up @@ -50,19 +50,20 @@
copyright = '2016-2018, jadbin'
author = 'jadbin'


# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
try:
from xpaw.version import __version__
def read_version():
p = join(dirname(abspath(dirname(__file__))), "xpaw", "version.py")
with open(p, 'r', encoding='utf-8') as f:
return f.read().split("=")[-1].strip().strip('"')


version = __version__
release = __version__
except ImportError:
version = ''
release = ''
version = read_version()
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -82,7 +83,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


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

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -119,13 +119,11 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


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

# Output file base name for HTML help builder.
htmlhelp_basename = 'xpawdoc'


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

latex_elements = {
Expand Down Expand Up @@ -154,7 +152,6 @@
'jadbin', 'manual'),
]


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

# One entry per manual page. List of tuples
Expand All @@ -164,7 +161,6 @@
[author], 1)
]


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

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -175,6 +171,3 @@
author, 'xpaw', 'One line description of project.',
'Miscellaneous'),
]



6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8

import os
import sys
from os.path import join, abspath, dirname
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

Expand All @@ -10,9 +10,7 @@


def read_version():
p = os.path.join(os.path.abspath(os.path.dirname(__file__)),
"xpaw",
"version.py")
p = join(abspath(dirname(__file__)), "xpaw", "version.py")
with open(p, 'r', encoding='utf-8') as f:
return f.read().split("=")[-1].strip().strip('"')

Expand Down

0 comments on commit 8bbc2a6

Please sign in to comment.