Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #279

Merged
merged 6 commits into from
Dec 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
improve setup.py (microsoft#3164)
Co-authored-by: liuzhe <[email protected]>
  • Loading branch information
liuzhe-lz and liuzhe authored Dec 8, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 622e3331c946defe3be529ee7584d3f713f4c70f
22 changes: 11 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -61,7 +61,6 @@
'hyperopt==0.1.2',
'json_tricks',
'netifaces',
'numpy',
'psutil',
'ruamel.yaml',
'requests',
@@ -74,14 +73,12 @@
'pkginfo',
'websockets',
'filelock',
'prettytable'
'prettytable',
'numpy < 1.19.4 ; sys_platform == "win32"',
'numpy < 1.20 ; sys_platform != "win32" and python_version < "3.7"',
'numpy ; sys.platform != "win32" and python_version >= "3.7"'
]

if sys.platform == 'win32':
dependencies[dependencies.index('numpy')] = 'numpy<1.19.4'
elif sys.version_info < (3, 7):
dependencies[dependencies.index('numpy')] = 'numpy<1.20'

release = os.environ.get('NNI_RELEASE')

def _setup():
@@ -132,7 +129,7 @@ def _setup():
def _find_python_packages():
packages = []
for dirpath, dirnames, filenames in os.walk('nni'):
if '/__pycache__' not in dirpath:
if '/__pycache__' not in dirpath and '/.mypy_cache' not in dirpath:
packages.append(dirpath.replace('/', '.'))
return sorted(packages) + ['nni_node']

@@ -184,14 +181,16 @@ def run(self):

class Develop(develop):
user_options = develop.user_options + [
('no-user', None, 'Prevent automatically adding "--user"')
('no-user', None, 'Prevent automatically adding "--user"'),
('skip-ts', None, 'Prevent building TypeScript modules')
]

boolean_options = develop.boolean_options + ['no-user']
boolean_options = develop.boolean_options + ['no-user', 'skip-ts']

def initialize_options(self):
super().initialize_options()
self.no_user = None
self.skip_ts = None

def finalize_options(self):
# if `--user` or `--no-user` is explicitly set, do nothing
@@ -201,7 +200,8 @@ def finalize_options(self):
super().finalize_options()

def run(self):
setup_ts.build(release=None)
if not self.skip_ts:
setup_ts.build(release=None)
super().run()

class Clean(clean):