diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..4de5ec9 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,7 @@ +version: 2 + +python: + version: 3.7 + install: + - requirements: requirements/docs.txt + - requirements: requirements/install.txt diff --git a/docs/conf.py b/docs/conf.py index a24d47f..18b7b31 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ sys.path.insert(0, os.path.abspath('..')) project = 'mim' copyright = '2021, openmmlab' -author = 'openmmlab' +author = 'MIM Authors' # The full version, including alpha/beta/rc tags release = '0.1.0' @@ -59,4 +59,3 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst index 2db75dd..8b925a2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,7 +8,7 @@ Welcome to mim's documentation! .. toctree:: :maxdepth: 2 - :caption: Contents: + :caption: Contents api.rst diff --git a/mim/utils/default.py b/mim/utils/default.py index 8a776e8..48df44b 100644 --- a/mim/utils/default.py +++ b/mim/utils/default.py @@ -1,5 +1,5 @@ import os -import site +import pkg_resources USER = 'open-mmlab' DEFAULT_URL = f'https://github.com/{USER}' @@ -32,4 +32,8 @@ DEFAULT_CACHE_DIR = f'{os.environ["HOME"]}/.cache/mim' if not os.path.exists(DEFAULT_CACHE_DIR): os.makedirs(DEFAULT_CACHE_DIR) -MMPACKAGE_PATH = os.path.join(site.getsitepackages()[0], 'mmpackage.txt') +# Although site.getsitepackage() can also get the directory of site-packages, +# it will faild in virtualenv. It is an issue with virtualenv, which copies +# the bundled version of site.py to the venv when it is created. +MMPACKAGE_PATH = os.path.join( + pkg_resources.get_distribution('click').location, 'mmpackage.txt') diff --git a/requirements/install.txt b/requirements/install.txt new file mode 100644 index 0000000..f50d783 --- /dev/null +++ b/requirements/install.txt @@ -0,0 +1,6 @@ +Click==7.1.2 +colorama +model-index +pandas +requests +tabulate diff --git a/setup.py b/setup.py index e9a3efb..2886e30 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='openmim', version='0.1.0', description='MIM Install OpenMMLab packages', - author='OpenMMLab', + author='MIM Authors', author_email='openmmlab@gmail.com', packages=find_packages(), include_package_data=True,