diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2024-03-22 23:30:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 23:30:32 +0100 |
commit | c3eaf4d6cf46e5d9387db851d5dcee113f058710 (patch) | |
tree | 4a1491cae5745a47fc5c94eceaa9ce28c40eab3e /var | |
parent | 397334a4befea7d76c5320824a0742259c225475 (diff) | |
download | spack-c3eaf4d6cf46e5d9387db851d5dcee113f058710.tar.gz spack-c3eaf4d6cf46e5d9387db851d5dcee113f058710.tar.bz2 spack-c3eaf4d6cf46e5d9387db851d5dcee113f058710.tar.xz spack-c3eaf4d6cf46e5d9387db851d5dcee113f058710.zip |
Support for prereleases (#43140)
This adds support for prereleases. Alpha, beta and release candidate
suffixes are ordered in the intuitive way:
```
1.2.0-alpha < 1.2.0-alpha.1 < 1.2.0-beta.2 < 1.2.0-rc.3 < 1.2.0 < 1.2.0-xyz
```
Alpha, beta and rc prereleases are defined as follows: split the version
string into components like before (on delimiters and string boundaries).
If there's a string component `alpha`, `beta` or `rc` followed by an optional
numeric component at the end, then the version is prerelease.
So `1.2.0-alpha.1 == 1.2.0alpha1 == 1.2.0.alpha1` are all the same, as usual.
The strings `alpha`, `beta` and `rc` are chosen because they match semver,
they are sufficiently long to be unambiguous, and and all contain at least
one non-hex character so distinguish them from shasum/digest type suffixes.
The comparison key is now stored as `(release_tuple, prerelease_tuple)`, so in
the above example:
```
((1,2,0),(ALPHA,)) < ((1,2,0),(ALPHA,1)) < ((1,2,0),(BETA,2)) < ((1,2,0),(RC,3)) < ((1,2,0),(FINAL,)) < ((1,2,0,"xyz"), (FINAL,))
```
The version ranges `@1.2.0:` and `@:1.1` do *not* include prereleases of
`1.2.0`.
So for packaging, if the `1.2.0alpha` and `1.2.0` versions have the same constraints on
dependencies, it's best to write
```python
depends_on("x@1:", when="@1.2.0alpha:")
```
However, `@1.2:` does include `1.2.0alpha`. This is because Spack considers
`1.2 < 1.2.0` as distinct versions, with `1.2 < 1.2.0alpha < 1.2.0` as a consequence.
Alternatively, the above `depends_on` statement can thus be written
```python
depends_on("x@1:", when="@1.2:")
```
which can be useful too. A short-hand to include prereleases, but you
can still be explicit to exclude the prerelease by specifying the patch version
number.
### Concretization
Concretization uses a different version order than `<`. Prereleases are ordered
between final releases and develop versions. That way, users should not
have to set `preferred=True` on every final release if they add just one
prerelease to a package. The concretizer is unlikely to pick a prerelease when
final releases are possible.
### Limitations
1. You can't express a range that includes all alpha release but excludes all beta
releases. Only alternative is good old repeated nines: `@:1.2.0alpha99`.
2. The Python ecosystem defaults to `a`, `b`, `rc` strings, so translation of Python versions to
Spack versions requires expansion to `alpha`, `beta`, `rc`. It's mildly annoying, because
this means we may need to compute URLs differently (not done in this commit).
### Hash
Care is taken not to break hashes of versions that do not have a prerelease
suffix.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-azure-cli/package.py | 2 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/py-gtdbtk/package.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/py-azure-cli/package.py b/var/spack/repos/builtin/packages/py-azure-cli/package.py index 43f8f546a8..27cb5a34c5 100644 --- a/var/spack/repos/builtin/packages/py-azure-cli/package.py +++ b/var/spack/repos/builtin/packages/py-azure-cli/package.py @@ -76,7 +76,7 @@ class PyAzureCli(PythonPackage): depends_on("py-azure-mgmt-recoveryservices@0.4.0:0.4", type=("build", "run")) depends_on("py-azure-mgmt-recoveryservicesbackup@0.6.0:0.6", type=("build", "run")) depends_on("py-azure-mgmt-redhatopenshift@0.1.0", type=("build", "run")) - depends_on("py-azure-mgmt-redis@7.0.0:7.0", type=("build", "run")) + depends_on("py-azure-mgmt-redis@7.0", type=("build", "run")) depends_on("py-azure-mgmt-relay@0.1.0:0.1", type=("build", "run")) depends_on("py-azure-mgmt-reservations@0.6.0", type=("build", "run")) depends_on("py-azure-mgmt-search@2.0:2", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-gtdbtk/package.py b/var/spack/repos/builtin/packages/py-gtdbtk/package.py index a78e86eed0..08eda2bc7d 100644 --- a/var/spack/repos/builtin/packages/py-gtdbtk/package.py +++ b/var/spack/repos/builtin/packages/py-gtdbtk/package.py @@ -28,7 +28,7 @@ class PyGtdbtk(PythonPackage): depends_on("py-pydantic@1.9.2:1", type=("build", "run"), when="@2.3.0:") depends_on("prodigal@2.6.2:", type=("build", "run")) depends_on("hmmer@3.1b2:", type=("build", "run")) - depends_on("pplacer@1.1:", type=("build", "run")) + depends_on("pplacer@1.1alpha:", type=("build", "run")) depends_on("fastani@1.32:", type=("build", "run")) depends_on("fasttree@2.1.9:", type=("build", "run")) depends_on("mash@2.2:", type=("build", "run")) |