diff --git a/README.md b/README.md index ea1e8d505..c7ea9e529 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@
+[![PyPI](https://img.shields.io/pypi/v/mmsegmentation)](https://pypi.org/project/mmsegmentation) [![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmsegmentation.readthedocs.io/en/latest/) [![badge](https://github.com/open-mmlab/mmsegmentation/workflows/build/badge.svg)](https://github.com/open-mmlab/mmsegmentation/actions) [![codecov](https://codecov.io/gh/open-mmlab/mmsegmentation/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmsegmentation) diff --git a/docs/install.md b/docs/install.md index 265f45b18..b3400959d 100644 --- a/docs/install.md +++ b/docs/install.md @@ -36,7 +36,7 @@ pip install mmcv-full==latest+torch1.5.0+cu101 -f https://openmmlab.oss-accelera d. Install MMSegmentation. ```shell -pip install mmseg # install the latest release +pip install mmsegmentation # install the latest release ``` or @@ -45,12 +45,19 @@ or pip install git+https://github.com/open-mmlab/mmsegmentation.git # install the master branch ``` +Instead, if you would like to install MMSegmentation in `dev` mode, run following +```shell +git clone https://github.com/open-mmlab/mmsegmentation +cd mmsegmentation +pip install -e . # or "python setup.py develop" +``` + Note: -1. The git commit id will be written to the version number with step *e*, e.g. 0.5.0+c415a2e. The version will also be saved in trained models. -It is recommended that you run step *e* each time you pull some updates from github. If C++/CUDA codes are modified, then this step is compulsory. +1. In `dev` mode, the git commit id will be written to the version number with step *d*, e.g. 0.5.0+c415a2e. The version will also be saved in trained models. +It is recommended that you run step *d* each time you pull some updates from github. If C++/CUDA codes are modified, then this step is compulsory. -2. Following the above instructions, mmsegmentation is installed on `dev` mode, any local modifications made to the code will take effect without the need to reinstall it (unless you submit some commits and want to update the version number). +2. When MMsegmentation is installed on `dev` mode, any local modifications made to the code will take effect without the need to reinstall it (unless you submit some commits and want to update the version number). 3. If you would like to use `opencv-python-headless` instead of `opencv-python`, you can install it before installing MMCV. @@ -68,7 +75,9 @@ conda activate open-mmlab conda install pytorch=1.5.0 torchvision cudatoolkit=10.1 -c pytorch pip install mmcv-full==latest+torch1.5.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html -pip install git+https://github.com/open-mmlab/mmsegmentation.git +git clone https://github.com/open-mmlab/mmsegmentation +cd mmsegmentation +pip install -e . # or "python setup.py develop" mkdir data ln -s $DATA_ROOT data diff --git a/setup.py b/setup.py index 45f56b44b..63d73484f 100755 --- a/setup.py +++ b/setup.py @@ -77,7 +77,12 @@ version_info = ({}) def get_version(): with open(version_file, 'r') as f: exec(compile(f.read(), version_file, 'exec')) - return locals()['__version__'] + import sys + # return short version for sdist + if 'sdist' in sys.argv or 'bdist_wheel' in sys.argv: + return locals()['short_version'] + else: + return locals()['__version__'] def parse_requirements(fname='requirements.txt', with_version=True): @@ -159,7 +164,7 @@ def parse_requirements(fname='requirements.txt', with_version=True): if __name__ == '__main__': write_version_py() setup( - name='mmseg', + name='mmsegmentation', version=get_version(), description='Open MMLab Semantic Segmentation Toolbox and Benchmark', long_description=readme(),