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
523c396c
Commit
523c396c
authored
Jun 04, 2022
by
Randy Döring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: use is_direct_origin method of Dependency instead of static method
parent
53e50d95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
src/poetry/mixology/term.py
+3
-8
No files found.
src/poetry/mixology/term.py
View file @
523c396c
...
@@ -151,10 +151,6 @@ class Term:
...
@@ -151,10 +151,6 @@ class Term:
"""
"""
return
self
.
intersect
(
other
.
inverse
)
return
self
.
intersect
(
other
.
inverse
)
@staticmethod
def
_is_direct_origin
(
dependency
:
Dependency
)
->
bool
:
return
dependency
.
source_type
in
[
"directory"
,
"file"
,
"url"
,
"git"
]
def
_compatible_dependency
(
self
,
other
:
Dependency
)
->
bool
:
def
_compatible_dependency
(
self
,
other
:
Dependency
)
->
bool
:
return
(
return
(
self
.
dependency
.
is_root
self
.
dependency
.
is_root
...
@@ -164,8 +160,7 @@ class Term:
...
@@ -164,8 +160,7 @@ class Term:
# we do this here to indicate direct origin dependencies are
# we do this here to indicate direct origin dependencies are
# compatible with NVR dependencies
# compatible with NVR dependencies
self
.
dependency
.
complete_name
==
other
.
complete_name
self
.
dependency
.
complete_name
==
other
.
complete_name
and
self
.
_is_direct_origin
(
self
.
dependency
)
and
self
.
dependency
.
is_direct_origin
()
!=
other
.
is_direct_origin
()
!=
self
.
_is_direct_origin
(
other
)
)
)
)
)
...
@@ -178,8 +173,8 @@ class Term:
...
@@ -178,8 +173,8 @@ class Term:
# when creating a new term prefer direct-reference dependencies
# when creating a new term prefer direct-reference dependencies
dependency
=
(
dependency
=
(
other
.
dependency
other
.
dependency
if
not
self
.
_is_direct_origin
(
self
.
dependency
)
if
not
self
.
dependency
.
is_direct_origin
(
)
and
self
.
_is_direct_origin
(
other
.
dependency
)
and
other
.
dependency
.
is_direct_origin
(
)
else
self
.
dependency
else
self
.
dependency
)
)
return
Term
(
dependency
.
with_constraint
(
constraint
),
is_positive
)
return
Term
(
dependency
.
with_constraint
(
constraint
),
is_positive
)
...
...
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