From c48654e1ff46aa61913005489beb6f850497da89 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sat, 10 Sep 2016 11:35:04 -1000 Subject: [PATCH] Install all necessary deps on readthedocs Fixes problems where inline method docs did not appear because relevant modules failed to import due to missing dependencies. --- doc/conf.py | 5 ++++- environment.yml | 16 ++++++++++++++++ readthedocs.yml | 5 +++++ setup_mcedit2.py | 10 ++++++++-- setup_mceditlib.py | 4 ++-- 5 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 environment.yml create mode 100644 readthedocs.yml diff --git a/doc/conf.py b/doc/conf.py index 565d479..e31b606 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -16,7 +16,10 @@ import sys, os # 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. -sys.path.insert(0, os.path.abspath('../src')) # Folder containing mceditlib and mcedit2 + +# Expects mcedit2 to be installed via `setup.py install`, so `./src` is not +# added to sys.path. + sys.path.insert(0, os.path.abspath('extensions')) # extensions # -- General configuration ----------------------------------------------------- diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..6a5494e --- /dev/null +++ b/environment.yml @@ -0,0 +1,16 @@ +name: mcedit2-docs + +dependencies: + - python=2.7 + - pyzmq + - pyside + - pyopengl + - ipython + - qtconsole + - pygments + - cython + - numpy + - pip: + - pastebin + - arrow + - git+https://github.com/mcedit/pysideuic-pkg \ No newline at end of file diff --git a/readthedocs.yml b/readthedocs.yml new file mode 100644 index 0000000..2624659 --- /dev/null +++ b/readthedocs.yml @@ -0,0 +1,5 @@ +conda: + file: environment.yml + +python: + setup_py_install: true \ No newline at end of file diff --git a/setup_mcedit2.py b/setup_mcedit2.py index 4dc1b86..427721b 100644 --- a/setup_mcedit2.py +++ b/setup_mcedit2.py @@ -1,8 +1,10 @@ """ setup-mcedit2 """ +from os import path -from setuptools import setup +import sys +from setuptools import setup, find_packages from Cython.Build import cythonize import numpy @@ -30,6 +32,10 @@ mcedit2_ext_modules = cythonize( for m in mcedit2_ext_modules: m.include_dirs = include_dirs +sys.path.append(path.join(path.dirname(__file__), "src")) +from mcedit2.util.gen_ui import compile_ui +compile_ui() + setup(name='mcedit2', version=version, description="Interactive 3D World Editor for Minecraft Levels", @@ -51,7 +57,7 @@ setup(name='mcedit2', author_email='codewarrior0@gmail.com', url='https://github.com/mcedit/mcedit2', license='MIT License', - packages=["mcedit2"], + packages=find_packages('src', include="mcedit2*"), package_dir={'': 'src'}, ext_modules=mcedit2_ext_modules, include_dirs=include_dirs, diff --git a/setup_mceditlib.py b/setup_mceditlib.py index fa05df2..c0d1fdc 100644 --- a/setup_mceditlib.py +++ b/setup_mceditlib.py @@ -2,7 +2,7 @@ setup_mceditlib """ -from setuptools import setup +from setuptools import setup, find_packages from Cython.Build import cythonize # Output annotated .html @@ -47,7 +47,7 @@ setup(name='mceditlib', author_email='codewarrior0@gmail.com', url='https://github.com/mcedit/mcedit2', license='MIT License', - packages=["mceditlib"], + packages=find_packages('src', include="mceditlib*"), package_dir={'': 'src'}, ext_modules=mceditlib_ext_modules, include_dirs=include_dirs,