-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Adding Pycln QA tool to the pre-commit config #5234
Conversation
@@ -1,7 +1,6 @@ | |||
#!/usr/bin/env python | |||
# Learn more: https://github.com/kennethreitz/setup.py | |||
import os | |||
import re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detected and removed by pycln
.
@@ -1,6 +1,6 @@ | |||
from distutils.core import setup | |||
|
|||
from build import * | |||
from build import * # nopycln: import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# nopycln: import
can be replaced with # noqa
if you prefer that.
@@ -1,5 +1,4 @@ | |||
#!/usr/bin/env python | |||
import io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detected and removed by pycln
.
src/poetry/repositories/__init__.py
Outdated
@@ -1,2 +1,5 @@ | |||
from poetry.repositories.pool import Pool | |||
from poetry.repositories.repository import Repository | |||
|
|||
|
|||
__all__ = ["Pool", "Repository"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
@@ -1 +1,4 @@ | |||
from poetry.puzzle.solver import Solver | |||
|
|||
|
|||
__all__ = ["Solver"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
@@ -1 +1,4 @@ | |||
from poetry.publishing.publisher import Publisher | |||
|
|||
|
|||
__all__ = ["Publisher"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
src/poetry/packages/__init__.py
Outdated
from poetry.packages.package_collection import PackageCollection | ||
|
||
|
||
__all__ = ["DependencyPackage", "Locker"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
@@ -1,3 +1,6 @@ | |||
from poetry.mixology.solutions.solutions.python_requirement_solution import ( | |||
PythonRequirementSolution, | |||
) | |||
|
|||
|
|||
__all__ = ["PythonRequirementSolution"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
@@ -1,3 +1,6 @@ | |||
from poetry.mixology.solutions.providers.python_requirement_solution_provider import ( | |||
PythonRequirementSolutionProvider, | |||
) | |||
|
|||
|
|||
__all__ = ["PythonRequirementSolutionProvider"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
@@ -1 +1,4 @@ | |||
from poetry.masonry.builders.editable import EditableBuilder | |||
|
|||
|
|||
__all__ = ["EditableBuilder"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
@@ -1 +1,4 @@ | |||
from poetry.installation.installer import Installer | |||
|
|||
|
|||
__all__ = ["Installer"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @hadialqattan! I'm a huge fan of this addition, and pycln
. thanks for creating it 👏
I just have one question about the import you manually removed
Thank you for showing your interest in my tool, I appreciate that. The import statement that I've removed manually seems like it's not used anywhere in the project. |
src/poetry/packages/__init__.py
Outdated
@@ -3,3 +3,6 @@ | |||
from poetry.packages.dependency_package import DependencyPackage | |||
from poetry.packages.locker import Locker | |||
from poetry.packages.package_collection import PackageCollection | |||
|
|||
|
|||
__all__ = ["DependencyPackage", "Locker", "PackageCollection"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have I added __all__
dunder? __init__.py
without __all__
(Pycln Docs)
I don't know why pre-commit is complaining about something has nothing todo with this PR: pyupgrade................................................................Failed
- hook id: pyupgrade
- exit code: 1
- files were modified by this hook
Rewriting tests/console/commands/test_run.py
Rewriting tests/console/commands/test_show.py |
Rebasing onto master should fix it now (see #5247) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @hadialqattan, this looks good to me. let's wait for more opinions
BTW, I have included a used by section in the README file containing a list of notable projects/organizations that use Pycln. |
A gentle ping... |
@hadialqattan Could you please merge changes from master? I will make sure the team takes a look at this ;) |
Hi @Secrus, sure, I'm gonna work on that as soon as possible. I'll let know you when the PR is ready to go. |
@Secrus I believe that the PR is ready now. |
@hadialqattan sorry for forgetting about this! If you're up for it, https://github.com/python-poetry/poetry-core would definitely benefit from this as well |
That sounds good.. I'm gonna open a PR there as soon as possible! |
@branchvincent it's ready PR360. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Resolves: #5233
Why?
I found a comment from one of your maintainers/active contributors that say a PR adding Pycln to the pre-commit hooks is welcome.
This is the comment:
Also, I found Pycln a good addition to improve the code quality of Poetry, therefore I've created this PR.
BTW, I'm the author of Pycln.