Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pip-deps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCS
pip-deps
Commits
d3a5400a
Commit
d3a5400a
authored
5 years ago
by
Marek Chrastina
Browse files
Options
Downloads
Patches
Plain Diff
Add exclude argument
parent
aa672d5d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!7
If only bdist is available, check if python_version satisfied python platform version
Pipeline
#11105
failed
5 years ago
Stage: test
Stage: build
Stage: check
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+6
-1
6 additions, 1 deletion
README.md
pipdeps/pipdeps.py
+41
-0
41 additions, 0 deletions
pipdeps/pipdeps.py
with
47 additions
and
1 deletion
README.md
+
6
−
1
View file @
d3a5400a
...
...
@@ -15,13 +15,18 @@ situations. Currently, package extras are not finished.
```
console
$
pipdeps
--help
usage: pipdeps [-h] (-l | -t | -u | -s [SHOW [SHOW ...]])
usage: pipdeps [-h] [-e [EXCLUDE [EXCLUDE ...]]]
(-l | -t | -u | -s [SHOW [SHOW ...]])
Pipdeps shows/upgrades outdated packages with respect to existing
dependencies.
optional arguments:
-h, --help show this help message and exit
-e [EXCLUDE [EXCLUDE ...]], --exclude [EXCLUDE [EXCLUDE ...]]
Comma separated list of excluded package (and
version). Format package==version or package for all
versions
-l, --list show list of upgradeable packages and versions
-t, --table show table of upgradeable packages and versions
-u, --upgrade upgrade upgradeable packages
...
...
This diff is collapsed.
Click to expand it.
pipdeps/pipdeps.py
+
41
−
0
View file @
d3a5400a
...
...
@@ -39,6 +39,10 @@ def arg_parse():
description
=
"
Pipdeps shows/upgrades outdated packages with respect to existing
\
dependencies.
"
)
parser
.
add_argument
(
'
-e
'
,
'
--exclude
'
,
nargs
=
'
*
'
,
help
=
"
Space-separated list of excluded package (and version).
\
Format package==version or package for all versions
"
)
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
group
.
add_argument
(
'
-l
'
,
'
--list
'
,
action
=
'
store_true
'
,
...
...
@@ -54,6 +58,14 @@ def arg_parse():
help
=
"
show detailed info about upgradeable packages
"
)
return
parser
.
parse_args
()
def
get_excludes
(
data
):
"""
Parse argument excludes into array of (pkg, ver)
"""
if
data
is
None
:
return
[]
return
[
pkg
.
split
(
"
==
"
)
for
pkg
in
data
]
def
upgrade_package
(
data
):
"""
pip install --upgrade
"
<package>==<versions>
"
...
...
@@ -645,6 +657,33 @@ def get_hards(data, package_no_news):
'
extras
'
:
list
(
set
(
extras
))}
return
out
def
del_excls
(
data
,
excludes
):
"""
Return list of packages and their versions that are excluded by argument
"""
to_delete
=
[]
_package_no_news
,
package_with_news
=
single_multi
(
data
)
package_not_installed
=
not_installed
(
data
)
for
exc
in
excludes
:
try
:
exc_pkg
,
exc_ver
=
exc
[
0
],
exc
[
1
]
except
IndexError
:
exc_pkg
,
exc_ver
=
exc
[
0
],
None
if
exc_pkg
not
in
package_with_news
+
package_not_installed
:
print
"
Warning! Excluded package {} has no upgrades. Ignoring
"
.
format
(
exc_pkg
)
continue
vers
=
[
ver
for
ver
,
_ver_data
in
data
[
exc_pkg
][
'
new_version
'
].
iteritems
()]
if
exc_ver
is
not
None
and
exc_ver
not
in
vers
:
print
"
Warning! Excluded package {}=={} is not upgradable. Ignoring
"
.
format
(
exc_pkg
,
exc_ver
)
continue
if
exc_ver
is
None
:
for
ver
in
vers
:
to_delete
.
append
((
exc_pkg
,
ver
))
else
:
to_delete
.
append
((
exc_pkg
,
exc_ver
))
return
to_delete
def
del_hards
(
data
):
"""
Return list of packages and their versions that does not satisfy
...
...
@@ -1110,7 +1149,9 @@ def main():
"""
os
.
environ
[
"
PYTHONWARNINGS
"
]
=
"
ignore:DEPRECATION
"
arguments
=
arg_parse
()
excludes
=
get_excludes
(
arguments
.
exclude
)
packages_data
=
get_pkg_data
()
packages_data
=
move_incompatible
(
packages_data
,
del_excls
(
packages_data
,
excludes
))
packages_data
=
first_loop
(
packages_data
)
i_branch
=
ibranch
(
packages_data
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment