From 754d2a89df7893b507f99352160cf8b7171a3073 Mon Sep 17 00:00:00 2001 From: fanqiNO1 <1848839264@qq.com> Date: Mon, 20 Nov 2023 17:02:45 +0800 Subject: [PATCH] [Enhancement] Support building mmengine-lite --- .github/workflows/deploy.yml | 21 +++++++++++++++++++++ setup.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 13a190baf2..d60fd9c25a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 }} \ No newline at end of file diff --git a/setup.py b/setup.py index 127dcdc529..3ef8359cbf 100644 --- a/setup.py +++ b/setup.py @@ -126,7 +126,7 @@ 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(),