Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
base
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
FSL
base
Commits
d4ee2151
Commit
d4ee2151
authored
3 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: query_installed_packages can also consider externally hosted packages
parent
8f081cbf
Branches
master
No related tags found
1 merge request
!45
New update_fsl_package script
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/fsl/sbin/update_fsl_package
+14
-6
14 additions, 6 deletions
share/fsl/sbin/update_fsl_package
with
14 additions
and
6 deletions
share/fsl/sbin/update_fsl_package
+
14
−
6
View file @
d4ee2151
...
...
@@ -246,10 +246,13 @@ class Package:
@ft.lru_cache
def query_installed_packages() -> Dict[str, Package]:
def query_installed_packages(
include_external : bool
) -> Dict[str, Package]:
"""Uses conda to find out the versions of all packages installed in
$FSLDIR, which are sourced from the FSL conda channels.
If "include_external" is True, externally hosted packages that are listed
in EXTERNALLY_HOSTED_PACKAGES are also queried.
Returns a dict of {pkgname : Package} mappings. The "dependencies"
attributes of the package objects are not populated.
"""
...
...
@@ -270,8 +273,11 @@ def query_installed_packages() -> Dict[str, Package]:
# or those listed in the externally
# hosted package list.
for pkg in info:
if pkg['base_url'].rstrip() in channels or \
pkg['name'] in EXTERNALLY_HOSTED_PACKAGES:
internal = pkg['base_url'].rstrip() in channels
external = pkg['name'] in EXTERNALLY_HOSTED_PACKAGES
if internal or (external and include_external):
pkgs[pkg['name']] = Package(pkg['name'],
pkg['version'],
pkg['channel'],
...
...
@@ -565,7 +571,7 @@ def main(argv : Sequence[str] = None):
# Download information about all
# available packages on the FSL
# conda channels.
print('Downloading FSL conda channel
information
...')
print('Downloading FSL conda channel
metadata
...')
channeldata = [download_channel_metadata(PUBLIC_FSL_CHANNEL)]
if args.internal:
channeldata.insert(0, download_channel_metadata(
...
...
@@ -574,8 +580,10 @@ def main(argv : Sequence[str] = None):
password=args.password))
print('Building FSL package list ...')
if args.all: packages = list(query_installed_packages().keys())
else: packages = args.package
if args.all:
packages = list(query_installed_packages(args.external).keys())
else:
packages = args.package
# Identify the versions that are
# available for the packages the
...
...
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