Skip to content

Commit

Permalink
[Feature] Support for installing mmengine without opencv (open-mmlab#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fanqiNO1 authored Nov 20, 2023
1 parent a5db5be commit 6be0aeb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,24 @@ jobs:
run: |
pip install twine
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
build-n-publish-lite:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install torch
run: pip install torch
- name: Install wheel
run: pip install wheel
- name: Build MMEngine-lite
run: sed -i "s/os.getenv('MMENGINE_LITE', '0')/os.getenv('MMENGINE_LITE', '1')/g" setup.py
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
run: |
pip install twine
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
4 changes: 2 additions & 2 deletions docs/en/get_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
## Install MMEngine

:::{note}
If you only want to use the fileio, registry, and config modules in MMEngine, you can set the `MMENGINE_LITE` environment variable, which will only install the few third-party library dependencies that are necessary (e.g., it will not install opencv, matplotlib):
If you only want to use the fileio, registry, and config modules in MMEngine, you can install `mmengine-lite`, which will only install the few third-party library dependencies that are necessary (e.g., it will not install opencv, matplotlib):

```bash
MMENGINE_LITE=1 pip install mmengine
pip install mmengine-lite
```

:::
Expand Down
4 changes: 2 additions & 2 deletions docs/zh_cn/get_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
## 安装 MMEngine

:::{note}
如果你只想使用 MMEngine 中的 fileio、registry 和 config 模块,你可以设置 `MMENGINE_LITE` 环境变量,它只会安装必须的几个第三方库依赖(例如不会安装 opencv、matplotlib):
如果你只想使用 MMEngine 中的 fileio、registry 和 config 模块,你可以安装`mmengine-lite`,它只会安装必须的几个第三方库依赖(例如不会安装 opencv、matplotlib):

```bash
MMENGINE_LITE=1 pip install mmengine
pip install mmengine-lite
```

:::
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def gen_packages_items():
install_requires.append(choose_requirement(main, secondary))

setup(
name='mmengine',
name='mmengine'
if os.getenv('MMENGINE_LITE', '0') == '0' else 'mmengine-lite',
version=get_version(),
description='Engine of OpenMMLab projects',
long_description=readme(),
Expand Down

0 comments on commit 6be0aeb

Please sign in to comment.