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

Mitigate the pylint error caused by setuptools #1625

Merged
merged 1 commit into from
Jan 3, 2017
Merged

Mitigate the pylint error caused by setuptools #1625

merged 1 commit into from
Jan 3, 2017

Conversation

troydai
Copy link
Contributor

@troydai troydai commented Jan 1, 2017

Since 12/12/2016, the CI build on python 3.5-dev began failing while running pylint. The errors are import-error. The error was caused by setuptools. The python 3.5-dev build uses the latest setuptools. A change introduced between 30.4.0 and 31.0.0 add additional .pth file to the installation folder under virtualenv. The files obviously confused the pylint cause import-error in turn.

This change will fix the setuptools version to 30.4.0 to mitigate this issue.

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

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

LGTM. Should probably have Derek weigh in as well.

@troydai
Copy link
Contributor Author

troydai commented Jan 3, 2017

Thank you. I just added @derekbekoe to the reviewers list as well.

@tjprescott
Copy link
Member

tjprescott commented Jan 3, 2017

Even with the older version of setuptools, I'm still getting this import-error behavior with pylint on Python 3.5, but 2.7 works.

@troydai troydai merged commit c9686f1 into Azure:master Jan 3, 2017
@troydai
Copy link
Contributor Author

troydai commented Jan 3, 2017

Respond to @tjprescott last comment. More people may hit this.

To fix the environment your need to:

  1. Deactivate the current virtual environment;
  2. Clean up the virtual environment folder, by default, it is the env folder;
  3. Set up a new virtual environment and enter it;
  4. Run dev_setup.py so that the fix will work.

@@ -25,13 +25,15 @@ def exec_command(command):
print('Running dev setup...')
print('Root directory \'{}\'\n'.format(root_dir))

# install general requirements
exec_command('pip install -r requirements.txt')
Copy link
Member

Choose a reason for hiding this comment

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

@tjprescott There was a reason we has the install of requirements last.
It was to prevent command modules that are installed later from overriding what we have in requirements.txt.
It was with azure-mgmt-keyvault back when we were using the azure rollup package.

@troydai Is this particular change required for this fix to work?

Copy link
Member

Choose a reason for hiding this comment

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

Since the PR has already been merged, I'm just bringing this to attention.

Copy link
Member

Choose a reason for hiding this comment

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

@derekbekoe it was required because otherwise it installs the newest setuptools, screws everything up, and then installs the desired setuptools. However, it seems that KeyVault no longer breaks even with this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok then, so I can move the requirement.txt restore back to the bottom but specifically install setuptools==30.4.0 at the beginning, does it sound good?

Copy link
Member

Choose a reason for hiding this comment

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

Since we don't have the keyvault problem anymore, I have no issue with it as is. :)

Copy link
Member

Choose a reason for hiding this comment

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

I think we no longer have the problem because we now depend on the individual packages. IIRC, the problem originated because we had modules depending on the roll-up package, which would replace the version of KV management that it needed with an older version.

@troydai troydai deleted the fix-pylint branch January 5, 2017 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants