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
- release/*
strategy:
matrix:
python-3.6:
imageTag: '3.6'
python-3.7:
imageTag: '3.7'
# TODO
#python-latest:
# imageTag: '3'
maxParallel: 3
pool:
vmImage: ubuntu-latest
container:
image: python:3.7
image: python:$(imageTag)
steps:
- script: |
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Export path
- script: |
python3 -m pip install .[test,torch]
python3 -m pip install .[test,cpuworker]
make postinstall
displayName: Install dependencies
- script: |
@ -29,7 +40,7 @@ steps:
env:
SB_TEST_CUDA: '0'
- 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
env:
CODECOV_TOKEN: $(codecovToken)

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

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

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

@ -4,7 +4,7 @@ set -e
export PATH=${HOME}/.local/bin:${PATH}
# 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
# install nodejs packages

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

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

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

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

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

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

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

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

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

@ -152,11 +152,11 @@ setup(
'natsort>=7.1.1',
'networkx>=1.11',
'numpy>=1.19.2',
'openpyxl>=3.0.7',
'omegaconf==2.0.6',
'openpyxl>=3.0.7',
'pandas>=1.1.5',
'pyyaml>=5.3',
'requests>=2.28.1',
'requests>=2.27.1',
'seaborn>=0.11.2',
'tcping>=0.1.1rc1',
'urllib3>=1.26.9',
@ -164,7 +164,16 @@ setup(
'xlsxwriter>=1.3.8',
'xmltodict>=0.12.0',
],
extras_require={
extras_require=(
lambda x: {
**x,
'develop': x['dev'] + x['test'],
'cpuworker': x['torch'],
'amdworker': x['torch'] + x['ort'] + x['mpi'],
'nvworker': x['torch'] + x['ort'] + x['mpi'] + x['nvidia'],
}
)(
{
'dev': ['pre-commit>=2.10.0'],
'test': [
'flake8-docstrings>=1.5.0',
@ -181,18 +190,19 @@ setup(
'vcrpy>=4.1.1',
'yapf==0.31.0',
],
'nvidia': ['py3nvml>=0.2.6'],
'ort': [
'onnx>=1.10.2',
'onnxruntime-gpu==1.10.0',
],
'torch': [
'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,
entry_points={
'console_scripts': [