Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
594d4208
Commit
594d4208
authored
Nov 16, 2021
by
Bjorn Neergaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: clean up blanket noqa and type comments
parent
3e1e9953
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
17 deletions
+13
-17
.pre-commit-config.yaml
+3
-1
install-poetry.py
+1
-1
src/poetry/plugins/plugin_manager.py
+4
-6
src/poetry/repositories/legacy_repository.py
+1
-1
src/poetry/utils/_compat.py
+1
-1
src/poetry/utils/env.py
+2
-5
src/poetry/utils/extras.py
+0
-1
tests/compat.py
+1
-1
No files found.
.pre-commit-config.yaml
View file @
594d4208
...
@@ -21,8 +21,10 @@ repos:
...
@@ -21,8 +21,10 @@ repos:
-
repo
:
https://github.com/pre-commit/pygrep-hooks
-
repo
:
https://github.com/pre-commit/pygrep-hooks
rev
:
v1.9.0
rev
:
v1.9.0
hooks
:
hooks
:
-
id
:
python-check-blanket-type-ignore
-
id
:
python-check-mock-methods
-
id
:
python-check-mock-methods
-
id
:
python-use-type-annotations
-
id
:
python-check-blanket-type-ignore
-
id
:
python-check-blanket-noqa
-
repo
:
https://github.com/asottile/yesqa
-
repo
:
https://github.com/asottile/yesqa
rev
:
v1.3.0
rev
:
v1.3.0
...
...
install-poetry.py
View file @
594d4208
...
@@ -213,7 +213,7 @@ def _get_win_folder_with_ctypes(csidl_name):
...
@@ -213,7 +213,7 @@ def _get_win_folder_with_ctypes(csidl_name):
if
WINDOWS
:
if
WINDOWS
:
try
:
try
:
from
ctypes
import
windll
# noqa
from
ctypes
import
windll
# noqa
: F401
_get_win_folder
=
_get_win_folder_with_ctypes
_get_win_folder
=
_get_win_folder_with_ctypes
except
ImportError
:
except
ImportError
:
...
...
src/poetry/plugins/plugin_manager.py
View file @
594d4208
...
@@ -16,12 +16,12 @@ class PluginManager:
...
@@ -16,12 +16,12 @@ class PluginManager:
This class registers and activates plugins.
This class registers and activates plugins.
"""
"""
def
__init__
(
self
,
type
,
disable_plugins
=
False
):
# type: (str, bool) -> None
def
__init__
(
self
,
type
:
str
,
disable_plugins
:
bool
=
False
)
->
None
:
self
.
_type
=
type
self
.
_type
=
type
self
.
_disable_plugins
=
disable_plugins
self
.
_disable_plugins
=
disable_plugins
self
.
_plugins
:
List
[
Plugin
]
=
[]
self
.
_plugins
:
List
[
Plugin
]
=
[]
def
load_plugins
(
self
)
:
# type: () -> None
def
load_plugins
(
self
)
->
None
:
if
self
.
_disable_plugins
:
if
self
.
_disable_plugins
:
return
return
...
@@ -33,7 +33,7 @@ class PluginManager:
...
@@ -33,7 +33,7 @@ class PluginManager:
def
get_plugin_entry_points
(
self
)
->
List
[
entrypoints
.
EntryPoint
]:
def
get_plugin_entry_points
(
self
)
->
List
[
entrypoints
.
EntryPoint
]:
return
entrypoints
.
get_group_all
(
f
"poetry.{self._type}"
)
return
entrypoints
.
get_group_all
(
f
"poetry.{self._type}"
)
def
add_plugin
(
self
,
plugin
):
# type: (Plugin) -> None
def
add_plugin
(
self
,
plugin
:
Plugin
)
->
None
:
if
not
isinstance
(
plugin
,
(
Plugin
,
ApplicationPlugin
)):
if
not
isinstance
(
plugin
,
(
Plugin
,
ApplicationPlugin
)):
raise
ValueError
(
raise
ValueError
(
"The Poetry plugin must be an instance of Plugin or ApplicationPlugin"
"The Poetry plugin must be an instance of Plugin or ApplicationPlugin"
...
@@ -45,9 +45,7 @@ class PluginManager:
...
@@ -45,9 +45,7 @@ class PluginManager:
for
plugin
in
self
.
_plugins
:
for
plugin
in
self
.
_plugins
:
plugin
.
activate
(
*
args
,
**
kwargs
)
plugin
.
activate
(
*
args
,
**
kwargs
)
def
_load_plugin_entrypoint
(
def
_load_plugin_entrypoint
(
self
,
entrypoint
:
entrypoints
.
EntryPoint
)
->
None
:
self
,
entrypoint
):
# type: (entrypoints.EntryPoint) -> None
logger
.
debug
(
f
"Loading the {entrypoint.name} plugin"
)
logger
.
debug
(
f
"Loading the {entrypoint.name} plugin"
)
plugin
=
entrypoint
.
load
()
plugin
=
entrypoint
.
load
()
...
...
src/poetry/repositories/legacy_repository.py
View file @
594d4208
...
@@ -432,5 +432,5 @@ class LegacyRepository(PyPiRepository):
...
@@ -432,5 +432,5 @@ class LegacyRepository(PyPiRepository):
return
Page
(
response
.
url
,
response
.
content
,
response
.
headers
)
return
Page
(
response
.
url
,
response
.
content
,
response
.
headers
)
def
_download
(
self
,
url
,
dest
):
# type: (str, str) -> None
def
_download
(
self
,
url
:
str
,
dest
:
str
)
->
None
:
return
download_file
(
url
,
dest
,
session
=
self
.
session
)
return
download_file
(
url
,
dest
,
session
=
self
.
session
)
src/poetry/utils/_compat.py
View file @
594d4208
...
@@ -5,7 +5,7 @@ try:
...
@@ -5,7 +5,7 @@ try:
from
importlib
import
metadata
from
importlib
import
metadata
except
ImportError
:
except
ImportError
:
# compatibility for python <3.8
# compatibility for python <3.8
import
importlib_metadata
as
metadata
# noqa
import
importlib_metadata
as
metadata
# noqa
: F401
WINDOWS
=
sys
.
platform
==
"win32"
WINDOWS
=
sys
.
platform
==
"win32"
...
...
src/poetry/utils/env.py
View file @
594d4208
...
@@ -78,7 +78,6 @@ def interpreter_version():
...
@@ -78,7 +78,6 @@ def interpreter_version():
def _version_nodot(version):
def _version_nodot(version):
# type: (PythonVersion) -> str
if any(v >= 10 for v in version):
if any(v >= 10 for v in version):
sep = "_"
sep = "_"
else:
else:
...
@@ -161,7 +160,7 @@ import json
...
@@ -161,7 +160,7 @@ import json
import site
import site
import sysconfig
import sysconfig
from distutils.command.install import SCHEME_KEYS
# noqa
from distutils.command.install import SCHEME_KEYS
from distutils.core import Distribution
from distutils.core import Distribution
d = Distribution()
d = Distribution()
...
@@ -275,9 +274,7 @@ class SitePackages:
...
@@ -275,9 +274,7 @@ class SitePackages:
str
,
self
.
_candidates
if
not
writable_only
else
self
.
writable_candidates
str
,
self
.
_candidates
if
not
writable_only
else
self
.
writable_candidates
)
)
)
)
for
distribution
in
metadata
.
PathDistribution
.
discover
(
for
distribution
in
metadata
.
PathDistribution
.
discover
(
name
=
name
,
path
=
path
):
name
=
name
,
path
=
path
):
# type: metadata.PathDistribution
yield
distribution
yield
distribution
def
find_distribution
(
def
find_distribution
(
...
...
src/poetry/utils/extras.py
View file @
594d4208
...
@@ -23,7 +23,6 @@ def get_extra_package_names(
...
@@ -23,7 +23,6 @@ def get_extra_package_names(
in the `extras` section of `poetry.lock`.
in the `extras` section of `poetry.lock`.
:param extra_names: A list of strings specifying names of extra groups to resolve.
:param extra_names: A list of strings specifying names of extra groups to resolve.
"""
"""
from
poetry.core.packages.package
import
Package
# noqa
from
poetry.utils.helpers
import
canonicalize_name
from
poetry.utils.helpers
import
canonicalize_name
if
not
extra_names
:
if
not
extra_names
:
...
...
tests/compat.py
View file @
594d4208
try
:
try
:
import
zipp
import
zipp
except
ImportError
:
except
ImportError
:
import
zipfile
as
zipp
# noqa
import
zipfile
as
zipp
# noqa
: F401
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment