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
aa672d5d
Commit
aa672d5d
authored
5 years ago
by
Marek Chrastina
Browse files
Options
Downloads
Patches
Plain Diff
There is show list and show table arguments now
parent
8cc0ee1f
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
#11090
failed
5 years ago
Stage: test
Stage: build
Stage: check
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+3
-2
3 additions, 2 deletions
.gitlab-ci.yml
README.md
+5
-4
5 additions, 4 deletions
README.md
pipdeps/pipdeps.py
+24
-7
24 additions, 7 deletions
pipdeps/pipdeps.py
with
32 additions
and
13 deletions
.gitlab-ci.yml
+
3
−
2
View file @
aa672d5d
...
@@ -58,8 +58,9 @@ Install test:
...
@@ -58,8 +58,9 @@ Install test:
-
pip install --upgrade pip setuptools
-
pip install --upgrade pip setuptools
-
pip install dist/pipdeps*tar.gz
-
pip install dist/pipdeps*tar.gz
-
pip list
-
pip list
-
pipdeps -l ||
true
-
pipdeps --list ||
true
-
pipdeps -u
-
pipdeps --table ||
true
-
pipdeps --upgrade
versioncheck
:
versioncheck
:
stage
:
check
stage
:
check
...
...
This diff is collapsed.
Click to expand it.
README.md
+
5
−
4
View file @
aa672d5d
...
@@ -14,16 +14,17 @@ situations. Currently, package extras are not finished.
...
@@ -14,16 +14,17 @@ situations. Currently, package extras are not finished.
## Usage
## Usage
```
console
```
console
$
pipdeps
.py
--help
$
pipdeps
--help
usage: pipdeps
.py
[-h] (-l | -u | -s SHOW [SHOW ...])
usage: pipdeps [-h] (-l |
-t |
-u | -s
[
SHOW [SHOW ...]
]
)
Pipdeps shows/upgrades outdated packages with respect to existing
Pipdeps shows/upgrades outdated packages with respect to existing
dependencies.
dependencies.
optional arguments:
optional arguments:
-h, --help show this help message and exit
-h, --help show this help message and exit
-l, --list show upgradeable packages and versions
-l, --list show list of upgradeable packages and versions
-t, --table show table of upgradeable packages and versions
-u, --upgrade upgrade upgradeable packages
-u, --upgrade upgrade upgradeable packages
-s SHOW [SHOW ...], --show SHOW [SHOW ...]
-s
[
SHOW [SHOW ...]
]
, --show
[
SHOW [SHOW ...]
]
show detailed info about upgradeable packages
show detailed info about upgradeable packages
```
```
This diff is collapsed.
Click to expand it.
pipdeps/pipdeps.py
+
24
−
7
View file @
aa672d5d
...
@@ -42,7 +42,10 @@ def arg_parse():
...
@@ -42,7 +42,10 @@ def arg_parse():
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
group
.
add_argument
(
'
-l
'
,
'
--list
'
,
group
.
add_argument
(
'
-l
'
,
'
--list
'
,
action
=
'
store_true
'
,
action
=
'
store_true
'
,
help
=
"
show upgradeable packages and versions
"
)
help
=
"
show list of upgradeable packages and versions
"
)
group
.
add_argument
(
'
-t
'
,
'
--table
'
,
action
=
'
store_true
'
,
help
=
"
show table of upgradeable packages and versions
"
)
group
.
add_argument
(
'
-u
'
,
'
--upgrade
'
,
group
.
add_argument
(
'
-u
'
,
'
--upgrade
'
,
action
=
'
store_true
'
,
action
=
'
store_true
'
,
help
=
"
upgrade upgradeable packages
"
)
help
=
"
upgrade upgradeable packages
"
)
...
@@ -223,9 +226,9 @@ def select_upkgs(data, rkey):
...
@@ -223,9 +226,9 @@ def select_upkgs(data, rkey):
result
.
append
(
pkg
)
result
.
append
(
pkg
)
return
result
return
result
def
print_
list
(
data
):
def
print_
table
(
data
):
"""
"""
Print upgradeable versions
Print
table
upgradeable versions
"""
"""
upkgs
=
select_upkgs
(
data
,
'
upgradeable_version
'
)
upkgs
=
select_upkgs
(
data
,
'
upgradeable_version
'
)
if
not
upkgs
:
if
not
upkgs
:
...
@@ -234,10 +237,22 @@ def print_list(data):
...
@@ -234,10 +237,22 @@ def print_list(data):
tab_data
=
[]
tab_data
=
[]
for
pkg
in
sorted
(
upkgs
):
for
pkg
in
sorted
(
upkgs
):
tab_data
.
append
([
pkg
,
data
[
pkg
][
'
installed_version
'
],
data
[
pkg
][
'
upgradeable_version
'
]])
tab_data
.
append
([
pkg
,
data
[
pkg
][
'
installed_version
'
],
data
[
pkg
][
'
upgradeable_version
'
]])
print
tabulate
.
tabulate
(
print
tabulate
.
tabulate
(
tab_data
,
tab_data
,
[
'
package
'
,
'
installed_version
'
,
'
upgradeable_version
'
])
[
'
package
'
,
'
installed_version
'
,
'
upgradeable_version
'
]
return
1
)
def
print_list
(
data
):
"""
Print list upgradeable versions
"""
upkgs
=
select_upkgs
(
data
,
'
upgradeable_version
'
)
if
not
upkgs
:
print
"
There is nothing to upgrade.
"
return
0
list_data
=
[]
for
pkg
in
sorted
(
upkgs
):
list_data
.
append
(
"
%s==%s
"
%
(
pkg
,
data
[
pkg
][
'
upgradeable_version
'
]))
print
"
"
.
join
(
list_data
,)
return
1
return
1
def
write_metadata
(
tmp_file
):
def
write_metadata
(
tmp_file
):
...
@@ -1106,6 +1121,8 @@ def main():
...
@@ -1106,6 +1121,8 @@ def main():
check_co_branches
(
packages_data
)
check_co_branches
(
packages_data
)
check_extras
(
packages_data
)
check_extras
(
packages_data
)
if
arguments
.
table
:
sys
.
exit
(
print_table
(
packages_data
))
if
arguments
.
list
:
if
arguments
.
list
:
sys
.
exit
(
print_list
(
packages_data
))
sys
.
exit
(
print_list
(
packages_data
))
if
arguments
.
show
is
not
None
:
if
arguments
.
show
is
not
None
:
...
...
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