Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Fix develop install #3060

Closed
wants to merge 1 commit into from
Closed

Conversation

ultmaster
Copy link
Contributor

No description provided.

@@ -132,6 +133,7 @@ def prepare_nni_node():
node_src = Path('toolchain/node', node_executable_in_tarball)
node_dst = Path('nni_node', node_executable)
shutil.copyfile(node_src, node_dst)
os.chmod(node_dst, os.stat(node_dst).st_mode | stat.S_IEXEC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shutil.copymode() should be better.

@liuzhe-lz
Copy link
Contributor

liuzhe-lz commented Nov 4, 2020

Empty __init__.py should be unnecessary since Python 3.3. (github cannot comment on empty file)

@@ -164,7 +164,7 @@ def run(self):

class Develop(develop):
def finalize_options(self):
self.user = True # always use `develop --user`
self.user = False # always use `develop --user`
Copy link
Contributor

@liuzhe-lz liuzhe-lz Nov 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to explicitly check conda/venv/virtualenv.
Pip will not fallback to --user when python directory is protected, and the error message will not hint to do so either.

If you don't want to do the check anyway, just remove this function. Forcing to False will make it impossible to install as normal user without venv.

@ultmaster
Copy link
Contributor Author

Empty __init__.py should be unnecessary since Python 3.3. (github cannot comment on empty file)

@liuzhe-lz I added them because on my machine, nnictl cannot be installed at all because tools does not have an __init__.py and all the files within are ignored. I'm using Python 3.7.5 with pip 19.3.1 under conda. Not sure why.

@ultmaster
Copy link
Contributor Author

@liuzhe-lz will open a separate PR to resolve comments (and some other issues, possibly). 👍

@liuzhe-lz
Copy link
Contributor

liuzhe-lz commented Nov 4, 2020

Empty __init__.py should be unnecessary since Python 3.3. (github cannot comment on empty file)

@liuzhe-lz I added them because on my machine, nnictl cannot be installed at all because tools does not have an __init__.py and all the files within are ignored. I'm using Python 3.7.5 with pip 19.3.1 under conda. Not sure why.

How did you install it? For develop mode it just creates an egg link to top level nni folder and there should be nothing to do with "install nnictl".
It is successfully installed on azure pipeline, which uses Python 3.6.

@ultmaster
Copy link
Contributor Author

The issue has been fixed in #3063.

@ultmaster ultmaster closed this Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants