Skip to content

Commit 6be0aeb

Browse files
authored
[Feature] Support for installing mmengine without opencv (#1429)
1 parent a5db5be commit 6be0aeb

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

Diff for: .github/workflows/deploy.yml

+21
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,24 @@ jobs:
2626
run: |
2727
pip install twine
2828
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
29+
30+
build-n-publish-lite:
31+
runs-on: ubuntu-latest
32+
if: startsWith(github.event.ref, 'refs/tags')
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Set up Python 3.7
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: 3.7
39+
- name: Install torch
40+
run: pip install torch
41+
- name: Install wheel
42+
run: pip install wheel
43+
- name: Build MMEngine-lite
44+
run: sed -i "s/os.getenv('MMENGINE_LITE', '0')/os.getenv('MMENGINE_LITE', '1')/g" setup.py
45+
python setup.py sdist bdist_wheel
46+
- name: Publish distribution to PyPI
47+
run: |
48+
pip install twine
49+
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}

Diff for: docs/en/get_started/installation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
## Install MMEngine
2828

2929
:::{note}
30-
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):
30+
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):
3131

3232
```bash
33-
MMENGINE_LITE=1 pip install mmengine
33+
pip install mmengine-lite
3434
```
3535

3636
:::

Diff for: docs/zh_cn/get_started/installation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
## 安装 MMEngine
2828

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

3232
```bash
33-
MMENGINE_LITE=1 pip install mmengine
33+
pip install mmengine-lite
3434
```
3535

3636
:::

Diff for: setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def gen_packages_items():
126126
install_requires.append(choose_requirement(main, secondary))
127127

128128
setup(
129-
name='mmengine',
129+
name='mmengine'
130+
if os.getenv('MMENGINE_LITE', '0') == '0' else 'mmengine-lite',
130131
version=get_version(),
131132
description='Engine of OpenMMLab projects',
132133
long_description=readme(),

0 commit comments

Comments
 (0)