Unverified Commit 9f9aa43e authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Fix releasing (#3216)

parent 54ed2b93
/nni/version.py
/nni_node/ /nni_node/
/toolchain/ /toolchain/
......
# Copyright (c) Microsoft Corporation. # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license. # Licensed under the MIT license.
__version__ = '999.0.0-developing' from .version import __version__
from .runtime.log import init_logger from .runtime.log import init_logger
init_logger() init_logger()
......
# Copyright (c) Microsoft Corporation. # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license. # Licensed under the MIT license.
trigger: none
pr: none
jobs: jobs:
- job: validate_version_number - job: validate_version_number
pool: pool:
...@@ -49,22 +52,22 @@ jobs: ...@@ -49,22 +52,22 @@ jobs:
displayName: Configure Python version displayName: Configure Python version
- script: | - script: |
python -m pip install --upgrade pip setuptools twine python -m pip install --upgrade pip setuptools wheel twine
python test/vso_tools/build_wheel.py $(NNI_RELEASE) python test/vso_tools/build_wheel.py $(NNI_RELEASE)
displayName: Build wheel
if [ $(build_type) = 'release' ] - script: |
if [ $(build_type) = 'release' ]; then
echo 'uploading release package to pypi...' echo 'uploading release package to pypi...'
python -m twine upload -u nni -p $(pypi_password) dist/* python -m twine upload -u nni -p $(pypi_password) dist/*
then
else else
echo 'uploading prerelease package to testpypi...' echo 'uploading prerelease package to testpypi...'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/* python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
fi fi
displayName: Build and upload wheel displayName: Upload wheel
- script: | - script: |
if [ $(build_type) = 'release' ] if [ $(build_type) = 'release' ]; then
then
docker login -u msranni -p $(docker_hub_password) docker login -u msranni -p $(docker_hub_password)
export IMAGE_NAME=msranni/nni export IMAGE_NAME=msranni/nni
else else
...@@ -92,18 +95,19 @@ jobs: ...@@ -92,18 +95,19 @@ jobs:
displayName: Configure Python version displayName: Configure Python version
- script: | - script: |
python -m pip install --upgrade pip setuptools twine python -m pip install --upgrade pip setuptools wheel twine
python test/vso_tools/build_wheel.py $(NNI_RELEASE) python test/vso_tools/build_wheel.py $(NNI_RELEASE)
displayName: Build wheel
if [ $(build_type) = 'release' ] - script: |
if [ $(build_type) = 'release' ]; then
echo '## uploading to pypi ##' echo '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/* python -m twine upload -u nni -p $(pypi_password) dist/*
then
else else
echo '## uploading to testpypi ##' echo '## uploading to testpypi ##'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/* python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
fi fi
displayName: Build and upload wheel displayName: Upload wheel
- job: windows - job: windows
dependsOn: validate_version_number dependsOn: validate_version_number
...@@ -118,9 +122,11 @@ jobs: ...@@ -118,9 +122,11 @@ jobs:
displayName: Configure Python version displayName: Configure Python version
- powershell: | - powershell: |
python -m pip install --upgrade pip setuptools twine python -m pip install --upgrade pip setuptools wheel twine
python test/vso_tools/build_wheel.py $(NNI_RELEASE) python test/vso_tools/build_wheel.py $(NNI_RELEASE)
displayName: Build wheel
- powershell: |
if($env:BUILD_TYPE -eq 'release'){ if($env:BUILD_TYPE -eq 'release'){
Write-Host '## uploading to pypi ##' Write-Host '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/* python -m twine upload -u nni -p $(pypi_password) dist/*
...@@ -129,4 +135,4 @@ jobs: ...@@ -129,4 +135,4 @@ jobs:
Write-Host '## uploading to testpypi ##' Write-Host '## uploading to testpypi ##'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/* python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
} }
displayName: Build and upload wheel displayName: Upload wheel
...@@ -112,10 +112,7 @@ def _setup(): ...@@ -112,10 +112,7 @@ def _setup():
python_requires = '>=3.6', python_requires = '>=3.6',
install_requires = dependencies, install_requires = dependencies,
extras_require = { extras_require = {
'SMAC': [ 'SMAC': ['ConfigSpaceNNI', 'smac4nni'],
'ConfigSpaceNNI @ git+https://github.com/QuanluZhang/ConfigSpace.git',
'smac @ git+https://github.com/QuanluZhang/SMAC3.git'
],
'BOHB': ['ConfigSpace==0.4.7', 'statsmodels==0.10.0'], 'BOHB': ['ConfigSpace==0.4.7', 'statsmodels==0.10.0'],
'PPOTuner': ['enum34', 'gym'] 'PPOTuner': ['enum34', 'gym']
}, },
...@@ -189,6 +186,7 @@ class Build(build): ...@@ -189,6 +186,7 @@ class Build(build):
sys.exit('Please set environment variable "NNI_RELEASE=<release_version>"') sys.exit('Please set environment variable "NNI_RELEASE=<release_version>"')
if os.path.islink('nni_node/main.js'): if os.path.islink('nni_node/main.js'):
sys.exit('A development build already exists. Please uninstall NNI and run "python3 setup.py clean --all".') sys.exit('A development build already exists. Please uninstall NNI and run "python3 setup.py clean --all".')
open('nni/version.py', 'w').write(f"__version__ = '{release}'")
super().run() super().run()
class Develop(develop): class Develop(develop):
...@@ -212,6 +210,7 @@ class Develop(develop): ...@@ -212,6 +210,7 @@ class Develop(develop):
super().finalize_options() super().finalize_options()
def run(self): def run(self):
open('nni/version.py', 'w').write("__version__ = '999.dev0'")
if not self.skip_ts: if not self.skip_ts:
setup_ts.build(release=None) setup_ts.build(release=None)
super().run() super().run()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment