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
3e1e9953
Commit
3e1e9953
authored
Nov 16, 2021
by
Bjorn Neergaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: strip garbage '# noqa' with yesqa
parent
5b0c007b
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
31 additions
and
27 deletions
+31
-27
.pre-commit-config.yaml
+10
-4
install-poetry.py
+3
-3
src/poetry/console/commands/new.py
+1
-1
src/poetry/console/commands/plugin/add.py
+2
-2
src/poetry/console/commands/plugin/remove.py
+1
-1
src/poetry/console/commands/show.py
+1
-1
src/poetry/console/logging/io_handler.py
+1
-1
src/poetry/installation/executor.py
+1
-1
src/poetry/layouts/layout.py
+1
-1
src/poetry/masonry/builders/editable.py
+1
-1
src/poetry/packages/project_package.py
+2
-2
src/poetry/poetry.py
+1
-1
src/poetry/utils/env.py
+1
-1
src/poetry/utils/extras.py
+1
-1
tests/conftest.py
+2
-4
tests/console/commands/plugin/conftest.py
+1
-1
tests/helpers.py
+1
-1
No files found.
.pre-commit-config.yaml
View file @
3e1e9953
...
@@ -24,6 +24,15 @@ repos:
...
@@ -24,6 +24,15 @@ repos:
-
id
:
python-check-blanket-type-ignore
-
id
:
python-check-blanket-type-ignore
-
id
:
python-check-mock-methods
-
id
:
python-check-mock-methods
-
repo
:
https://github.com/asottile/yesqa
rev
:
v1.3.0
hooks
:
-
id
:
yesqa
additional_dependencies
:
&flake8_deps
-
flake8-bugbear==21.9.2
-
flake8-comprehensions==3.7.0
-
flake8-typing-imports==1.11.0
-
repo
:
https://github.com/pycqa/isort
-
repo
:
https://github.com/pycqa/isort
rev
:
5.10.1
rev
:
5.10.1
hooks
:
hooks
:
...
@@ -44,10 +53,7 @@ repos:
...
@@ -44,10 +53,7 @@ repos:
rev
:
4.0.1
rev
:
4.0.1
hooks
:
hooks
:
-
id
:
flake8
-
id
:
flake8
additional_dependencies
:
additional_dependencies
:
*flake8_deps
-
flake8-bugbear==21.9.2
-
flake8-comprehensions==3.7.0
-
flake8-typing-imports==1.11.0
-
repo
:
https://github.com/pre-commit/mirrors-mypy
-
repo
:
https://github.com/pre-commit/mirrors-mypy
rev
:
v0.910-1
rev
:
v0.910-1
...
...
install-poetry.py
View file @
3e1e9953
...
@@ -580,7 +580,7 @@ class Installer:
...
@@ -580,7 +580,7 @@ class Installer:
try
:
try
:
self
.
_install_comment
(
version
,
"Creating environment"
)
self
.
_install_comment
(
version
,
"Creating environment"
)
yield
VirtualEnvironment
.
make
(
env_path
)
yield
VirtualEnvironment
.
make
(
env_path
)
except
Exception
as
e
:
# noqa
except
Exception
as
e
:
if
env_path
.
exists
():
if
env_path
.
exists
():
self
.
_install_comment
(
self
.
_install_comment
(
version
,
"An error occurred. Removing partial environment."
version
,
"An error occurred. Removing partial environment."
...
@@ -871,7 +871,7 @@ def main():
...
@@ -871,7 +871,7 @@ def main():
try
:
try
:
return
installer
.
run
()
return
installer
.
run
()
except
PoetryInstallationError
as
e
:
except
PoetryInstallationError
as
e
:
installer
.
_write
(
colorize
(
"error"
,
"Poetry installation failed."
))
# noqa
installer
.
_write
(
colorize
(
"error"
,
"Poetry installation failed."
))
if
e
.
log
is
not
None
:
if
e
.
log
is
not
None
:
import
traceback
import
traceback
...
@@ -882,7 +882,7 @@ def main():
...
@@ -882,7 +882,7 @@ def main():
dir
=
str
(
Path
.
cwd
()),
dir
=
str
(
Path
.
cwd
()),
text
=
True
,
text
=
True
,
)
)
installer
.
_write
(
colorize
(
"error"
,
f
"See {path} for error logs."
))
# noqa
installer
.
_write
(
colorize
(
"error"
,
f
"See {path} for error logs."
))
text
=
f
"{e.log}
\n
Traceback:
\n\n
{''.join(traceback.format_tb(e.__traceback__))}"
text
=
f
"{e.log}
\n
Traceback:
\n\n
{''.join(traceback.format_tb(e.__traceback__))}"
Path
(
path
)
.
write_text
(
text
)
Path
(
path
)
.
write_text
(
text
)
...
...
src/poetry/console/commands/new.py
View file @
3e1e9953
...
@@ -85,6 +85,6 @@ class NewCommand(Command):
...
@@ -85,6 +85,6 @@ class NewCommand(Command):
self
.
line
(
self
.
line
(
"Created package <info>{}</> in <fg=blue>{}</>"
.
format
(
"Created package <info>{}</> in <fg=blue>{}</>"
.
format
(
layout_
.
_package_name
,
path
.
as_posix
()
# noqa
layout_
.
_package_name
,
path
.
as_posix
()
)
)
)
)
src/poetry/console/commands/plugin/add.py
View file @
3e1e9953
...
@@ -12,8 +12,8 @@ from ..init import InitCommand
...
@@ -12,8 +12,8 @@ from ..init import InitCommand
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
poetry.console.application
import
Application
# noqa
from
poetry.console.application
import
Application
from
poetry.console.commands.update
import
UpdateCommand
# noqa
from
poetry.console.commands.update
import
UpdateCommand
class
PluginAddCommand
(
InitCommand
):
class
PluginAddCommand
(
InitCommand
):
...
...
src/poetry/console/commands/plugin/remove.py
View file @
3e1e9953
...
@@ -10,7 +10,7 @@ from poetry.console.commands.command import Command
...
@@ -10,7 +10,7 @@ from poetry.console.commands.command import Command
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
poetry.console.application
import
Application
# noqa
from
poetry.console.application
import
Application
from
poetry.console.commands.remove
import
RemoveCommand
from
poetry.console.commands.remove
import
RemoveCommand
...
...
src/poetry/console/commands/show.py
View file @
3e1e9953
...
@@ -10,7 +10,7 @@ from .env_command import EnvCommand
...
@@ -10,7 +10,7 @@ from .env_command import EnvCommand
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
cleo.io.io
import
IO
# noqa
from
cleo.io.io
import
IO
from
poetry.core.packages.dependency
import
Dependency
from
poetry.core.packages.dependency
import
Dependency
from
poetry.core.packages.package
import
Package
from
poetry.core.packages.package
import
Package
...
...
src/poetry/console/logging/io_handler.py
View file @
3e1e9953
...
@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING
...
@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
logging
import
LogRecord
from
logging
import
LogRecord
from
cleo.io.io
import
IO
# noqa
from
cleo.io.io
import
IO
class
IOHandler
(
logging
.
Handler
):
class
IOHandler
(
logging
.
Handler
):
...
...
src/poetry/installation/executor.py
View file @
3e1e9953
...
@@ -37,7 +37,7 @@ from .operations.update import Update
...
@@ -37,7 +37,7 @@ from .operations.update import Update
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
cleo.io.io
import
IO
# noqa
from
cleo.io.io
import
IO
from
poetry.config.config
import
Config
from
poetry.config.config
import
Config
from
poetry.repositories
import
Pool
from
poetry.repositories
import
Pool
...
...
src/poetry/layouts/layout.py
View file @
3e1e9953
...
@@ -47,7 +47,7 @@ class Layout:
...
@@ -47,7 +47,7 @@ class Layout:
description
:
str
=
""
,
description
:
str
=
""
,
readme_format
:
str
=
"md"
,
readme_format
:
str
=
"md"
,
author
:
Optional
[
str
]
=
None
,
author
:
Optional
[
str
]
=
None
,
license
:
Optional
[
str
]
=
None
,
# noqa
license
:
Optional
[
str
]
=
None
,
python
:
str
=
"*"
,
python
:
str
=
"*"
,
dependencies
:
Optional
[
Dict
[
str
,
str
]]
=
None
,
dependencies
:
Optional
[
Dict
[
str
,
str
]]
=
None
,
dev_dependencies
:
Optional
[
Dict
[
str
,
str
]]
=
None
,
dev_dependencies
:
Optional
[
Dict
[
str
,
str
]]
=
None
,
...
...
src/poetry/masonry/builders/editable.py
View file @
3e1e9953
...
@@ -18,7 +18,7 @@ from poetry.utils.pip import pip_editable_install
...
@@ -18,7 +18,7 @@ from poetry.utils.pip import pip_editable_install
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
cleo.io.io
import
IO
# noqa
from
cleo.io.io
import
IO
from
poetry.core.poetry
import
Poetry
from
poetry.core.poetry
import
Poetry
from
poetry.utils.env
import
Env
from
poetry.utils.env
import
Env
...
...
src/poetry/packages/project_package.py
View file @
3e1e9953
...
@@ -6,14 +6,14 @@ from poetry.core.packages.project_package import ProjectPackage as _ProjectPacka
...
@@ -6,14 +6,14 @@ from poetry.core.packages.project_package import ProjectPackage as _ProjectPacka
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
poetry.core.semver.version
import
Version
# noqa
from
poetry.core.semver.version
import
Version
class
ProjectPackage
(
_ProjectPackage
):
class
ProjectPackage
(
_ProjectPackage
):
def
set_version
(
def
set_version
(
self
,
version
:
Union
[
str
,
"Version"
],
pretty_version
:
Optional
[
str
]
=
None
self
,
version
:
Union
[
str
,
"Version"
],
pretty_version
:
Optional
[
str
]
=
None
)
->
None
:
)
->
None
:
from
poetry.core.semver.version
import
Version
# noqa
from
poetry.core.semver.version
import
Version
if
not
isinstance
(
version
,
Version
):
if
not
isinstance
(
version
,
Version
):
self
.
_version
=
Version
.
parse
(
version
)
self
.
_version
=
Version
.
parse
(
version
)
...
...
src/poetry/poetry.py
View file @
3e1e9953
...
@@ -29,7 +29,7 @@ class Poetry(BasePoetry):
...
@@ -29,7 +29,7 @@ class Poetry(BasePoetry):
locker
:
"Locker"
,
locker
:
"Locker"
,
config
:
"Config"
,
config
:
"Config"
,
):
):
from
.repositories.pool
import
Pool
# noqa
from
.repositories.pool
import
Pool
super
(
Poetry
,
self
)
.
__init__
(
file
,
local_config
,
package
)
super
(
Poetry
,
self
)
.
__init__
(
file
,
local_config
,
package
)
...
...
src/poetry/utils/env.py
View file @
3e1e9953
...
@@ -1467,7 +1467,7 @@ class SystemEnv(Env):
...
@@ -1467,7 +1467,7 @@ class SystemEnv(Env):
# to get the proper ones.
# to get the proper ones.
import
site
import
site
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
()
...
...
src/poetry/utils/extras.py
View file @
3e1e9953
...
@@ -7,7 +7,7 @@ from typing import Sequence
...
@@ -7,7 +7,7 @@ from typing import Sequence
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
poetry.core.packages.package
import
Package
# noqa
from
poetry.core.packages.package
import
Package
def
get_extra_package_names
(
def
get_extra_package_names
(
...
...
tests/conftest.py
View file @
3e1e9953
...
@@ -174,7 +174,7 @@ def download_mock(mocker):
...
@@ -174,7 +174,7 @@ def download_mock(mocker):
@pytest.fixture
(
autouse
=
True
)
@pytest.fixture
(
autouse
=
True
)
def
pep517_metadata_mock
(
mocker
):
def
pep517_metadata_mock
(
mocker
):
@classmethod
# noqa
@classmethod
def
_pep517_metadata
(
cls
,
path
):
def
_pep517_metadata
(
cls
,
path
):
try
:
try
:
return
PackageInfo
.
from_setup_files
(
path
)
return
PackageInfo
.
from_setup_files
(
path
)
...
@@ -335,9 +335,7 @@ def project_factory(tmp_dir, config, repo, installed, default_python):
...
@@ -335,9 +335,7 @@ def project_factory(tmp_dir, config, repo, installed, default_python):
poetry
=
Factory
()
.
create_poetry
(
project_dir
)
poetry
=
Factory
()
.
create_poetry
(
project_dir
)
locker
=
TestLocker
(
locker
=
TestLocker
(
poetry
.
locker
.
lock
.
path
,
poetry
.
locker
.
_local_config
)
poetry
.
locker
.
lock
.
path
,
poetry
.
locker
.
_local_config
)
# noqa
locker
.
write
()
locker
.
write
()
poetry
.
set_locker
(
locker
)
poetry
.
set_locker
(
locker
)
...
...
tests/console/commands/plugin/conftest.py
View file @
3e1e9953
...
@@ -18,7 +18,7 @@ def installed():
...
@@ -18,7 +18,7 @@ def installed():
def
configure_sources_factory
(
repo
):
def
configure_sources_factory
(
repo
):
def
_configure_sources
(
poetry
,
sources
,
config
,
io
):
# noqa
def
_configure_sources
(
poetry
,
sources
,
config
,
io
):
pool
=
Pool
()
pool
=
Pool
()
pool
.
add_repository
(
repo
)
pool
.
add_repository
(
repo
)
poetry
.
set_pool
(
pool
)
poetry
.
set_pool
(
pool
)
...
...
tests/helpers.py
View file @
3e1e9953
...
@@ -148,7 +148,7 @@ class PoetryTestApplication(Application):
...
@@ -148,7 +148,7 @@ class PoetryTestApplication(Application):
class
TestLocker
(
Locker
):
class
TestLocker
(
Locker
):
def
__init__
(
self
,
lock
,
local_config
):
# noqa
def
__init__
(
self
,
lock
,
local_config
):
self
.
_lock
=
TOMLFile
(
lock
)
self
.
_lock
=
TOMLFile
(
lock
)
self
.
_local_config
=
local_config
self
.
_local_config
=
local_config
self
.
_lock_data
=
None
self
.
_lock_data
=
None
...
...
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