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

Have lint run on __init__.py files #737

Closed
dsherry opened this issue Apr 30, 2020 · 3 comments · Fixed by #1234
Closed

Have lint run on __init__.py files #737

dsherry opened this issue Apr 30, 2020 · 3 comments · Fixed by #1234
Assignees
Labels
enhancement An improvement to an existing feature. task Scripting, configuration, or other work which doesn't categorize well as a feature/enhancement/bug. testing Issues related to testing.

Comments

@dsherry
Copy link
Contributor

dsherry commented Apr 30, 2020

This would protect us against typos and errors in those files. Currently we ignore them in our linting. I think there's a potential for defining circular imports as well, and I'm not sure how python reacts to that in these files.

@dsherry dsherry added enhancement An improvement to an existing feature. task Scripting, configuration, or other work which doesn't categorize well as a feature/enhancement/bug. testing Issues related to testing. labels Apr 30, 2020
@gsheni
Copy link
Contributor

gsheni commented May 1, 2020

@dsherry the reason Featuretools avoids linting __init__.py files is because of this:
alteryx/featuretools#747 (comment)

@dsherry
Copy link
Contributor Author

dsherry commented Aug 27, 2020

@rwedge @gsheni what was the problem in alteryx/featuretools#747 (comment) ? I see Roy said:

Our linting-related dependencies were out of date, and this was causing some errors if users were trying run make lint using the latest versions of these packages (example).

That sounds like an environment management problem. Now that we have the dependency update bot, we know that our unit tests pass on the latest version of all our pip dependencies, right? So we'd just need to keep our local development pip versions up to date, just like for any other package we develop against.

@gsheni
Copy link
Contributor

gsheni commented Aug 29, 2020

@dsherry The problem was that the linter (make lint-fix) was reordering the import statements in __init__.py. This would cause the following error to be raised when make lint was ran:

ERROR: /work/featuretools/featuretools/init.py Imports are incorrectly sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to an existing feature. task Scripting, configuration, or other work which doesn't categorize well as a feature/enhancement/bug. testing Issues related to testing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants