Update Python setup for require packages (#387)

__Description__

Update Python setup for require packages.

__Major Revisions__
* downgrade requests version to be compatible with python 3.6, add corresponding pipeline for 3.6
* add extra entry in extras_require for nested packages
* update `pip install` contents accordingly
This commit is contained in:
Yifan Xiong 2022-08-17 11:33:57 +08:00 коммит произвёл GitHub
Родитель e335556d7a
Коммит 626ac0a463
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 61 добавлений и 40 удалений

Просмотреть файл

@ -5,18 +5,29 @@ trigger:
- main - main
- release/* - release/*
strategy:
matrix:
python-3.6:
imageTag: '3.6'
python-3.7:
imageTag: '3.7'
# TODO
#python-latest:
# imageTag: '3'
maxParallel: 3
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
container: container:
image: python:3.7 image: python:$(imageTag)
steps: steps:
- script: | - script: |
echo "##vso[task.prependpath]$HOME/.local/bin" echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Export path displayName: Export path
- script: | - script: |
python3 -m pip install .[test,torch] python3 -m pip install .[test,cpuworker]
make postinstall make postinstall
displayName: Install dependencies displayName: Install dependencies
- script: | - script: |
@ -29,7 +40,7 @@ steps:
env: env:
SB_TEST_CUDA: '0' SB_TEST_CUDA: '0'
- script: | - script: |
bash <(curl -s https://codecov.io/bash) -cF cpu-unit-test bash <(curl -s https://codecov.io/bash) -cF cpu-python$(imageTag)-unit-test
displayName: Report coverage results displayName: Report coverage results
env: env:
CODECOV_TOKEN: $(codecovToken) CODECOV_TOKEN: $(codecovToken)

Просмотреть файл

@ -18,7 +18,7 @@ steps:
echo "##vso[task.prependpath]$HOME/.local/bin" echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Export path displayName: Export path
- script: | - script: |
python3 -m pip install .[test,nvidia,torch,ort,mpi] python3 -m pip install .[test,nvworker]
make postinstall make postinstall
displayName: Install dependencies displayName: Install dependencies
- script: | - script: |

Просмотреть файл

@ -4,7 +4,7 @@ set -e
export PATH=${HOME}/.local/bin:${PATH} export PATH=${HOME}/.local/bin:${PATH}
# install python packages # install python packages
pip install .[dev,test,torch] --user --no-cache-dir --progress-bar=off --use-feature=in-tree-build pip install .[develop,cpuworker] --user --no-cache-dir --progress-bar=off --use-feature=in-tree-build
pre-commit install --install-hooks pre-commit install --install-hooks
# install nodejs packages # install nodejs packages

Просмотреть файл

@ -128,6 +128,6 @@ ADD third_party third_party
RUN make -C third_party cuda RUN make -C third_party cuda
ADD . . ADD . .
RUN python3 -m pip install .[nvidia,torch,ort,mpi] && \ RUN python3 -m pip install .[nvworker] && \
make cppbuild && \ make cppbuild && \
make postinstall make postinstall

Просмотреть файл

@ -124,6 +124,6 @@ ADD third_party third_party
RUN make -C third_party rocm RUN make -C third_party rocm
ADD . . ADD . .
RUN python3 -m pip install .[torch,ort,mpi] && \ RUN python3 -m pip install .[amdworker] && \
make cppbuild && \ make cppbuild && \
make postinstall make postinstall

Просмотреть файл

@ -139,6 +139,6 @@ ADD third_party third_party
RUN make ROCBLAS_BRANCH=release/rocm-rel-5.1 -C third_party rocm RUN make ROCBLAS_BRANCH=release/rocm-rel-5.1 -C third_party rocm
ADD . . ADD . .
RUN python3 -m pip install .[torch,ort,mpi] && \ RUN python3 -m pip install .[amdworker] && \
make cppbuild && \ make cppbuild && \
make postinstall make postinstall

Просмотреть файл

@ -19,7 +19,7 @@ Follow [System Requirements](../getting-started/installation.mdx).
git clone --recurse-submodules -j8 https://github.com/microsoft/superbenchmark git clone --recurse-submodules -j8 https://github.com/microsoft/superbenchmark
cd superbenchmark cd superbenchmark
python3 -m pip install -e .[dev,test] python3 -m pip install -e .[develop]
``` ```
## Lint and Test ## Lint and Test

Просмотреть файл

@ -152,11 +152,11 @@ setup(
'natsort>=7.1.1', 'natsort>=7.1.1',
'networkx>=1.11', 'networkx>=1.11',
'numpy>=1.19.2', 'numpy>=1.19.2',
'openpyxl>=3.0.7',
'omegaconf==2.0.6', 'omegaconf==2.0.6',
'openpyxl>=3.0.7',
'pandas>=1.1.5', 'pandas>=1.1.5',
'pyyaml>=5.3', 'pyyaml>=5.3',
'requests>=2.28.1', 'requests>=2.27.1',
'seaborn>=0.11.2', 'seaborn>=0.11.2',
'tcping>=0.1.1rc1', 'tcping>=0.1.1rc1',
'urllib3>=1.26.9', 'urllib3>=1.26.9',
@ -164,35 +164,45 @@ setup(
'xlsxwriter>=1.3.8', 'xlsxwriter>=1.3.8',
'xmltodict>=0.12.0', 'xmltodict>=0.12.0',
], ],
extras_require={ extras_require=(
'dev': ['pre-commit>=2.10.0'], lambda x: {
'test': [ **x,
'flake8-docstrings>=1.5.0', 'develop': x['dev'] + x['test'],
'flake8-quotes>=3.2.0', 'cpuworker': x['torch'],
'flake8>=3.8.4', 'amdworker': x['torch'] + x['ort'] + x['mpi'],
'mypy>=0.800', 'nvworker': x['torch'] + x['ort'] + x['mpi'] + x['nvidia'],
'pydocstyle>=5.1.1', }
'pytest-cov>=2.11.1', )(
'pytest-subtests>=0.4.0', {
'pytest>=6.2.2', 'dev': ['pre-commit>=2.10.0'],
'types-markdown', 'test': [
'types-pkg_resources', 'flake8-docstrings>=1.5.0',
'types-pyyaml', 'flake8-quotes>=3.2.0',
'vcrpy>=4.1.1', 'flake8>=3.8.4',
'yapf==0.31.0', 'mypy>=0.800',
], 'pydocstyle>=5.1.1',
'nvidia': ['py3nvml>=0.2.6'], 'pytest-cov>=2.11.1',
'ort': [ 'pytest-subtests>=0.4.0',
'onnx>=1.10.2', 'pytest>=6.2.2',
'onnxruntime-gpu==1.10.0', 'types-markdown',
], 'types-pkg_resources',
'torch': [ 'types-pyyaml',
'torch>=1.7.0a0', 'vcrpy>=4.1.1',
'torchvision>=0.8.0a0', 'yapf==0.31.0',
'transformers>=4.3.3', ],
], 'torch': [
'mpi': ['mpi4py>=3.1.3'], 'torch>=1.7.0a0',
}, 'torchvision>=0.8.0a0',
'transformers>=4.3.3',
],
'ort': [
'onnx>=1.10.2',
'onnxruntime-gpu==1.10.0',
],
'mpi': ['mpi4py>=3.1.3'],
'nvidia': ['py3nvml>=0.2.6'],
}
),
include_package_data=True, include_package_data=True,
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [