Skip to content

Commit

Permalink
fix: django import error
Browse files Browse the repository at this point in the history
  • Loading branch information
LKI committed Sep 6, 2018
1 parent 6d9ac81 commit b5973e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
27 changes: 11 additions & 16 deletions docs/conf.py
Expand Up @@ -11,11 +11,12 @@
# 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

sys.path.insert(0, os.path.abspath('..'))
import hutils

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

Expand All @@ -24,10 +25,9 @@
author = 'ZaiHui Dev'

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

release = hutils.__version__

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

Expand Down Expand Up @@ -71,7 +71,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 @@ -106,7 +105,6 @@
# Output file base name for HTML help builder.
htmlhelp_basename = 'hutilsdoc'


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

latex_elements = {
Expand All @@ -132,32 +130,29 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'hutils.tex', 'hutils Documentation',
'ZaiHui Dev', 'manual'),
'ZaiHui Dev', '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, 'hutils', 'hutils Documentation',
[author], 1)
[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, 'hutils', 'hutils Documentation',
author, 'hutils', 'One line description of project.',
'Miscellaneous'),
author, 'hutils', 'One line description of project.',
'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------

# -- Options for todo extension ----------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion hutils/__init__.py
Expand Up @@ -9,7 +9,6 @@
__version__ = '0.1.5'

__all__ = [
'django',
'EmptyContextManager',
'TupleEnum',
'bytes_to_str',
Expand All @@ -29,3 +28,10 @@
'is_int',
'is_uuid',
]

try:
import django

__all__.append('django')
except ImportError:
pass

0 comments on commit b5973e5

Please sign in to comment.