spack list: format version_json#11652
Merged
tgamblin merged 1 commit intospack:developfrom Jun 7, 2019
Merged
Conversation
f5ed0a4 to
d525120
Compare
ax3l
commented
Jun 6, 2019
lib/spack/spack/cmd/list.py
Outdated
| ' "file": "{3}"' | ||
| '}}'.format( | ||
| pkg.name, | ||
| VersionList(pkg.versions).highest(), |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
ba6a08a to
402932d
Compare
alalazo
reviewed
Jun 7, 2019
Member
alalazo
left a comment
There was a problem hiding this comment.
Just a couple of minor comments
lib/spack/spack/version.py
Outdated
| else: | ||
| return self[-1].highest() | ||
|
|
||
| def highest_numeric(self, fallback_all=False): |
Member
There was a problem hiding this comment.
Should we return the highest numeric or the preferred version?
Member
Author
There was a problem hiding this comment.
Good idea, actually highest_numeric(True) is hopefully the preferred one in default settings... Any idea how to adjust this?
Alternatively it's probably ok for a first implementation.
d9226ab to
20f58a4
Compare
List the latest version of each package in JSON encoding. Preparation for consumption for a "spack badge" service.
20f58a4 to
7b81df5
Compare
2 tasks
tgamblin
approved these changes
Jun 7, 2019
| ) for pkg in pkgs | ||
| ]) | ||
| out.write(pkg_latest) | ||
| # important: no trailing comma in JSON arrays |
Merged
carsonwoods
pushed a commit
to carsonwoods/spack
that referenced
this pull request
Jun 27, 2019
List the latest version of each package in JSON encoding. Preparation for consumption for a "spack badge" service.
dev-zero
pushed a commit
to dev-zero/spack
that referenced
this pull request
Aug 13, 2019
List the latest version of each package in JSON encoding. Preparation for consumption for a "spack badge" service.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
List the latest version of each package in JSON encoding.
Preparation for consumption for a "spack badge" service.
[ {"...": "..."}, {"name": "adios2", "latest_version": "2.3.1", "versions": ["develop", "2.3.1", "2.2.0", "2.1.0", "2.0.0"], "homepage": "https://www.olcf.ornl.gov/center-projects/adios/", "file": "https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/adios2/package.py", "maintainers": ["ax3l", "chuckatkins"], "dependencies": {"build": ["cmake", "pkgconfig", "mpi", "zeromq", "hdf5", "adios", "bzip2", "zfp", "python", "py-numpy", "py-mpi4py"], "link": ["mpi", "zeromq", "hdf5", "adios", "bzip2", "zfp", "python"], "run": ["python", "py-numpy", "py-mpi4py"], "test": []}}, {"...": "..."}, {"name": "zsh", "latest_version": "5.4.2", "versions": ["5.4.2", "5.3.1", "5.1.1"], "homepage": "http://www.zsh.org", "file": "https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/zsh/package.py", "maintainers": [], "dependencies": {"build": ["pcre", "ncurses"], "link": ["pcre", "ncurses"], "run": [], "test": []}}, {"name": "zstd", "latest_version": "1.4.0", "versions": ["1.4.0", "1.3.8", "1.3.0", "1.1.2"], "homepage": "http://facebook.github.io/zstd/", "file": "https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/zstd/package.py", "maintainers": [], "dependencies": {"build": [], "link": [], "run": [], "test": []}} ]Generating a package index suitable for RESTful consumption in a static HTML service: