Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from upstream including buildcache fix https://github.com/spack/spack/pull/46074 #436

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
f19b657
VTK package: patch to fix NetCDFC - HDF5 interface (#43087)
johnwparent Aug 22, 2024
1bcb1fc
Windows: port tests for mirror/blame (#45259)
nicolecheetham Aug 22, 2024
d5eefcb
llvm-amdgpu: Conflict with MacOS (#45633)
stephenswat Aug 22, 2024
ead25b1
Add a new audit to find missing package.py files (#45868)
alalazo Aug 22, 2024
823a2c1
kokkos-tools: add new package (#45382)
rbberger Aug 23, 2024
8b81117
removing -Ofast with aocc (#45880)
amd-toolchain-support Aug 23, 2024
ef45c39
py-scipy: add v1.14.1 (#45847)
adamjstewart Aug 23, 2024
c49269f
poppler: change the URL of the test repository (#45857)
jmcarcell Aug 23, 2024
88bcfdd
New package: linux-external-modules (#45797)
kyotsukete Aug 23, 2024
3ee6a5b
py-ipykernel: add version 6.29.5 (#45876)
ChristopherChristofi Aug 23, 2024
ed34dfc
xrootd: change urls to xrootd.web.cern.ch (#45895)
wdconinc Aug 23, 2024
d40f847
Add missing MultiMethodMeta metaclass in builders (#45879)
haampie Aug 23, 2024
b8cbbb8
spack create: add depends_on(<lang>) statements (#45296)
haampie Aug 23, 2024
f96e875
acts: add v36.0.0, v36.1.0 and fixes (#45874)
stephenswat Aug 23, 2024
bd62746
py-autograd: mark numpy 2 compatibility (#45942)
adamjstewart Aug 23, 2024
5a9dbcc
ddt: add v23.0.4 -> v24.0.3 (#45861)
wdconinc Aug 23, 2024
fff8165
davix: add versions 0.8.2-0.8.7 and dependencies (#45853)
stephenswat Aug 23, 2024
86050de
gromacs: add env mods for cufftmp w/ gcc (#45887)
snehring Aug 23, 2024
dcdcab7
VTK-m: Point to github mirror for source tarball (#45893)
kwryankrattiger Aug 23, 2024
906799e
add SuperLU_MT v4.0.1 (#45924)
gardner48 Aug 23, 2024
47e79c3
Substitute `__import__` with `importlib.import_module` (#45965)
alalazo Aug 23, 2024
296e530
mirror: fetch by digest (#45809)
haampie Aug 24, 2024
1f1021a
PythonExtension: use different bin dir on Windows (#45427)
johnwparent Aug 24, 2024
94c99fc
variant.py: extract spec bits into spec.py (#45941)
haampie Aug 24, 2024
eccecba
Python: add v3.12.5, default to latest version (#45712)
adamjstewart Aug 26, 2024
aa49b3d
lshw: add v02.20 (#46028)
wdconinc Aug 26, 2024
2de712b
netfilter pkgs: avoid 3rd party urls, add latest official version (#4…
wdconinc Aug 26, 2024
02f329a
compilers: avoid redundant fs operations and cache (#46031)
haampie Aug 26, 2024
480d6f9
cppunit: add v1.15.1; deprecate custom commit version (#46026)
wdconinc Aug 26, 2024
a8e2519
root: patch v6.22.08 (#46019)
JamesJieranShen Aug 26, 2024
a5436b3
R: external detection (#46023)
wdconinc Aug 26, 2024
85939b2
mrbayes: readline and mpi variants are mutually exclusive (#46021)
draenog Aug 26, 2024
fa704e8
polyml: add new package (#46020)
draenog Aug 26, 2024
1d70ab9
`ci generate`: don't warn when no cdash config (#46004)
tgamblin Aug 26, 2024
8c1d618
gaudi: remove redundant dependency on cppgsl (#46029)
jmcarcell Aug 26, 2024
f079ad3
r-sf: deprecate unconcretizable 0.5-5 (#46016)
wdconinc Aug 26, 2024
8bcd64c
r-diagram: fix dependency on non-existent R version (#46003)
wdconinc Aug 26, 2024
986325e
r-pbkrtest: fix typo in dependency (#45997)
wdconinc Aug 26, 2024
4ede0ae
seacas: add parallel as a dependency (#45981)
mvlopri Aug 26, 2024
a782e6b
r-googlesheets4: fix r-gargle dependency (#45980)
wdconinc Aug 26, 2024
8c92836
cuda: add v12.6 (#45558)
pauleonix Aug 26, 2024
e5c045c
kokkos: add v4.4.00 (#45758)
diehlpk Aug 26, 2024
afa76eb
py-smp: add v0.3.4 (#45967)
adamjstewart Aug 26, 2024
fdfb4e9
mruby: add v3.3.0 (#45964)
mdorier Aug 26, 2024
199653d
Bugfix/hsakmt-roct: use correct version for rocm-core and llvm-amdgpu…
tldahlgren Aug 26, 2024
904d85b
fastjson: add v1.2.83, v2.0.52 (#45733)
wdconinc Aug 26, 2024
cd6ee96
parallel-hashmap: add v1.3.12 (#46017)
pranav-sivaraman Aug 26, 2024
497e19f
distro.py: avoid excessive stat calls (#46030)
haampie Aug 26, 2024
a60d108
jsonschema: remove optional deps (#46041)
haampie Aug 26, 2024
c7001ef
sundials: new test API (#45373)
AcriusWinter Aug 26, 2024
76957f1
nvpl-fft: new package (#45985)
rbberger Aug 27, 2024
680d1f2
lammps: improve FFT selection and add fft_kokkos variant (#45969)
hagertnl Aug 27, 2024
9007659
Added [email protected] (#46043)
FrederickDeny Aug 27, 2024
297e43b
abi.py: remove (#46047)
haampie Aug 27, 2024
9a91f02
Move `spack.compilers._to_dict` to `Compiler` (#46051)
alalazo Aug 27, 2024
2d83707
acts: add version 36.2.0 (#46052)
stephenswat Aug 27, 2024
cbe18d9
detray: add version 0.73.0 (#46053)
stephenswat Aug 27, 2024
394e615
Remove a few unused classes and globals (#46054)
alalazo Aug 27, 2024
229cf49
bfs: add v4.0.1 (#46044)
alecbcs Aug 27, 2024
0fee2c2
config.py: tell don't ask (#46040)
haampie Aug 27, 2024
1297673
Remove "prevent_cray_detection" context manager (#46060)
alalazo Aug 27, 2024
9d8f94a
spack_yaml: delete custom deepcopy (#46048)
haampie Aug 27, 2024
b1af32c
Introduce offload variant for llvm >= 19. (#45865)
ye-luo Aug 27, 2024
b1b21a4
cdo-2.4.3 (#46033)
Try2Code Aug 27, 2024
59b4b78
py-numpy: add v2.0.2 (#46056)
adamjstewart Aug 27, 2024
df57e1c
Remove llnl.util.lang.has_method, use built-in hasattr instead (#46072)
alalazo Aug 28, 2024
25ba312
Spec.from_detection now accounts for external prefix (#46063)
alalazo Aug 28, 2024
202e648
gromacs: add conflict between NVSHMEM and cuFFTMp (#46065)
mabraham Aug 28, 2024
fb4811e
Drop now redundant use of inspect (#46057)
haampie Aug 28, 2024
85487f2
buildcache.py: elide string not spec (#46074)
haampie Aug 28, 2024
b9e4e98
boost: install `BoostConfig.cmake` even when header-only (#46062)
msimberg Aug 28, 2024
8b5521e
Replace unparsable apostrophe character with ASCII "'". (#46069)
nicholas-sly Aug 28, 2024
6b0011c
For "when:" and install_environment.json: Support fully qualified hos…
Jordan474 Aug 28, 2024
6a1dfbd
mfem, pflotran, alquimia: remove old versions with xsdk string (in ve…
balay Aug 28, 2024
4c91e62
Don't check checksums on spack-develop packages (#46076)
Jordan474 Aug 28, 2024
ec0a57c
py-numcodecs rename git branch to match upstream (#46085)
robertu94 Aug 28, 2024
ee27dc5
llvm-amdgpu: Updating LD_LIBRARY_PATH w.r.t new prefix path (#45940)
renjithravindrankannath Aug 28, 2024
0eb8f4f
pmix: add v5.0.3 and fix variants (#45621)
drkrynstrng Aug 28, 2024
7e1ad8f
[Update] New version of sirius (#46049)
mtaillefumier Aug 28, 2024
ec85bbe
perl-compress-bzip2: new package (#46055)
EbiArnie Aug 28, 2024
6997350
Add more compiler leniency (#46083)
etiennemlb Aug 28, 2024
f9065f0
Remove "get_compiler_duplicates" (#46077)
alalazo Aug 29, 2024
fe8f631
tau: fix (cray) compiler names/paths (#46104)
haampie Aug 29, 2024
b6ff126
Executable: make the timeout message readable (#46098)
tldahlgren Aug 29, 2024
093b273
py-mypy: add v1.11.2 (#46099)
wdconinc Aug 29, 2024
9a16927
paraview: add cdi support (#44222)
albestro Aug 29, 2024
dc3f5cd
windows_establish_runtime_linkage: post install hook (#46103)
haampie Aug 29, 2024
0535705
py-greenlet: add missing forward compat bound (#46113)
haampie Aug 29, 2024
c3e9bd4
spectrum-mpi: no windows (#46119)
haampie Aug 29, 2024
c5766aa
linaro-forge: added 24.0.4 version (#46112)
louspe-linaro Aug 29, 2024
cade66d
CMakePackage: Set policy CMP0042 NEW on macos (#46114)
Chrismarsh Aug 29, 2024
3589edc
conduit package: Honor compiler extra_rpaths + extras (#46046)
white238 Aug 29, 2024
73fc86c
gromacs: support version 2024.3 (#46117)
mabraham Aug 29, 2024
bd71ce5
cray: allow failure due to broken blas (#46111)
haampie Aug 30, 2024
82dea7e
mpitrampoline: fix wrong use of compiler.cc_names (#46038)
alalazo Aug 30, 2024
199cbce
windows-vis: vtk~mpi (#46133)
haampie Aug 30, 2024
c283fce
Remove `DetectedPackage` class (#46071)
alalazo Aug 30, 2024
1c1970e
Put some more constraint on a few mpi providers (#46132)
alalazo Aug 30, 2024
dd756d5
windows-vis: fix failing pipeline (#46135)
haampie Aug 30, 2024
bf1f4e1
boost: remove Compiler.cxx_names (#46037)
alalazo Aug 30, 2024
f88ca8c
plumed: add v2.9.1 (#46022)
draenog Aug 30, 2024
1427735
unzip: use more generic strip flag for cce (#46087)
etiennemlb Aug 30, 2024
db311ee
build(deps): bump actions/upload-artifact from 4.3.6 to 4.4.0 (#46149)
dependabot[bot] Aug 31, 2024
8cac746
sfcio: add v1.4.2 (#46146)
AlexanderRichert-NOAA Aug 31, 2024
89da8d4
gfsio: add v1.4.2 (#46145)
AlexanderRichert-NOAA Aug 31, 2024
f7e3902
landsfcutil: add v2.4.2 (#46144)
AlexanderRichert-NOAA Aug 31, 2024
017e3dd
doctest: add new package (#46138)
pranav-sivaraman Aug 31, 2024
04bdff3
build(deps): bump actions/setup-python from 5.1.1 to 5.2.0 (#46129)
dependabot[bot] Aug 31, 2024
400dd40
sigio: add v2.3.3 (#46116)
AlexanderRichert-NOAA Aug 31, 2024
ae32af9
New package: py-ops (#46122)
qwertos Aug 31, 2024
d226ef3
New package: py-jsonlines (#46124)
qwertos Aug 31, 2024
412f22b
podio: apply patch for gcc 14 builds (#45854)
stephenswat Aug 31, 2024
b38ab54
whizard: add a patch when using hepmc3 3.3.0 or newer (#45862)
jmcarcell Aug 31, 2024
8100b0d
casacore: add new versions 3.6.1, 3.6.0, 3.2.1 (#46068)
mpokorny Aug 31, 2024
a5f404c
Update py-numcodecs. (#45715)
dunatotatos Aug 31, 2024
f7de621
Remove redundant inspect.getmodule(self) idiom in packages (#46073)
haampie Sep 1, 2024
fd98ebe
add rapidjson conflict for gcc14 (#46007)
joequant Sep 1, 2024
3954918
dd4hep: mark conflict with [email protected]: (#45855)
stephenswat Sep 1, 2024
9a58a6d
[openmpi] Add optional debug build variant (#45708)
stephenmsachs Sep 1, 2024
728f8e2
nanomath: add version 1.4.0 (#46159)
Pandapip1 Sep 1, 2024
e5aa74e
package cln 1.3.7 feelpp/spack#2 (#46162)
prudhomm Sep 2, 2024
ab6d494
py-horovod: py-torch 2.1.0 now supported (#46152)
adamjstewart Sep 2, 2024
7327e73
e4s ci stacks: add geopm-runtime (#45881)
eugeneswalker Sep 2, 2024
f79be30
py-torchgeo: add v0.6.0 (#46158)
adamjstewart Sep 2, 2024
d463d45
docs: update conditional definition arch (#46139)
georgiastuart Sep 2, 2024
6b649cc
cuda: add v12.6.1 (#46143)
pauleonix Sep 2, 2024
8f6092b
xsdk: remove develop and 0.7.0, and deprecate 0.8.0 (#46121)
balay Sep 2, 2024
ca179de
petsc, py-petsc4py: add v3.21.5 (#46151)
balay Sep 2, 2024
daa42be
ddt: deprecate all versions in favor of linaro-forge (#46115)
wdconinc Sep 2, 2024
654bf45
kokkos-nvcc-wrapper: add new 4.4.00 version (#46067)
rbberger Sep 2, 2024
1f8a6d8
[neovim] add utf8proc dependency (#46064)
ashermancinelli Sep 2, 2024
aaa7469
py-vector: add v1.4.2, v1.5.0; variant awkward (#46039)
wdconinc Sep 2, 2024
c47a3ee
package_base: sort deprecated versions later in `preferred_version` (…
wdconinc Sep 2, 2024
20565ba
remove dead code: fs.is_writable_dir was used on file (#46166)
haampie Sep 2, 2024
b5dec35
projections: simplify expression (#46167)
haampie Sep 2, 2024
fe2d063
db: type hints (#46168)
haampie Sep 2, 2024
c814fb5
podio: Add the new datasource variant once it is available (#46078)
tmadlener Sep 2, 2024
17d3d17
py-sympy: add version 1.13.0 (#46163)
JCGoran Sep 2, 2024
e66e572
py-cellprofiler: add 4.2.6 new package (#44824)
omsai Sep 2, 2024
1f935ac
Add py-pytest-allclose package (#45877)
paugier Sep 2, 2024
1679b5e
nvpl updates (#45922)
rbberger Sep 3, 2024
069286b
database: remove a few class properties (#46175)
haampie Sep 3, 2024
9e18e63
solver: minor cleanup and optimization (#46176)
alalazo Sep 3, 2024
5c297d8
root: fix X11 and OpenGL-related issues on macOS (#45632)
stephenswat Sep 3, 2024
9b077a3
root: fix @loader_path on macOS (#44826)
aphecetche Sep 3, 2024
d41fb3d
llvm: be more strict with detection (#46179)
alalazo Sep 3, 2024
744f034
Add conflict between llvm-amdgpu until version 5 and ninja since vers…
msimberg Sep 4, 2024
7ba0132
llvm: improve detection regexes (#46187)
knoepfel Sep 4, 2024
33f4a40
trilinos: update @[master,develop] dependency on kokkos (#46182)
balay Sep 4, 2024
3df3f40
paraview: add new v5.13.0 release (#46091)
vicentebolea Sep 4, 2024
fe6f5b8
texlive: clean up recipe (#45863)
jmcarcell Sep 4, 2024
866c440
Updating git repo location (#46183)
G-Ragghianti Sep 4, 2024
f6e3f6e
py-numpy: add v2.1.1 (#46197)
adamjstewart Sep 4, 2024
22d6972
py-fiona: add v1.10.0 (#46196)
adamjstewart Sep 4, 2024
35a2a0b
py-rasterio: add v1.3.11 (#46195)
adamjstewart Sep 4, 2024
c13e8e4
goaccess: new package (#46193)
haampie Sep 4, 2024
cd4c40f
Automated deployment to update package flux-core 2024-09-04 (#46191)
vsoch Sep 4, 2024
7e20874
rocm-openmp-extras: Avoiding registration of duplicate check-targets …
renjithravindrankannath Sep 4, 2024
254fe6e
amrex: add v24.09 (#46171)
WeiqunZhang Sep 4, 2024
d593ad0
py-trieregex: new package (#46154)
pranav-sivaraman Sep 4, 2024
ab21fc1
Added jump package (#46164)
fthaler Sep 4, 2024
ee96194
py-misk: add new package (#46153)
pranav-sivaraman Sep 4, 2024
c235fe4
Merge remote-tracking branch 'upstream/develop' into maintenance/merg…
greenc-FNAL Sep 4, 2024
9604c0a
boost: Conditionally include/exclude Boost.Json depending on Boost ve…
msimberg Sep 4, 2024
656720a
py-schema: add v0.7.7 (#46210)
pranav-sivaraman Sep 5, 2024
bc5456a
seacas: require +metis and +mpi instead of +parmetis (#46205)
mvlopri Sep 5, 2024
c98045e
libfabric: Add CUDA variant (#46203)
jack-morrison Sep 5, 2024
1a4b07e
Replace `if ... in spec` with `spec.satisfies` in d* and e* packages …
aurianer Sep 5, 2024
2107a88
spack deprecate: deprecate --link-type flag (#46202)
haampie Sep 5, 2024
37ea965
Remove `test_external_package_module` (#46218)
alalazo Sep 5, 2024
7e5e6f2
Pass Database layout in constructor (#46219)
haampie Sep 5, 2024
d37749c
pika: Add 0.28.0 (#46207)
msimberg Sep 5, 2024
02faa7b
reindex: ensure database is empty before reindex (#46199)
haampie Sep 5, 2024
5d9f0cf
gaudi: Specify boost dependencies explicitly and cleanup package (#46…
tmadlener Sep 5, 2024
c912bf1
Merge remote-tracking branch 'upstream/develop' into maintenance/merg…
greenc-FNAL Sep 5, 2024
6cac107
Fix audit issues
greenc-FNAL Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
147 changes: 89 additions & 58 deletions etc/spack/defaults/packages.yaml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions lib/spack/docs/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ named list ``compilers`` is ``['%gcc', '%clang', '%intel']`` on
spack:
definitions:
- compilers: ['%gcc', '%clang']
- when: arch.satisfies('x86_64:')
- when: arch.satisfies('target=x86_64:')
compilers: ['%intel']

.. note::
Expand Down Expand Up @@ -893,8 +893,9 @@ The valid variables for a ``when`` clause are:

#. ``env``. The user environment (usually ``os.environ`` in Python).

#. ``hostname``. The hostname of the system (if ``hostname`` is an
executable in the user's PATH).
#. ``hostname``. The hostname of the system.

#. ``full_hostname``. The fully qualified hostname of the system.

^^^^^^^^^^^^^^^^^^^^^^^^
SpecLists as Constraints
Expand Down
24 changes: 13 additions & 11 deletions lib/spack/external/_vendoring/distro/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,27 +1265,29 @@ def _distro_release_info(self) -> Dict[str, str]:
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
else:
try:
basenames = [
basename
for basename in os.listdir(self.etc_dir)
if basename not in _DISTRO_RELEASE_IGNORE_BASENAMES
and os.path.isfile(os.path.join(self.etc_dir, basename))
]
with os.scandir(self.etc_dir) as it:
etc_files = [
p.path for p in it
if p.is_file() and p.name not in _DISTRO_RELEASE_IGNORE_BASENAMES
]
# We sort for repeatability in cases where there are multiple
# distro specific files; e.g. CentOS, Oracle, Enterprise all
# containing `redhat-release` on top of their own.
basenames.sort()
etc_files.sort()
except OSError:
# This may occur when /etc is not readable but we can't be
# sure about the *-release files. Check common entries of
# /etc for information. If they turn out to not be there the
# error is handled in `_parse_distro_release_file()`.
basenames = _DISTRO_RELEASE_BASENAMES
for basename in basenames:
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
etc_files = [
os.path.join(self.etc_dir, basename)
for basename in _DISTRO_RELEASE_BASENAMES
]

for filepath in etc_files:
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(os.path.basename(filepath))
if match is None:
continue
filepath = os.path.join(self.etc_dir, basename)
distro_info = self._parse_distro_release_file(filepath)
# The name is always present if the pattern matches.
if "name" not in distro_info:
Expand Down
173 changes: 0 additions & 173 deletions lib/spack/external/_vendoring/jsonschema/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,96 +231,6 @@ def is_host_name(instance):
return True


try:
# The built-in `idna` codec only implements RFC 3890, so we go elsewhere.
import idna
except ImportError:
pass
else:
@_checks_drafts(draft7="idn-hostname", raises=idna.IDNAError)
def is_idn_host_name(instance):
if not isinstance(instance, str_types):
return True
idna.encode(instance)
return True


try:
import rfc3987
except ImportError:
try:
from rfc3986_validator import validate_rfc3986
except ImportError:
pass
else:
@_checks_drafts(name="uri")
def is_uri(instance):
if not isinstance(instance, str_types):
return True
return validate_rfc3986(instance, rule="URI")

@_checks_drafts(
draft6="uri-reference",
draft7="uri-reference",
raises=ValueError,
)
def is_uri_reference(instance):
if not isinstance(instance, str_types):
return True
return validate_rfc3986(instance, rule="URI_reference")

else:
@_checks_drafts(draft7="iri", raises=ValueError)
def is_iri(instance):
if not isinstance(instance, str_types):
return True
return rfc3987.parse(instance, rule="IRI")

@_checks_drafts(draft7="iri-reference", raises=ValueError)
def is_iri_reference(instance):
if not isinstance(instance, str_types):
return True
return rfc3987.parse(instance, rule="IRI_reference")

@_checks_drafts(name="uri", raises=ValueError)
def is_uri(instance):
if not isinstance(instance, str_types):
return True
return rfc3987.parse(instance, rule="URI")

@_checks_drafts(
draft6="uri-reference",
draft7="uri-reference",
raises=ValueError,
)
def is_uri_reference(instance):
if not isinstance(instance, str_types):
return True
return rfc3987.parse(instance, rule="URI_reference")


try:
from strict_rfc3339 import validate_rfc3339
except ImportError:
try:
from rfc3339_validator import validate_rfc3339
except ImportError:
validate_rfc3339 = None

if validate_rfc3339:
@_checks_drafts(name="date-time")
def is_datetime(instance):
if not isinstance(instance, str_types):
return True
return validate_rfc3339(instance)

@_checks_drafts(draft7="time")
def is_time(instance):
if not isinstance(instance, str_types):
return True
return is_datetime("1970-01-01T" + instance)


@_checks_drafts(name="regex", raises=re.error)
def is_regex(instance):
if not isinstance(instance, str_types):
Expand All @@ -340,86 +250,3 @@ def is_draft3_time(instance):
if not isinstance(instance, str_types):
return True
return datetime.datetime.strptime(instance, "%H:%M:%S")


try:
import webcolors
except ImportError:
pass
else:
def is_css_color_code(instance):
return webcolors.normalize_hex(instance)

@_checks_drafts(draft3="color", raises=(ValueError, TypeError))
def is_css21_color(instance):
if (
not isinstance(instance, str_types) or
instance.lower() in webcolors.css21_names_to_hex
):
return True
return is_css_color_code(instance)

def is_css3_color(instance):
if instance.lower() in webcolors.css3_names_to_hex:
return True
return is_css_color_code(instance)


try:
import jsonpointer
except ImportError:
pass
else:
@_checks_drafts(
draft6="json-pointer",
draft7="json-pointer",
raises=jsonpointer.JsonPointerException,
)
def is_json_pointer(instance):
if not isinstance(instance, str_types):
return True
return jsonpointer.JsonPointer(instance)

# TODO: I don't want to maintain this, so it
# needs to go either into jsonpointer (pending
# https://github.com/stefankoegl/python-json-pointer/issues/34) or
# into a new external library.
@_checks_drafts(
draft7="relative-json-pointer",
raises=jsonpointer.JsonPointerException,
)
def is_relative_json_pointer(instance):
# Definition taken from:
# https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01#section-3
if not isinstance(instance, str_types):
return True
non_negative_integer, rest = [], ""
for i, character in enumerate(instance):
if character.isdigit():
non_negative_integer.append(character)
continue

if not non_negative_integer:
return False

rest = instance[i:]
break
return (rest == "#") or jsonpointer.JsonPointer(rest)


try:
import uritemplate.exceptions
except ImportError:
pass
else:
@_checks_drafts(
draft6="uri-template",
draft7="uri-template",
raises=uritemplate.exceptions.InvalidTemplate,
)
def is_uri_template(
instance,
template_validator=uritemplate.Validator().force_balanced_braces(),
):
template = uritemplate.URITemplate(instance)
return template_validator.validate(template)
45 changes: 45 additions & 0 deletions lib/spack/external/patches/distro.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/lib/spack/external/_vendoring/distro/distro.py b/lib/spack/external/_vendoring/distro/distro.py
index 89e1868047..50c3b18d4d 100644
--- a/lib/spack/external/_vendoring/distro/distro.py
+++ b/lib/spack/external/_vendoring/distro/distro.py
@@ -1265,27 +1265,29 @@ def _distro_release_info(self) -> Dict[str, str]:
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
else:
try:
- basenames = [
- basename
- for basename in os.listdir(self.etc_dir)
- if basename not in _DISTRO_RELEASE_IGNORE_BASENAMES
- and os.path.isfile(os.path.join(self.etc_dir, basename))
- ]
+ with os.scandir(self.etc_dir) as it:
+ etc_files = [
+ p.path for p in it
+ if p.is_file() and p.name not in _DISTRO_RELEASE_IGNORE_BASENAMES
+ ]
# We sort for repeatability in cases where there are multiple
# distro specific files; e.g. CentOS, Oracle, Enterprise all
# containing `redhat-release` on top of their own.
- basenames.sort()
+ etc_files.sort()
except OSError:
# This may occur when /etc is not readable but we can't be
# sure about the *-release files. Check common entries of
# /etc for information. If they turn out to not be there the
# error is handled in `_parse_distro_release_file()`.
- basenames = _DISTRO_RELEASE_BASENAMES
- for basename in basenames:
- match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
+ etc_files = [
+ os.path.join(self.etc_dir, basename)
+ for basename in _DISTRO_RELEASE_BASENAMES
+ ]
+
+ for filepath in etc_files:
+ match = _DISTRO_RELEASE_BASENAME_PATTERN.match(os.path.basename(filepath))
if match is None:
continue
- filepath = os.path.join(self.etc_dir, basename)
distro_info = self._parse_distro_release_file(filepath)
# The name is always present if the pattern matches.
if "name" not in distro_info:
Loading
Loading