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/
/toolchain/
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
__version__ = '999.0.0-developing'
from .version import __version__
from .runtime.log import init_logger
init_logger()
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
trigger: none
pr: none
jobs:
- job: validate_version_number
pool:
......@@ -49,22 +52,22 @@ jobs:
displayName: Configure Python version
- 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)
displayName: Build wheel
if [ $(build_type) = 'release' ]
- script: |
if [ $(build_type) = 'release' ]; then
echo 'uploading release package to pypi...'
python -m twine upload -u nni -p $(pypi_password) dist/*
then
else
echo 'uploading prerelease package to testpypi...'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
fi
displayName: Build and upload wheel
displayName: Upload wheel
- script: |
if [ $(build_type) = 'release' ]
then
if [ $(build_type) = 'release' ]; then
docker login -u msranni -p $(docker_hub_password)
export IMAGE_NAME=msranni/nni
else
......@@ -92,18 +95,19 @@ jobs:
displayName: Configure Python version
- 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)
displayName: Build wheel
if [ $(build_type) = 'release' ]
- script: |
if [ $(build_type) = 'release' ]; then
echo '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/*
then
else
echo '## uploading to testpypi ##'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
fi
displayName: Build and upload wheel
displayName: Upload wheel
- job: windows
dependsOn: validate_version_number
......@@ -118,9 +122,11 @@ jobs:
displayName: Configure Python version
- 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)
displayName: Build wheel
- powershell: |
if($env:BUILD_TYPE -eq 'release'){
Write-Host '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/*
......@@ -129,4 +135,4 @@ jobs:
Write-Host '## uploading to testpypi ##'
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():
python_requires = '>=3.6',
install_requires = dependencies,
extras_require = {
'SMAC': [
'ConfigSpaceNNI @ git+https://github.com/QuanluZhang/ConfigSpace.git',
'smac @ git+https://github.com/QuanluZhang/SMAC3.git'
],
'SMAC': ['ConfigSpaceNNI', 'smac4nni'],
'BOHB': ['ConfigSpace==0.4.7', 'statsmodels==0.10.0'],
'PPOTuner': ['enum34', 'gym']
},
......@@ -189,6 +186,7 @@ class Build(build):
sys.exit('Please set environment variable "NNI_RELEASE=<release_version>"')
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".')
open('nni/version.py', 'w').write(f"__version__ = '{release}'")
super().run()
class Develop(develop):
......@@ -212,6 +210,7 @@ class Develop(develop):
super().finalize_options()
def run(self):
open('nni/version.py', 'w').write("__version__ = '999.dev0'")
if not self.skip_ts:
setup_ts.build(release=None)
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