Compare commits

...

434 Commits

Author SHA1 Message Date
Harmen Stoppels
f84a500aab builtin.mock -> builtin_mock in test data 2025-05-14 17:06:00 +02:00
Harmen Stoppels
1fcf707096 fix test 2025-05-14 16:46:41 +02:00
Harmen Stoppels
fb690967e1 environment.py: fix env.repo 2025-05-14 16:46:34 +02:00
Harmen Stoppels
1c05b1dd1b fix various tests 2025-05-14 16:34:23 +02:00
Harmen Stoppels
93e0d99553 fix a few imports 2025-05-14 15:27:13 +02:00
Harmen Stoppels
e09325fe9f upgrade mock packages to api v2 2025-05-14 15:24:37 +02:00
ddement
56f40cc1c8 openturbine: Update dependencies and configuration in anticipation of beta release (#50355)
* Updated OpenTurbine package to reflect new configuration options
2025-05-13 13:07:44 -07:00
John W. Parent
ae2c9d1b99 Win: Restore oneAPI env setup (#50444)
oneAPI env setup was prematurely removed in compilers-as-nodes update
(#45189 - removed from the compiler class but not added to the
associated compiler package): restore it.
2025-05-13 12:22:49 -06:00
Stephen Nicholas Swatman
af24280c96 benchmark: add v1.9.3 (#50428)
This commit adds v1.9.3 of Google Benchmark.
2025-05-13 11:10:18 -07:00
Robert Maaskant
8daf4bc215 py-pyproject-hooks: add v1.1.0 and v1.2.0 (#50435) 2025-05-13 11:02:37 -07:00
Robert Maaskant
dabf7e9de8 py-distlib: add v0.3.8 and v0.3.9 (#50436)
* py-distlib: add v0.3.8 and v0.3.9

* py-distlib: github.com as homepage
2025-05-13 10:03:13 -07:00
Zack Galbreath
9cfb973d69 ci: recalibrate per-package resource requests (#50406) 2025-05-13 09:28:11 -05:00
Seth R. Johnson
e4f9e73671 g4vg: new version 1.0.4 (#50439) 2025-05-13 14:31:46 +02:00
Tamara Dahlgren
ae9cffe55f test/bootstrap.py: test_bootstrap_search_for_compilers_with* use mock packages path (#50441) 2025-05-13 14:31:13 +02:00
Jon Rood
f675130fe9 metaphysicl: depends on c (#50446) 2025-05-13 04:44:34 -06:00
Harmen Stoppels
c5eb82fcb0 pkg.spec.package is pkg after deserialization (#50449) 2025-05-13 12:08:13 +02:00
Massimiliano Culpo
a938167a22 Add a prefix when we import vendored modules (#50443)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2025-05-13 07:20:40 +02:00
Mikael Simberg
bdb6ac8188 mold: add v2.39.1 (#50431) 2025-05-12 15:39:55 -06:00
Jon Rood
6efdc3c005 amr-wind: update some dependency constraints and add fortran dependency. (#50440) 2025-05-12 15:25:45 -06:00
Diego Alvarez S.
5a8a7b83f6 blast-plus: fix python version to <=3.11 (#50416) 2025-05-12 09:24:08 +02:00
Dmitri Smirnov
70de20eaa2 optix-dev: new package for NVIDIA OptiX SDK headers (#50080) 2025-05-12 09:05:22 +02:00
Adam J. Stewart
d8172e2c29 GDAL: add v3.11.0 (#50405) 2025-05-12 08:58:52 +02:00
Diego Alvarez S.
3371cc55ed nextflow: add v25.04.0 (#50412) 2025-05-12 08:50:13 +02:00
Satish Balay
35ee3706bb petsc, py-petsc4py: add v3.23.2 (#50409) 2025-05-12 08:48:41 +02:00
Diego Alvarez S.
9493cf016b Add seqkit v2.10.0 (#50414) 2025-05-12 08:47:25 +02:00
Seth R. Johnson
f6caa1c824 covfie: add v0.14 and maintainer (#50417) 2025-05-12 08:36:57 +02:00
Matthieu Dorier
2c9f94e6a5 py-confluent-kafka: new package (#50418) 2025-05-12 08:36:17 +02:00
pauleonix
2504dcf4f8 cuda: add v12.8.1 (#49379) 2025-05-12 08:34:12 +02:00
Alec Scott
82baa658a4 typos: add v1.32.0 (#50421) 2025-05-12 08:33:03 +02:00
Jon Rood
21384be78d exawind: depends on fortran as well (#50393) 2025-05-10 10:44:38 +02:00
Massimiliano Culpo
acd47147a5 solver: support concrete multivalued variants (#50325)
The solves now supports key:=val syntax for multivalued variants in specs originating from input, externals, requirements, directives and when conditions

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-09 23:08:21 +02:00
Harmen Stoppels
3ed6736b2c compiler.py: be more defensive (#50403) 2025-05-09 16:58:52 +00:00
Massimiliano Culpo
842954f6a4 solver: treat external nodes as concrete for optimization purposes (#50165)
This PR is a step towards treating externals as concrete specs. Specifically, it moves the optimization weights of external nodes into the group of "reused" specs, and doesn't count externals as specs to be built. 

It still keeps the one to many mapping between an external spec in `packages.yaml` and the corresponding specs in the DB. To make it such that an hashed external is preferred to a non-hashed one, the version weights of externals are demoted at lowest priority.

**Change in behavior**:
- Having the possibility, Spack will now prefer to mix compilers in a DAG, and use the latest version possible for each node, rather than using a single compiler and employ old versions of some nodes because of conflicts
- In general, using externals by default is now triggered by putting their weights in the "reused" group. This means that any penalty they might induce will never have the same priority as something that needs to be built. This behavior reflects reality, but changes some default choices from the previous state.

Modifications:
- External nodes weights are now moved to the group of "reused" specs
- Runtimes are treated as concrete as well (to avoid that e.g.`gcc` is not selected because it "builds" the runtime package)
- Shuffle version weights, so that externals are least preferred (counterbalanced by the fact that they are in the "reused" groups)
- Split provider weights on edges from version badness on edges

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-09 17:41:16 +02:00
Harmen Stoppels
5c918e40a6 builtin: remove llnl.util.tty import (#50396)
* builtin: remove llnl.util.tty import

* hipsycl: remove unnecessary imports
2025-05-09 15:35:18 +02:00
Harmen Stoppels
98570929aa builtin: github url pull -> commit (#50399)
rate limits on github.com's pull/ urls are ~1 per minute, the rate
limits for merged commits are better and on top of that less dynamic.
2025-05-09 15:25:39 +02:00
Gregor Olenik
75bcf58b30 neon: add new package (#50278) 2025-05-09 15:20:24 +02:00
Harshula Jayasuriya
4a03cac6cc fms: require +pic when +shared (#50130) 2025-05-09 06:15:04 -06:00
Thomas Madlener
75faab206b lcio: add version 2.22.6 (#50368)
Fix dependency on "c" to previous versions as this has been fixed

Co-authored-by: Valentin Volkl <valentin.volkl@cern.ch>
2025-05-09 05:37:56 -06:00
Sergey Kosukhin
c9ab0d8fcb icon: add version 2025.04 (#50245) 2025-05-09 10:22:08 +02:00
John W. Parent
c45e02d58f mpilander: conflict with Windows (#49733) 2025-05-09 10:04:46 +02:00
Thomas-Ulrich
33c8f518ae seissol: fix build by adding language dependance (#50302) 2025-05-09 10:01:00 +02:00
Rémi Lacroix
2491a9abff conquest: explicitly configure the MPI compilers. (#50287) 2025-05-09 09:58:45 +02:00
G-Ragghianti
1a26ec7b8b parsec: new version and compiler dependency (#50292) 2025-05-09 09:29:27 +02:00
Patrick Diehl
89a79d3df0 hpx: add fetching APEX and specify develop (#50289)
* Add fetching APEX and specify develop

* Using the spack package

* [@spackbot] updating style on behalf of diehlpk

* Add restrictions for 1.5
2025-05-09 09:28:30 +02:00
Marc T. Henry de Frahan
ce700d69d7 Add amr-wind versions (#50373) 2025-05-09 00:10:53 -06:00
Tamara Dahlgren
a505fb1f37 unit tests: switch TestSpecList to use mock packages (#50353) 2025-05-09 07:45:49 +02:00
吴坎
f039b22093 Update package.py (#50378) 2025-05-08 23:34:41 -06:00
Dave Keeshan
18ea8f813e yosys: add v0.53 (#50372) 2025-05-08 23:34:23 -06:00
Jonas Eschle
d7e740defa py-hepstats: new package (#43697)
* enh: add py-hepstats package
* fix: version
* fix: update pypi version
* fix: update hash
* fix: use github package
* fix: allow download from pypi
* chore: remove unused Bazel, cleanup imports
* enh:  add 0.9.2 version
* fix: update dependencies for version 0.9.0 and adjust build system
* chore:  move to new builtin directory

---------

Co-authored-by: jonas-eschle <jonas-eschle@users.noreply.github.com>
2025-05-08 23:29:02 -06:00
Chris Green
c21dc1a27a jsonnet: Support CMake builds with external nlohmann-json (#49284)
* jsonnet: Support CMake builds with external `nlohmann-json`

* New version 0.21.0
2025-05-08 23:23:45 -06:00
Sinan
f30d8ea2a5 package/lemon,qjson,qtkeychain: fix c compiler depencency (#50311)
* package/lemon,qjson,qtkeychain: fix c compiler depencency
* remove generated

---------

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2025-05-08 16:44:23 -07:00
Scott Wittenburg
03cb30cb96 binary_distribution: Do not look in sub-mirrors when indexing (#50389)
When indexing top level specs, eg, in s3://spack-binaries/develop,
do not sync manifests from all the stacks.  Instead, add the path
to the spec manifests to the url to sync, so that only items in
s3://spack-binaries/develop/v3/manifests/spec are copied to the
local system.
2025-05-08 17:25:35 -06:00
Scott Wittenburg
f6da037129 binary_distribution: Handle fetch error during rebuild-index (#50387)
Allow rebuild-index to continue if fetching some specs fails
for any reason, and issue a warning indicating which manifest
is associated with the failed fetch.
2025-05-08 13:54:43 -06:00
Kyle Shores
31c2897fd8 musica: adding a netcdf-fortran dependency (#50252) 2025-05-08 13:41:33 -06:00
jgraciahlrs
1a379215da Allow usage of config variables and env variables with include_concrete (#45871)
* Allow usage of spack config vars in concrete env path
* Update docs on usage of spack config vars in concrete env path
2025-05-08 14:23:02 -05:00
Robert Maaskant
0f7c1b5e38 go: add v1.23.9 and v1.24.3 (#50346) 2025-05-08 13:57:00 -05:00
ShujieL
7e3af5d42d dd4hep: add v1.32 (#50359)
* Update package.py for dd4hep 1.32

* Update package.py to fix the podio-dd4hep version

* fix the dd4hep 1.32 hash

Co-authored-by: Sakib Rahman <rahmans@myumanitoba.ca>

---------

Co-authored-by: Sakib Rahman <rahmans@myumanitoba.ca>
2025-05-08 11:52:57 -07:00
Victor A. P. Magri
f45e312f81 raja: add gpu-profiling variant (#50354) 2025-05-08 12:40:56 -06:00
Chris Marsh
a82e21e82f add 0.61.2 and fix numpy version constraints (#50352) 2025-05-08 12:24:13 -06:00
Robert Maaskant
1ba40b99ee yq: add v4.45.2 (#50345) 2025-05-08 12:07:22 -06:00
Robert Maaskant
60f2698a4a trivy: add v0.62.0 and v0.62.1 (#50344) 2025-05-08 12:07:04 -06:00
Harmen Stoppels
b3772f8bb6 builtin: remove unused imports from build_systems (#50385) 2025-05-08 19:27:24 +02:00
Harmen Stoppels
cd75e52ba2 yaml_cpp: do not import spack.spec (#50382) 2025-05-08 10:52:35 -06:00
Harmen Stoppels
b0b316c646 builtin: add a few missing __init__.py (#50374) 2025-05-08 18:45:09 +02:00
Harmen Stoppels
7bbf581169 singularity-eos: remove conditional depends_on (#50381) 2025-05-08 18:42:06 +02:00
Harmen Stoppels
7b93d01a68 builtin: remove various redundant wildcard imports (#50380) 2025-05-08 18:38:18 +02:00
Harmen Stoppels
a95fa26857 docs/comments: fix typo with wildcard import (#50379) 2025-05-08 18:37:45 +02:00
Harmen Stoppels
6f2393a345 builtin: delete spack.store import (#50383) 2025-05-08 10:31:11 -06:00
Mikael Simberg
9fa2bb375c fmt: add v11.2.0 (#50343) 2025-05-08 05:54:54 -06:00
Harmen Stoppels
98c08ce5c6 repo.py: enable search paths when spack.repo.PATH is assigned (#50370)
Fixes a bug where `custom_repo.get_pkg_class("foo")` failed executing `import spack_repo.builtin` even if the builtin repo was configured globally.

Instead of assignment of `spack.repo.PATH`, the `spack.repo.enable_repo` function now assigns and enables the repo, meaning that also Python module search paths are modified.
2025-05-08 13:42:20 +02:00
Caetano Melone
83f115894b glib: add preferred version 2.78.3 (#50356)
Versions of glib above 2.78.3 don't build (https://github.com/spack/spack/issues/49358). Until this is fixed we should set preferred to a confirmed version instead per https://github.com/spack/spack/issues/49358#issuecomment-2706251681.
2025-05-08 09:27:07 +02:00
Tamara Dahlgren
59339be48f test/cmd/find.py: switch to use mock_packages (#50358) 2025-05-08 08:33:56 +02:00
snehring
ef0599b53c cryodrgn: adding v3.4.3 (#48804)
Signed-off-by: Shane Nehring <snehring@iastate.edu>
2025-05-07 12:43:37 -07:00
Veselin Dobrev
9c4207a551 mesa: add the latest v24.* and v25.* versions (#47642)
* [mesa] Add latest version: 24.2.7
* Fix the llvm build for @18: when libunwind is disabled
* [mesa] Updaing to the latest 24.* and 25.* versions
* Add libshmfence dependency

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2025-05-07 12:09:23 -07:00
Sinan
eb95390ce7 package/qscintilla: fix build issue (#50317)
* package/qscintilla: fix build issue

* add maintainer

* package/qscintilla: fix build issue

* add maintainer

---------

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2025-05-07 19:45:14 +02:00
Sinan
527d723db0 package_qgis add new versions (#50328)
* package_qgis add new versions

* restore deprecated version

---------

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2025-05-07 09:50:58 -07:00
吴坎
63fe6fc893 Update package.py (#50341) 2025-05-07 16:50:34 +02:00
Harmen Stoppels
4f2a1806f9 pyproject.toml: format (#50339) 2025-05-07 16:40:41 +02:00
Harmen Stoppels
12a7e8d73a bohrium: don't create python module (#50342) 2025-05-07 16:23:34 +02:00
Harmen Stoppels
21d8c09c5e builtin: fix various type/correctness issues (#50340) 2025-05-07 15:45:15 +02:00
David--Cléris Timothée
43596b4e23 Shamrock: new package (#50293)
Co-authored-by: tdavidcl <tdavidcl@users.noreply.github.com>
2025-05-07 14:05:12 +02:00
Simon Pintarelli
97edcb5acc tiled-mm v2.3.2 (#50329) 2025-05-07 09:37:28 +02:00
Simon Pintarelli
fc268b0945 cosma: add v2.7.0 (#50320) 2025-05-07 09:35:47 +02:00
Tamara Dahlgren
0b4477c0df test/cmd/unit_test: have test_list_with* ignore missing repo warning (#50332) 2025-05-07 09:06:34 +02:00
Tamara Dahlgren
eff4c14a09 test/providers: switch to mock packages (#50333) 2025-05-07 09:04:06 +02:00
Tamara Dahlgren
f485a622c8 test/cmd/maintainers.py: cleanup of mock_packages use (#50334) 2025-05-07 09:03:00 +02:00
Tamara Dahlgren
f151bc65f7 test/env: switch to mock packages (#50335) 2025-05-07 09:02:10 +02:00
Tamara Dahlgren
99d849b2e6 test/spec_semantics: add mock_packages to test_intersects_and_satisfies (#50336) 2025-05-07 08:59:16 +02:00
Massimiliano Culpo
3d8f9a7b22 Make target constraints stronger in public pipelines (#50297)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-07 08:33:05 +02:00
Tamara Dahlgren
c88e7bc492 test/ci.py: remove redundant mock_packages fixture use (#50331) 2025-05-07 08:09:14 +02:00
Tamara Dahlgren
931d034da4 test/patch.py: switch tests to use mock_packages (#50337) 2025-05-07 08:07:11 +02:00
Greg Sjaardema
a3a49daf8f seacas: new version, change in name handling defaults (#50324) 2025-05-06 21:47:39 -06:00
Scott Wittenburg
2c05ce3607 binary_distribution: content addressable tarballs (#48713)
binary_distribution: content addressable url buildcache

Change how binary mirrors are laid out, adopting content addressing for every
piece of data spack stores in a binary mirror. Items (e.g. tarballs, specfiles, public
keys, indices, etc) are now discoverable via manifest files which give the size,
checksum, compression type, etc of the the stored item. The information in the
manifest, in turn, is used to find the actual data, which is stored by its content
address in the blobs directory. Additionally, signing is now applied to the manifest
files, rather than to the spec files themselves.
2025-05-06 12:32:15 -06:00
Simon Pintarelli
6587b2a231 costa v2.2.3, v2.2.4 (#50319) 2025-05-06 17:30:45 +02:00
Harmen Stoppels
f1c743e235 gha: sync to spack/spack-packages (#50322) 2025-05-06 17:23:40 +02:00
Harmen Stoppels
b932c14008 builtin: use api v2.0 and update dir structure (#49275)
* Bump the package API of the `builtin` repo to `v2.0`
* Move `var/spack/repos/builtin` -> `var/spack/repos/spack_repo/builtin`
* Move test repos `var/spack/repos/{builtin.mock,tutorial,...}` -> `var/spack/test_repos/`
* Update package dir names to v2 format (`-` -> `_` etc)
* Change absolute imports `from spack.pkg.builtin.my_pkg ...` to relative imports `from ..my_pkg.package ...`

Users who have a repo on top of builtin should change imports from

```python
from spack.pkg.builtin.my_pkg import MyPkg
```

to

```python
from spack_repo.builtin.packages.my_pkg.package import MyPkg
```

and can configure their editors with

```
PYTHONPATH=$spack/lib/spack:$spack/var/spack/repos
```

[skip-verify-checksums]
2025-05-06 12:05:44 +02:00
dependabot[bot]
285f95a4d8 build(deps): bump pylint in /.github/workflows/requirements/style (#50312)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.6 to 3.3.7.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.6...v3.3.7)

---
updated-dependencies:
- dependency-name: pylint
  dependency-version: 3.3.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 10:32:49 +02:00
Tamara Dahlgren
3de68ef976 unit tests: switch test/cmd/config.py to mock packages (#50313) 2025-05-06 08:14:32 +02:00
Tamara Dahlgren
5c7fe24bec unit tests: change test_config_audits to use mock_packages, add mock openssl (#50308) 2025-05-06 08:10:11 +02:00
Tamara Dahlgren
ecb122f4c1 unit tests: switch test/cmd/versions to mock packages (#50315) 2025-05-06 08:08:38 +02:00
Tamara Dahlgren
6219780691 unit tests: test_concretization_cache_roundtrip use mock_packages (#50314) 2025-05-06 08:06:44 +02:00
Tamara Dahlgren
8ec1369d2b unit tests: use mock_packages for 'spack [info|list|style]' tests (#50309) 2025-05-06 07:35:26 +02:00
Patrick Diehl
e3fcc41162 hpx: disable HPX_WITH_PKGCONFIG (#50290) 2025-05-06 07:32:25 +02:00
Nicholson Koukpaizan
ae582c45c3 enzyme: add v0.0.173 (#50041)
* enzyme@0.0.173 and make libs unpacking consistent.

* Look for Enzyme libs separately when setting dependent build environment.
2025-05-05 15:52:05 -07:00
Matt Thompson
252a4d1076 pfunit: add v4.12.0 (#50067) 2025-05-05 15:10:40 -07:00
Matt Thompson
df37a8ba76 mapl: add v2.53.3 (#50306) 2025-05-05 14:42:19 -07:00
Howard Pritchard
99d06b95a3 UCX: use updatd mlx5-dv arg for mlx5_dv variant (#50091)
the configure arg to use for the mlx5_dv changed from
UCX 1.17 to 1.18.

Related to #50086

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2025-05-05 15:47:10 -05:00
jordialcaraz
38829b01df [TAU] Add OpenACC support (#50279) 2025-05-05 12:17:04 -07:00
Harmen Stoppels
2a6a6602da [skip-verify-checkums] (#50299) 2025-05-05 14:12:54 +02:00
Harmen Stoppels
1527e9703d builder.py: check is_package_module for v2 support (#50298) 2025-05-05 14:08:58 +02:00
G-Ragghianti
4a22df5477 global: update URL, add v6.6.14 (#50274) 2025-05-05 12:57:48 +02:00
Harmen Stoppels
2b4f2daa73 package API v2.0: new repo layout (#49256)
This implements Package API v2.0, and is an opt-in feature for repos. It can be enabled with

```yaml
repo:
  ...
  api: v2.0
```

It differs from the current default v1.0 as follows:

1. Package names can only contain `-` as a separator.
2. Package names can only be lowercase.
3. Package directory names are valid Python module names.
4. The repo namespace and its directory name are the same.
5. The `packages` subdir, which is configurable, should be a directory
   name that is also a valid Python module name.
6. There is a one to one mapping between Spack package names and Python
   module names.
7. Import statements `import spack.pkg.namespace.package_module` in
   `package.py` files need to specify the canonical package module.

To go from Spack package name to Python module name:
- Replace `-` by `_`
- Add a leading `_` if the package name starts with a digit

To go from Python module name to Spack package name:
- Strip leading `_`
- Replace `_` by `-`.
2025-05-05 10:52:16 +02:00
Harmen Stoppels
02501bc4af lang.py: make HashableMap generic, and use in Spec (#50229) 2025-05-05 10:45:11 +02:00
Howard Pritchard
7cd039d022 Open MPI: patch 418 as well for gcc14 (#50239)
related to #49129 and #50205

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2025-05-05 10:40:25 +02:00
Chris Marsh
1ff81c1c88 libtheora: add examples variant, add v1.2.0 (#50242) 2025-05-05 10:39:03 +02:00
Sergey Kosukhin
3e3cb73446 py-netcdf4: enable non-MPI build agains MPI-enabled HDF5 (#50186) 2025-05-05 10:37:30 +02:00
Wouter Deconinck
8e948c03fc whizard: use C++ standard of ROOT if dependency (#50255) 2025-05-05 10:28:00 +02:00
Mike Nolta
572e790b3d blis: remove unnecessary python runtime dependency (#50253) 2025-05-05 10:26:58 +02:00
Jon Rood
1873d6909a zfp: add v1.0.1 (#50260) 2025-05-05 10:09:13 +02:00
Satish Balay
4a24ab53df petsc, py-petsc4py: add v3.23.1 (#50256) 2025-05-05 10:07:31 +02:00
Jose E. Roman
671c394d32 SLEPc: add v3.23.1 (#50269) 2025-05-05 10:06:51 +02:00
Weiqun Zhang
ce3b511f59 amrex: add v25.05 (#50272) 2025-05-05 10:06:06 +02:00
Richard Berger
03073a5fed spiner: update catch2 dependency (#50275) 2025-05-05 09:52:19 +02:00
吴坎
787bff0d6a cutlass: add v3.9.1 (#50280) 2025-05-05 09:51:14 +02:00
Lydéric Debusschère
2504a76079 py-pyspice: new package (#50282) 2025-05-05 09:39:54 +02:00
Rémi Lacroix
f665f4c41b conquest: fix usage of fftw-api (#50285)
Allows compiling with another fftw-api provider than FFTW.
2025-05-05 09:18:06 +02:00
G-Ragghianti
4cab31323c magma: fix package tests (#48631) 2025-05-05 09:13:52 +02:00
David--Cléris Timothée
fcbe8c50cd hipsycl: add missing c dependency (#50294) 2025-05-05 08:26:32 +02:00
Victor Lopez Herrero
37de90c98c dlb: add v3.5.1 and v3.5.2 (#50288) 2025-05-04 20:53:57 -07:00
Paul R. C. Kent
5ccd9dc64b rmgdft: add v6.2.0 (#50291) 2025-05-04 19:59:30 -07:00
Heiko Bauke
1f59ada2c2 mpl: add v0.4.0 (#50295) 2025-05-04 19:58:49 -07:00
YI Zeping
a8a402115b add binutils 2.44 (#50267) 2025-05-04 11:58:02 +02:00
Paul R. C. Kent
c2f3539a5e llvm: add v20.1.4 (#50283) 2025-05-04 11:31:42 +02:00
RichardBuntLinaro
cdeb67ec02 linaro-forge: add v24.1.3 (#50268) 2025-05-02 08:01:44 -07:00
Till Ehrengruber
2ddd8cd1aa py-cupy: add v13.2.0, v13.3.0, v13.4.0 (#50076)
* Add cupy 13.4.0, 13.3.0, 13.2.0

* [@spackbot] updating style on behalf of tehrengruber

* Update var/spack/repos/builtin/packages/py-cupy/package.py

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>

* Update var/spack/repos/builtin/packages/py-cupy/package.py

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>

---------

Co-authored-by: tehrengruber <tehrengruber@users.noreply.github.com>
Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
2025-05-02 13:18:59 +02:00
Mike Nolta
5b352c3088 py-torch: patch FindBLAS.cmake (#50273)
Pulls in the patch from https://github.com/pytorch/pytorch/pull/145849 to fix the following error:

    CMake Error at cmake/Modules/FindBLAS.cmake:85 (check_function_exists):
      Unknown CMake command "check_function_exists".
2025-05-02 10:39:19 +02:00
Veselin Dobrev
95c26245c1 Fix the LLVM build when using intel compilers (#50226)
* [llvm] Fix the LLVM build when using intel compilers

* [@spackbot] updating style on behalf of v-dobrev

* e4s oneapi ci stack: re-enable specs disabled due to llvm%oneapi issue #49625

* disable paraview

* disable failing oneapi specs

* disable additional failing oneapi spec

---------

Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
2025-05-01 16:46:48 -07:00
YI Zeping
6a0e03b81c update libiconv to make gcc-15 happy (#50270) 2025-05-01 13:23:29 -07:00
Paul R. C. Kent
858f70bf6f QMCPACK v4.1.0 (#50259) 2025-05-01 09:22:31 -07:00
Tim Haines
123c26c22d builtin: add C or C++ dependency for many packages (#50258) 2025-05-01 09:40:00 +02:00
Greg Becker
b42ef1e7b8 spack solve: respect unify:false config (#50243)
----------

Signed-off-by: Gregory Becker <becker33@llnl.gov>
2025-04-30 21:51:19 +00:00
Andrey Perestoronin
2f2c65f56b add new intel-oneapi packages (#50247) 2025-04-30 11:43:32 -06:00
Taillefumier Mathieu
883d0739e6 [packages] Fix for cp2k and cosma (#50223)
Signed-off-by: Mathieu Taillefumier <mathieu.taillefumier@free.fr>
Co-authored-by: Mathieu Taillefumier <mathieu.taillefumier@free.fr>
Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
2025-04-30 16:21:33 +02:00
Massimiliano Culpo
f1a31fe5f7 rust: improve external detection (#50232)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-30 08:24:37 +02:00
Carlos Bederián
c3785f4d30 hcoll: comment out unsatisfiable requires (#50235) 2025-04-30 08:08:38 +02:00
Chris Marsh
cc8983cf82 r: updates for compilers-as-nodes (#50174) 2025-04-30 08:07:10 +02:00
Greg Sjaardema
30cea3ce8a seacas: bug fixes, new version (#50240)
Fix to cpup for zone grid connectivity.  Previous versions broken for some meshes.

Database entity names (sets, blocks) are not lowercased by default.

Numbers code now partially handles tet meshes
2025-04-29 20:32:40 -06:00
John W. Parent
1252bd975c Revert "Windows Ci: Ensure consistent EOL (#49377)" (#49705)
This reverts commit f3257cea90.

This is now handled by spack/spack-infrastructure#1081
2025-04-29 16:47:29 -07:00
Robert Maaskant
6547758b2f py-hatchling: add v1.27.0 (#50146)
* py-hatchling: add v1.27.0
* py-hatchling: fix deps
2025-04-29 16:13:59 -07:00
Adam J. Stewart
c633149874 PyTorch: add v2.7.0 (#50195)
* PyTorch: add v2.7.0
* py-torchaudio: add v2.7.0
* Fix rpath issues
* PyTorch: disable libomp linking and fix rpath issue
2025-04-29 15:22:23 -07:00
Marc T. Henry de Frahan
d640ce74e0 Update openfast versions (#50228) 2025-04-29 15:15:12 -07:00
Dave Keeshan
6d2cc2d27a verilator: Add v5.036 (#50234) 2025-04-29 15:11:15 -07:00
Mike Nolta
43f180c2c5 amdblis: delete unused patch file (#50199) 2025-04-29 20:35:43 +02:00
Nai-Yuan Chiang
0685c6277e hiop: add v1.1.1 (#50069)
* use hiop new release v1.1.1
* remove "# generated" comments on language dependencies
   Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2025-04-29 11:16:10 -07:00
Dom Heinzeller
eaabde6ee9 py-netcdf4: enable non-MPI build per variant, even if netcdf-c was built with MPI (#48694)
* Add patch for py-netcdf4 so that we can build py-netcdf4 with ~mpi when netCDF was built with +mpi
* Address reviewer requests for py-netcdf4. Add conflict for 'pynetcdf4~mpi ^netcdf-c~mpi ^hdf5+mpi'
* Make py-netcdf4~mpi ^netcdf-c~mpi ^hdf5+mpi work
* Apply suggestions from code review
  Co-authored-by: Sergey Kosukhin <skosukhin@gmail.com>
* Update var/spack/repos/builtin/packages/py-netcdf4/disable_parallel_support.patch
* Apply suggestions from code review
  Co-authored-by: Sergey Kosukhin <skosukhin@gmail.com>

---------

Co-authored-by: Sergey Kosukhin <skosukhin@gmail.com>
2025-04-29 10:30:27 -07:00
Cyrus Harrison
87505fc2fc add conduit 0.9.4 release (#49862) 2025-04-29 10:21:33 -07:00
Philipp Edelmann
d7d886e3b5 zoltan: add scotch library dependency (#50163)
* zoltan: add scotch library dependency

Due to the way the shared library is built it does not pick up
dependencies to other shared libraries correctly. This adds the library
dependency manually in the same way it is already done for parmetis.

* add tukss as maintainer for zoltan
2025-04-29 10:44:43 -06:00
Wouter Deconinck
0b3bd1e294 geant4: add v11.3.2 (#50225) 2025-04-29 17:35:42 +02:00
Wouter Deconinck
b9b7450f60 Revert "XorgPackage, glx: conflicts windows and darwin (#50216)" (#50231)
This reverts commit 382847976f.
2025-04-29 14:09:40 +00:00
Harmen Stoppels
a6b0dfbd53 package_base.py: use sys.modules for module lookup (#50230) 2025-04-29 10:53:30 +00:00
Massimiliano Culpo
ecc3752ee9 fix %compiler satisfaction with specs v4 format (#50140)
This PR improves compatibility with specs installed before #45189, and with externals specifying a compiler, by using the annotated compiler to "satisfy" a spec query.

On top of that, the PR adds a new flag for:
```console
$ spack find --specfile-format -I %gcc
-- linux-ubuntu20.04-icelake / gcc@10.5.0 -----------------------
[+]  [v4] ca-certificates-mozilla@2023-05-30  [e]  [v4] cmake@3.31.6  [+]  [v4] gcc-runtime@10.5.0  [e]  [v4] glibc@2.31  [+]  [v4] gmake@4.4.1  [+]  [v4] hdf5@1.14.5  [+]  [v4] pkgconf@2.2.0  [+]  [v4] zlib-ng@2.2.1
==> 8 installed packages
```
which shows the specfile format of the specs being retrieved.
2025-04-29 10:09:49 +02:00
Stephen Nicholas Swatman
8e2caa2b83 vecmem: add v1.15.0 (#50222)
This commit adds v1.15.0 of the vecmem package.
2025-04-28 20:23:52 -06:00
Juan Miguel Carceller
25af7a36aa podio: Add an rpath variant to set the rpath (#42844)
* podio: Add an rpath variant to set the rpath

* Always set PODIO_SET_RPATH

---------

Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
2025-04-28 19:56:39 -06:00
Stephen Nicholas Swatman
38daed0a78 actsvg: use Spack pybind11 package (#50191)
* actsvg: use Spack pybind11 package

This commit makes the actsvg package use the Spack-provided pybind11
package rather than having it download its own copy.

* Make pybind dependency more flexible
2025-04-28 18:30:40 -05:00
Seth R. Johnson
fc3b732b14 vecgeom: patch missing templates for apple clang (#50210) 2025-04-28 18:29:52 -05:00
Wouter Deconinck
382847976f XorgPackage, glx: conflicts windows and darwin (#50216)
* XorgPackage: conflicts windows and darwin

* xorg: import conflicts

* xorg: fix style

* glx: conflicts windows and darwin
2025-04-28 15:33:02 -05:00
Adam J. Stewart
c1b423849c Thrift: overhaul recipe (#50106)
* Thrift: overhaul recipe

* qt5 -> qt@5
2025-04-28 10:18:56 -07:00
Mikael Simberg
45ea09a79f mold: add 2.38.1 (#50224) 2025-04-28 09:09:04 -07:00
Tuomas Koskela
b96af088d1 sopt & purify: new versions 5.0 and 5.0.1 (#48619) 2025-04-28 11:13:02 +02:00
Mikael Simberg
d47478d7b6 ut: add v2.3.1 (#50221) 2025-04-28 02:48:56 -06:00
Buldram
4763581642 nim: install dist (#50137) 2025-04-28 10:22:09 +02:00
Garth N. Wells
d264094fdc py-nanobind: add v2.7.0 (#50176) 2025-04-28 10:09:29 +02:00
Wouter Deconinck
3c8c7ef341 apptainer: there is no --with-libsubid (#50181) 2025-04-28 10:08:01 +02:00
Robert Maaskant
f83beb09ba py-typing-extensions: add v4.13.2 (#50149) 2025-04-28 10:06:58 +02:00
Nicolas Morales
3604e5bffc mdspan: add std header install option for stable (#50144)
Co-authored-by: nmm0 <nmm0@users.noreply.github.com>
2025-04-28 09:52:14 +02:00
Howard Pritchard
7fba228cf3 OpenMPI: patch release 5.0.7 for type mismatch (#50205)
related to #50187

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2025-04-28 09:26:01 +02:00
Seth R. Johnson
1d379d96ab g4emlow: remove bogus cxx requirement (#50209) 2025-04-28 09:20:30 +02:00
Juan Miguel Carceller
f3edc33a07 fastjet: add an optimization and warning flag when building (#49555)
Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
2025-04-28 09:19:28 +02:00
Sergey Kosukhin
8d4ea9dbd3 netcdf: fix up language dependencies (#50184) 2025-04-28 09:14:39 +02:00
Caetano Melone
742d313ba8 Update E4S package tags (#50173)
Most E4S packages had the "e4s" tag in their recipes; this adds it to
the rest.

list: https://e4s.io/DocPortal.html
2025-04-28 08:25:36 +02:00
Richard Berger
70407e8970 lua-sol2: add missing cmake constraint (#50218) 2025-04-28 08:18:10 +02:00
Richard Berger
2d42675035 llvm: add v20.1.1, v20.1.2, v20.1.3 (#50219) 2025-04-28 08:10:49 +02:00
Tahmid Khan
4c50915d81 crow: new package (#50009)
Co-authored-by: Tahmid A. Khan <60913202+tahmid-khan@users.noreply.github.com>
2025-04-28 08:09:52 +02:00
Jie Xu
3f8d5fed39 mesa: add v23.3.3 and use py-packaging while python>=3.12 (#49121)
* mesa: add v23.3.3 and use py-packaging while python>=3.12

* miss mako>=0.8

* use py-packaging when python3.12+

Co-authored-by: Veselin Dobrev <v-dobrev@users.noreply.github.com>

* remove python depneds_on for differnent mesa version

* mesa require python3.6+ for build

* Update var/spack/repos/builtin/packages/mesa/package.py

---------

Co-authored-by: Veselin Dobrev <v-dobrev@users.noreply.github.com>
2025-04-25 22:23:22 -07:00
Paul R. C. Kent
66c1c213b1 gcc: add v15.1.0 (#50212) 2025-04-25 22:08:01 -06:00
Mathew Cleveland
f46528ec6b draco: add v7.20.0 (#49996)
Co-authored-by: Cleveland <cleveland@lanl.gov>
2025-04-25 17:37:26 +02:00
Gregor Daiß
41489efa4c sgpp: update dependencies and variants (#49384)
* sgpp: add new variants and constraints

* sgpp: fix format

* sgpp: add missing patch

* sgpp: fix style

* sgpp: Stop applying aarch patch for newer versions

* sgpp: Better Eigen variant description

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>

* sgpp: fix format

---------

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
2025-04-25 17:32:30 +02:00
Massimiliano Culpo
3df5a85237 input_analysis.py: fix conditional requirements (#50194)
Fixes a logic bug where a -> b was assumed to imply not a -> not b
in conditional requirements.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-25 09:44:05 +02:00
Mikael Simberg
8921612f6a boost: add 1.88.0 (#50158)
* boost: add 1.88.0

* pika: add conflict with boost 1.88.0
2025-04-25 08:54:07 +02:00
Matt Thompson
e6a0a6c145 mapl: add v2.55.1 (#50201) 2025-04-24 20:40:48 -07:00
Matt Thompson
104d6b4484 mepo: add v2.3.2 (#50202) 2025-04-24 20:39:20 -07:00
Alec Scott
cba9436cf4 py-repligit: add v0.1.1 (#50204)
* py-repligit: add v0.1.1

* Add conflicts for older versions of python when at v0.1.0
2025-04-24 16:45:02 -07:00
Taillefumier Mathieu
9dc3ad4db7 [package updates] Bump version of cp2k and sirius (#50141) 2025-04-24 17:59:28 +02:00
Satish Balay
4bfd7aeb25 petsc4py: update ldshared.patch for v3.20.1, and skip for v3.23.1+ (#50170) 2025-04-24 08:50:23 -07:00
Mike Nolta
fcf615b53e namd: add v3.0.1 (#50192) 2025-04-24 07:56:35 -07:00
Wouter Deconinck
1155318534 geomodel: depend on c (#49781)
* geomodel: depend on c
* hep: add geomodel
* hep: geomodel +fullsimlight
* geomodel: depends on virtual gl, not opengl
* soqt: depends on gl and glu instead of opengl
* geomodel: rm generated comments on language dependencies
2025-04-24 10:58:49 +00:00
Peter Scheibel
a3c430e810 CompilerAdaptor: add support for opt_flags/debug_flags (#50126) 2025-04-24 07:08:54 +02:00
Alec Scott
41ff0500f9 Add ls alias to spack {compiler, external} (#50189) 2025-04-24 05:08:20 +00:00
Stephen Nicholas Swatman
059a4a58e2 covfie: depend on c (#50190)
This commit makes the covfie package explicitly depend on the C
language, as CMake enables C by default if it is not explicitly turned
off.
2025-04-23 23:03:17 -06:00
Peter Brady
14513ba76f lua-sol2: add v3.5.0 (#49970)
* sol2: update version

* fix lua version in libpressio

---------

Co-authored-by: Richard Berger <rberger@lanl.gov>
2025-04-23 13:25:00 -06:00
Alex Richert
21da90e062 crtm-fix: fix directory logic (#50172) 2025-04-23 10:55:06 -07:00
Robert Maaskant
a3c7e97463 py-build: add v1.2.2 (#50148)
* py-build: add v1.2.2
   Release notes: https://github.com/pypa/build/releases/tag/1.2.2
   Diff: https://github.com/pypa/build/compare/1.2.1...1.2.2
* py-build: fix deps
* fixup! py-build: fix deps
2025-04-23 10:16:56 -07:00
Harmen Stoppels
f7ed3ce4ae py-pillow: fix build (#50177) 2025-04-23 10:07:19 -07:00
Robert Maaskant
36caa6158a py-flit and py-flit-core: add v3.10.0 -> v3.12.0 (#50139)
* py-flit: add v3.10.0 and v3.10.1
* fixup! py-flit: add v3.10.0 and v3.10.1
* py-flit and py-flit-core: add v3.11.0
* py-flit and py-flit-core: add v3.12.0
* py-flit: some deps are runtime only
* py-flit-core: fix python dep for v3.12.0
* py-flit-core: correct versions for python dep
2025-04-23 10:04:46 -07:00
Robert Maaskant
1904d99fd0 py-trove-classifiers: add v2025.4.11.15 (#50143) 2025-04-23 08:03:20 -07:00
Robert Maaskant
de0b17c07f py-id: new package (#50145) 2025-04-23 08:01:02 -07:00
Matt Thompson
5d695623db esmf: add v8.8.1 (#50178) 2025-04-23 15:53:00 +02:00
Adam J. Stewart
3f063ace1d Add type hints to all setup_*environment functions (#49985) 2025-04-23 15:41:22 +02:00
Jonas Eschle
47b71ba8ca py-zfit-physics: new package (#43696)
* Added package
* Fix base class
   Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* fix: copyright

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2025-04-22 18:14:10 -07:00
Robert Maaskant
67eb9cfccb py-setuptools: add v78.1.1 (#50133) 2025-04-22 17:07:10 -07:00
Robert Maaskant
dddbd944a4 py-tzdata: add v2025.2 (#50138) 2025-04-22 17:04:25 -07:00
Robert Maaskant
b7d85e7694 py-packaging: add v25.0 (#50142) 2025-04-22 16:58:31 -07:00
Robert Maaskant
f4c4b06a46 py-hatch: add v1.13.0 (#50147) 2025-04-22 16:06:40 -07:00
Robert Maaskant
6995010bab py-pyproject-metadata: add v0.9.1 (#50150)
* py-pyproject-metadata: add v0.9.1
   Changelog: https://github.com/pypa/pyproject-metadata/blob/0.9.1/docs/changelog.md#091-10-03-2024
   Diff: https://github.com/pypa/pyproject-metadata/compare/0.7.1...0.9.1
* fixup! py-pyproject-metadata: add v0.9.1
2025-04-22 15:55:27 -07:00
Chris White
2d212561fb libcerf: Add new versions (#50089)
* update libcerf to use new URL and CMake for new versions but keep old URL and autoconf for 1.3
* add maintainer
* fix comment

---------

Co-authored-by: white238 <white238@users.noreply.github.com>
2025-04-22 15:47:51 -07:00
Alec Scott
7cab3e2383 g2: update for best practices (#50155) 2025-04-22 15:37:01 -07:00
SXS Bot
48ca9a5f3c spectre: add v2025.04.21 (#50153)
Co-authored-by: sxs-bot <sxs-bot@users.noreply.github.com>
2025-04-22 15:36:15 -07:00
Alec Scott
1934c8cf73 verible: update for best practices (#50154) 2025-04-22 15:34:50 -07:00
Buldram
42cd7c4f89 nim: add 2.2.4, 2.0.16 (#50166)
https://nim-lang.org//blog/2025/04/22/nim-224-2016.html
2025-04-22 15:29:56 -07:00
Matt Thompson
ce654b6882 mapl: add cxx dependence (#50168) 2025-04-22 15:27:43 -07:00
Vicente Bolea
94719a55b4 viskores: new package (#50078)
* viskores: add package

* Update var/spack/repos/builtin/packages/viskores/package.py

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>

* Apply suggestions from code review

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>

* Update var/spack/repos/builtin/packages/viskores/package.py

---------

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>
2025-04-22 16:38:26 -05:00
etiennemlb
76168292c3 pdi: refactor version handling and update to 1.8.3 (#49276)
* Refactor version handling
* Pdi fixes
  # Conflicts:
  #	var/spack/repos/builtin/packages/pdi/package.py
* Details
2025-04-22 14:34:23 -07:00
Ryan Krattiger
3fd6066e54 ci: copy logs from failed job stage dir (#49884) 2025-04-22 23:23:49 +02:00
Derek Ryan Strong
c62cc6a45d rsem: add zlib dependency (#50102) 2025-04-22 20:52:31 +02:00
Kyle Brindley
423548fc90 py-salib: add v1.4.6 -> v1.5.1 (#49941)
* MAINT: py-salib up to v1.5.1

* MAINT: black style requires trailing commas

* WIP: make pathos an optional dependency at the same version where salib upstream made it optional

* MAINT: fix run time requirements for older versions. Add build/run requirements for newere versions

* MAINT: spack style specs

* MAINT: spack package naming convention

* MAINT: match dependency order to version order
2025-04-22 10:28:35 -07:00
Chris Richardson
9010e6f556 Make PETSc an optional dependency of fenics-dolfinx (#49837)
* Make petsc optional

* Add C dependency

* Add to cmake args

* Make petsc optional

* Add C dependency

* Add to cmake args

* Update var/spack/repos/builtin/packages/fenics-dolfinx/package.py

Co-authored-by: Alec Scott <hi@alecbcs.com>

* Fix duplicate line

---------

Co-authored-by: Alec Scott <hi@alecbcs.com>
2025-04-22 10:08:27 -07:00
Stephen Nicholas Swatman
6085586407 oneapi: Move temporary home directory to stage (#50160)
When trying to use Spack to build Intel TBB on the EOS network file
system we use at CERN, I am facing the following error:

```
Launching the installer...
Installation directory is not empty.
The product cannot be installed into nonempty directory
'/eos/home-s/sswatman/spack/opt/spack/linux-x86_64_v2/...
    intel-oneapi-tbb-2021.12.0-3jlx6hlr3z6di42f3qy35eizcse7u2tk'.
```

This error appears to happen because Spack tries to set `$HOME` to the
prefix of the package, into which the Intel installer is also trying to
install it's software. I've found that an easy fix is to set `$HOME` to
a directory in the build stage instead, as this can be guaranteed to
remain empty.
2025-04-22 15:47:30 +00:00
Jonathon Anderson
dbd745bdab hpctoolkit: fix smoke test to use compiler node (#50152)
Signed-off-by: Jonathon Anderson <anderson.jonathonm@gmail.com>
2025-04-22 17:18:15 +02:00
Harmen Stoppels
31c5c0b423 directives_meta.py: remove global decl (#50162)
silence flake8
2025-04-22 17:08:14 +02:00
Andrey Perestoronin
41f99f8131 add new intel-oneapi-vtune package (#50159) 2025-04-22 08:27:59 -04:00
Alex Richert
441ade5809 wrf-io: remove check() (#50151) 2025-04-22 12:38:29 +02:00
Harmen Stoppels
60f6f8d836 python.py/r.py: fix type issues with classproperty/constant (#50059) 2025-04-22 09:53:34 +02:00
Massimiliano Culpo
5e7925c502 packages: minor improvements for compiler packages (#50111)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-22 09:53:12 +02:00
Joe
d39382bec8 Env vars docs (#49346) 2025-04-21 18:59:01 -06:00
Wouter Deconinck
be270f2311 py-zfit: add through v0.25.0 (#49349)
* py-zfit: add through v0.24.3

* hep: add py-zfit to cloud pipeline

* py-zfit: add v0.25.0

Co-authored-by: Jonas Eschle <mayou36@jonas.eschle.com>

* py-zfit: depends_on py-tensorflow(-probability) when @0.25.0:

Co-authored-by: Jonas Eschle <mayou36@jonas.eschle.com>

* py-zfit: fix style (tab to spaces)

* py-zfit: fix style

* py-zfit: depends_on py-tensorflow-probability without +py-tensorflow

* py-zfit: remove redundant type="run"

---------

Co-authored-by: Jonas Eschle <mayou36@jonas.eschle.com>
2025-04-21 10:07:43 -05:00
Dave Keeshan
c500200952 verible: add v0.0.3967 (#50122) 2025-04-21 10:08:36 +02:00
Alex Richert
71b110e6c7 g2: update recipe (#49889) 2025-04-21 01:05:14 -07:00
Andrey Prokopenko
7b877ec9e2 arborx: add version 2.0 (#50112) 2025-04-21 10:02:14 +02:00
Garth N. Wells
a74ac87d34 py-nanobind: add v2.6.1 (#50087) 2025-04-21 10:01:07 +02:00
Adam J. Stewart
796adb6b9b py-pandas: arrow+parquet when +parquet (#50119) 2025-04-21 09:54:31 +02:00
Alex Richert
2967bb5540 g2c: +utils requires +build_v2_api (#50114) 2025-04-21 09:42:22 +02:00
Robert Maaskant
9f4c677e46 trivy: v0.61.1 (#50131) 2025-04-21 09:37:38 +02:00
Robert Maaskant
1d369ba02d gh: v2.70.0 (#50132) 2025-04-21 09:37:05 +02:00
Adam J. Stewart
dcde4f9d5a fish: add v4.0.2 (#50134) 2025-04-21 09:36:30 +02:00
Robert Maaskant
3c576ca8c2 yarn: add v4.9.0 and v4.9.1 (#50135) 2025-04-21 09:36:07 +02:00
Adam J. Stewart
a89c89a23e py-smp: add v0.5.0 (#50120) 2025-04-21 09:35:26 +02:00
Adam J. Stewart
aee7455568 PyTorch: fix build with Apple Clang 17 (#50105) 2025-04-21 09:34:16 +02:00
Adam J. Stewart
69edcc6d2f py-numpy: add v2.2.5 (#50129) 2025-04-21 09:17:17 +02:00
Jiakun Yan
46263a493e lci: add v1.7.8, v1.7.9 (#50136) 2025-04-21 09:13:55 +02:00
Robert Maaskant
b24f2875e6 py-setuptools: deprecate old versions (#49595)
* setuptools: deprecated old versions

* py-zope-interface: deprecate versions requiring old setuptools verions

* py-botorch: deprecate versions requiring old setuptools verions

* py-deepsig: deprecate versions requiring old setuptools verions

* py-scipy: deprecate versions requiring old setuptools verions

* py-openslide-python: deprecate versions requiring old setuptools verions

* py-setuptools: fixup python 3.8 comment
2025-04-20 15:49:56 +02:00
Wouter Deconinck
18eebce04d external: list licensing in init summary (#46042) 2025-04-18 21:28:23 -06:00
Krishna Chilleri
f5c6e10e08 hpc-beeflow: add v0.1.10 and py-requests-unixsocket: add v0.4.1 (#49709)
* add version 0.1.10

* add hpc-beeflow v0.1.10

* force typer version to 0.5.0

* add neo4j and redis dependencies

* add method that sets the path of neo4j and redis installations

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2025-04-18 16:09:16 -07:00
jdomke
e7c17f7ed8 hpcg: compiler flag not supported by fujitsu either (#43110)
Co-authored-by: domke <673751-domke@users.noreply.gitlab.com>
2025-04-18 10:32:25 +02:00
snehring
a284cbf256 sentieon-genomics: adding v202503 (#50043)
Signed-off-by: Shane Nehring <snehring@iastate.edu>
2025-04-18 08:56:55 +02:00
Edoardo Zoni
8cbf067455 py-amrex: update maintainers (#50044) 2025-04-18 08:56:26 +02:00
Rao Garimella
875397cf16 r3d: add the shared variant (#49953) 2025-04-18 08:54:11 +02:00
Alec Scott
a38045f77e libffi: update for best practices (#50050) 2025-04-18 08:52:36 +02:00
Cameron Rutherford
31ce23f3fc libceed: add BLAS_DIR and link time blas dependency (#50033) 2025-04-18 08:52:04 +02:00
Alec Scott
9e65bd5837 zoltan: update for best practices (#50062) 2025-04-18 08:45:15 +02:00
Teague Sterling
2c1a3eff74 libdisplay-info: new package (#49653)
Signed-off-by: Teague Sterling <teaguesterling@gmail.com>
2025-04-18 08:43:47 +02:00
Alec Scott
1d81ceb101 mergiraf: new package (#50070) 2025-04-18 08:42:47 +02:00
Adam J. Stewart
044c37372a py-pillow: add v11.2.1 (#50057) 2025-04-18 08:32:34 +02:00
Matt Thompson
8f40889a46 mapl: add v2.55.0 (#50068) 2025-04-18 08:29:31 +02:00
Chris Marsh
0a0282163b libogg: fix depends_on to include cxx (#50115) 2025-04-18 00:23:09 -06:00
Adam J. Stewart
54f4530df4 py-numpy: fix support for newer macOS ld linker (#50065)
Co-authored-by: Alec Scott <hi@alecbcs.com>
2025-04-18 08:15:57 +02:00
Mikael Simberg
193f3b3c5a mimalloc: add 3.0.3 (#50109) 2025-04-18 08:14:08 +02:00
Mikael Simberg
34b0e8ebce asio: add 1.34.2 (#50110) 2025-04-18 08:12:43 +02:00
Thomas Applencourt
10109bf128 valgrind: add v3.24.0 (#50116) 2025-04-18 07:53:54 +02:00
Alec Scott
f0a7388496 py-repligit: new package (#50098) 2025-04-17 12:43:25 -04:00
Matt Thompson
45bc8fd2a3 mepo: add v2.3.1 (#50085) 2025-04-17 08:23:20 -07:00
Alec Scott
ca82085c82 covfie: update for best practices (#50064) 2025-04-17 08:21:46 -07:00
Greg Sjaardema
b97fbcb970 seacas: new version (#50049)
* Kluge to support file-per-rank and multiple-rank-single-file read/write in CGNS, other CGNS-related changes.
* Catalyst changes
* Update to latest TriBITs
* Improved static library build
* EPU: Handle case where no elements, but add_processor_id specified
* CPUP: Handle decomp-created zgc between zones better
* IOSS: Add filessystem type function (lustre, gpfs, nfs, ...)
* CPUP: Fix handling of assemblies
* IOSS: fix io_shell compare of db with no changesets
* IOSS: Cgns - handle missing assemblies correctly
* IOSS: Clean up owning_processor calculation
* EXO2MAT: Add -i option to not transfer info records to mat file
2025-04-17 10:58:06 -04:00
Miranda Mundt
cf812dd3a9 py-pyomo: add v6.9.0, v6.9.1, v6.9.2 (#50096) 2025-04-17 10:48:35 -04:00
Peter Scheibel
e78d9d93dd c23 standard typo (#50101) 2025-04-17 10:20:40 -04:00
Massimiliano Culpo
be492e1ed7 solver: encode % as "build requirement", not as "dependency" (take 2) (#50104)
reland 8fc1ccc686

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-17 15:25:02 +02:00
Rocco Meli
fcfbc28e10 dla-future-fortran: add v0.4.0 (#50095) 2025-04-17 13:02:36 +02:00
Till Ehrengruber
8fb5898d10 cudnn: aarch64 hash for several version (#46272)
* cudnn: aarch64 hash for several version

* Remove spurious newline

* Fix format

* [@spackbot] updating style on behalf of tehrengruber

* Fix cudnn 8.8 link derivation for aarch64

* Use sbsa for cudnn >= 8.3.1

* Fix typo

* Temporarily remove hashes

* Undo

* Use sbsa for cudnn >= 8.3.1

* Update hashes

---------

Co-authored-by: tehrengruber <tehrengruber@users.noreply.github.com>
Co-authored-by: Till Ehrengruber <tille@santis-ln001.cscs.ch>
2025-04-17 11:50:12 +02:00
Garth N. Wells
b75e35289c py-scikit-build-core: add v.0.11.1 (#50088) 2025-04-17 02:13:22 -06:00
AMD Toolchain Support
4024200d61 aocc: add missing attributes (#50082)
Co-authored-by: viveshar <vivek.sharma2@amd.com>
2025-04-17 02:04:12 -06:00
Vanessasaurus
eab1d6df80 flux-core: add v0.68.0 -> v0.73.0 (#49893)
* Automated deployment to update package flux-core 2025-04-04
* Add py-packaging
* Do not pin py-packaging
* flux-sched: build older flux-core

flux sched 0.38 was the first that required gcc
version 12 or higher, and flux-core continued to
build for some time, but eventually added
features that we are now seeing break with
sched 0.37 and the latest flux. This conflicts
should ensure that older flux-sched, which
is being built by having an older compiler,
only builds with flux-core up to 0.68.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>

---------

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@users.noreply.github.com>
Co-authored-by: vsoch <vsoch@users.noreply.github.com>
2025-04-17 17:00:27 +09:00
Robert Maaskant
0d7c0c8362 py-deephyper: add v0.9.3 (#49604)
* py-deephyper: deprecate versions requiring old setuptools versions

* py-deephyper: add v0.9.3

* py-deephyper: wip

* py-deephyper: use nested context managers

* py-deephyper: comment out py-pymoo dep

* py-deephyper: deprecate versions requiring old setuptools versions

* py-deephyper: add v0.9.3

* py-deephyper: wip

* py-deephyper: use nested context managers

* sync with deephyper developer spack repo

* py-deephyper: disable variants jax-cpu and redis

Both variants require depedencies missing in Spack.

* py-deephyper: add back dependencies for deprecated versions

* fixup! py-deephyper: add back dependencies for deprecated versions

* py-deephyper: fix copyright notice

* py-deephyper: add back license

---------

Co-authored-by: Brett Eiffert <eiffertbc@ornl.gov>
2025-04-17 16:55:57 +09:00
Robert Maaskant
a573f2248d new package: theia-ide (#49539) 2025-04-17 16:54:43 +09:00
Alec Scott
986102ab7a Revert "solver: encode % as "build requirement", not as "dependency" (#50011)" (#50092)
This reverts commit 8fc1ccc686.

conflicts("%gcc@:11", when="@2.17:")
conflicts("%gcc", when="+ompt")

regressed.
2025-04-17 08:45:29 +02:00
Massimiliano Culpo
04f6881b76 Environment: remove leftover code to attach test deps (#50097)
This should not be needed anymore after #49405

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-17 07:55:32 +02:00
Caetano Melone
d4582945ba py-gidgetlab: add v2.0.0, v2.0.1, v2.1.0 (#50051)
* py-gidgetlab: add v2.0.0-v2.1.0

1.1.0 doesn't work with Python 3.13.

See this commit (and the tags that contain it) for history on build
deps:
310bc109ba.

* group dependencies

Co-authored-by: Alec Scott <hi@alecbcs.com>

* set python version constraint

Co-authored-by: Alec Scott <hi@alecbcs.com>

---------

Co-authored-by: Alec Scott <hi@alecbcs.com>
2025-04-16 14:34:30 -04:00
Alberto Invernizzi
a0940510df libluv, tree-sitter, utf8-proc and unibilium: bump update of (some of) neovim deps (#50054)
* simple update of some of neovim deps

* switch to neovim fork for unibilium and add newer versions

* fix tree-sitter _DEFAULT_SOURCE vs _BSD_SOURCE

* oneliner for filter_file
2025-04-16 11:29:17 -06:00
Adam J. Stewart
c2327a2adf py-pykwalify: add v1.8.0 (#50063) 2025-04-16 13:10:30 -04:00
Kyle Brindley
4c075801db py-pathos: add v0.2.9 -> v0.3.3 (#49943)
* MAINT: add py-pathos versions

* MAINT: match version directives order in dependencies
2025-04-16 12:57:46 -04:00
Thomas Padioleau
1d27add307 Update mdspan recipe (#50046)
* Remove hard-coded compiler

* Remove compiler flags

* Use spack functions

* Add a cxxstd variant

* Replace main branch of googletest with some random not too old version
2025-04-16 12:05:10 -04:00
Robert Maaskant
3256ad8e5c py-pip: add v25.0, v25.0.1 (#49249)
* py-pip: add v25.0 and v25.0.1

Release notes:
- https://pip.pypa.io/en/stable/news/#v25-0
- https://pip.pypa.io/en/stable/news/#v25-0-1

* py-pip: add known conflict

* fixup! py-pip: add known conflict

* fixup! fixup! py-pip: add known conflict

* py-setuptools: fix typo in conflict

* fixup! py-setuptools: fix typo in conflict
2025-04-16 15:36:25 +02:00
Robert Maaskant
dc8678136c py-setuptools: add v76.1.0 -> v78.1.0 (#49680)
* py-setuptools: add v76.1.0

* py-setuptools: do not deprecate older minor and patch versions

* py-setuptools: add v77.0.1 and v77.0.3

* py-flatbuffers: constrain setuptools

* py-torchvision: constrain setuptools

* py-torch-cluster: constrain setuptools

* py-torch-scatter: constrain setuptools

* py-torch-spline-conv: constrain setuptools

* py-setuptools: add v78.0.1, v78.0.2, v78.1.0
2025-04-16 15:35:10 +02:00
Christian Lamparter
62ec0f6d33 fenics-dolfinx: add missing "c" build dependency (#50071)
building fenics-dolfinx resulted in the following error:

==> No patches needed for fenics-dolfinx
==> fenics-dolfinx: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:

3 errors found in build log:
     3     -- The C compiler identification is unknown
     4     -- The CXX compiler identification is GNU 12.2.0
     5     -- Detecting C compiler ABI info
     6     -- Detecting C compiler ABI info - failed
     7     -- Check for working C compiler: /opt/spack/[...]libexec/spack/cc
     8     -- Check for working C compiler: /opt/spack/[...]libexec/spack/cc - broken

  >> 9     CMake Error at /opt/spack/opt/spack/[...]/CMakeTestCCompiler.cmake:67 (message):
     10      The C compiler
     11
     12        "/opt/spack/opt/spack/[...]/libexec/spack/cc"
     13
     14      is not able to compile a simple test program.
     15

     ...

Thanks to @amd-toolchain-support issue #50021, this is easily fixed
by adding the one-liner for the missing dependency for the C compiler.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2025-04-16 07:16:11 -04:00
Wouter Deconinck
25d8e95ad4 go: ignore unresolved library (#50072) 2025-04-16 07:09:37 -04:00
Harmen Stoppels
883bbf3826 variants: fix narrowing multi -> single -> bool (#49880)
* `x=*` constrained by `+x` now produces a boolean valued variant instead of a multi-valued variant.
   
* Values are now always stored as a tuple internally, whether bool, single or multi-valued. 

* Value assignment has a stricter api to prevent ambiguity / type issues related to 
   `variant.value = "x"` / `variant.value = ["x"]` / `variant.value = ("x",)`. It's now `variant.set("x", ...)` for 
   single and multi-valued variants.

* The `_original_value` prop is dropped, since it was unused.

* The wildcard `*` is no longer a possible variant value in any type of variant, since the *parser*
   deals with it and creates a variant with no values.
2025-04-16 09:44:38 +02:00
Harmen Stoppels
1dc9bac745 detection/common.py: catch is_file() inside loop (#50042) 2025-04-16 09:40:14 +02:00
Peter Scheibel
8ac5398576 ci: add gawk (#50074) 2025-04-16 09:29:20 +02:00
Harmen Stoppels
dbd3895cbf version_types.py: Version -> Union[StandardVersion, GitVersion] (#50061) 2025-04-16 09:15:13 +02:00
Todd Gamblin
1d70dc8292 Remove Prolog so that GitHub detects Answer Set Programming (#50077)
This reverts a change made in #20639 to have GitHub recognize our
ASP files as Prolog, the closest langauge supported by
[Linguist](https://github.com/github-linguist/linguist) at the time.

Linguist has since
[added support for ASP](https://github.com/github-linguist/linguist/pull/7184),
so we no longer need to force Prolog detection -- our `.lp` files should
be auto-detected as ASP.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2025-04-15 22:41:53 -07:00
Alec Scott
4b2a96fe06 Improve our README to make it easier for new users (#49711) 2025-04-15 17:08:39 -04:00
John W. Parent
4a7508c9df Update make/nmake invocations (mostly Windows) (#49022)
The second change technically affects non-Windows, but the
behavior should be exactly the same:

* Packages no longer have access to `.msbuild` and `.nmake`
  automatically; they now get them via a dependency on `msvc`.
* Update two CMake-based packages that call `make test` to
  instead call `ctest` (`netcdf-cxx4` and `pegtl`).
  CMake-based packages should do this because on Windows
  `make test` will not generally work, but `ctest` does.
* Fix `openssl` "make test" on Windows (WRT prior point: not
  a CMake-based package).
2025-04-15 14:44:25 -06:00
Alec Scott
4f27ef8157 conmon: update for best practices (#50058) 2025-04-15 14:00:39 -05:00
Vicente Bolea
069010fe13 vtk-m: update to latest release (#49867)
* vtk-m: add v2.3.0 version

* Update package.py

* Update var/spack/repos/builtin/packages/vtk-m/package.py

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>

---------

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>
2025-04-15 12:40:52 -05:00
Teague Sterling
0fa64f9791 hwdata: add v0.392 and update configure args to fix data path (#49654)
* hwdata: add v0.392 and update configure args to fix data path

Signed-off-by: Teague Sterling <teaguesterling@gmail.com>

* fix styles

Signed-off-by: Teague Sterling <teaguesterling@gmail.com>

---------

Signed-off-by: Teague Sterling <teaguesterling@gmail.com>
2025-04-15 09:37:53 -07:00
Adam J. Stewart
8d23edd1a9 libpng: add v1.6.47 (#49979)
* libpng: add v1.6.47

* Add conflict
2025-04-15 12:04:38 -04:00
Alec Scott
336d33ecfa iwyu: update for best practices (#50060) 2025-04-15 09:28:27 -06:00
Rocco Meli
caaf0c50f6 dla-future: add v0.9.0 (#50055) 2025-04-15 16:00:08 +02:00
Alberto Invernizzi
6b2cd0ca45 bump iwyu (#50053) 2025-04-15 03:33:18 -06:00
Sichao25
0bec90ecd7 zoltan: add +scotch variant (#49845)
* add scotch variant to zoltan

* style fix

* apply satisfies func and F-strings
2025-04-14 15:03:39 -06:00
Stephen Nicholas Swatman
1f77b33255 covfie: add v0.13.0 (#50039)
Does what it says on the tin.
2025-04-14 13:32:59 -07:00
Wouter Deconinck
6dab20e8f8 py-particle: add v0.25.3 (#49907) 2025-04-14 11:13:21 -04:00
Wouter Deconinck
f926512cd4 conmon: add v2.1.13 (#49914) 2025-04-14 11:12:23 -04:00
Wouter Deconinck
4a08f5b6e4 sherpa: add variant internal_pdfs to avoid fortran (#49918) 2025-04-14 11:11:09 -04:00
Adam J. Stewart
2cbc21d584 Remove runtime errors for Fortran compilers (#49981) 2025-04-14 16:35:03 +02:00
Seth R. Johnson
b4646c340c dd4hep: fix inconsistent cxxstd (#50027)
* dd4hep: fix doc dependencies and made doc optional

* edm4hep: fix downstream build error in dd4hep

* dd4hep: propagate cxxstd to fix build error with +ddg4
2025-04-14 10:17:18 -04:00
Paul Gessinger
24efb56528 fastjet: ProtoJet output compilation error (#50004)
* fastjet: ProtoJet output

* switch to upstream fix

* spack wants .diff URLs apparently?

* Delete var/spack/repos/builtin/packages/fastjet/protojet.patch

* increase patch level, upper bound for patch

* Update package.py
2025-04-14 08:03:15 -06:00
Robert Maaskant
19f7a1bfbd yarn: add v4.8.1 (#49898) 2025-04-14 09:56:31 -04:00
Wouter Deconinck
bc5b57dca9 fmt: conflicts llvm@21: when @:11.0 (#49965)
* fmt: conflicts llvm@21: when @:11.0

* Update var/spack/repos/builtin/packages/fmt/package.py

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>

---------

Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
2025-04-14 07:23:31 -06:00
Harmen Stoppels
ebef5f75fb util/environment.py: allow PurePath for path modifiers and improve file/lineno of warnings (#50038) 2025-04-14 14:52:12 +02:00
Wouter Deconinck
e45ee9cb92 gaudi: add v39.3, v39.4 (#50017) 2025-04-14 12:27:37 +02:00
Robert Maaskant
900fff77cd Use gnu_mirror_path for GNU packages (#50034) 2025-04-14 12:26:30 +02:00
Robert Maaskant
e97a78ebcc Mark glibc and musl as buildable false (#50035) 2025-04-14 12:15:32 +02:00
Massimiliano Culpo
25beeef865 Environment: separate parsing concerns from SpecList (#49973)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-14 11:22:13 +02:00
Matt Thompson
b3ded1332e openblas: fixes for Xcode 16.3 darwin aarch64 (#49976) 2025-04-14 11:18:07 +02:00
Matt Thompson
b66694d1ca nag: nag provides fortran (#49895) 2025-04-14 10:41:54 +02:00
Marc T. Henry de Frahan
ebb2bb206e openfast: add v4.0.3 (#49974) 2025-04-14 10:40:44 +02:00
Adam J. Stewart
7a489e1e4e py-grpcio: add v1.71.0 (#49980) 2025-04-14 17:40:24 +09:00
Thomas Madlener
940f47a47c Fix dependency on C compiler for some packages to pass cmake or configure stage (#49993)
* genfit: depend on c compiler to fix installation issues

genfit does not specify `LANGUAGES` in their `project` declaration yet, so C is also required to pass the cmake stage.

* vbfnlo: Depend on C compiler to pass configure stage

* cppunit: Depend on C compiler to pass configure stage

* Make py-pyqt5 depend on C to fix build error

* bdsim: Depend on C to pass configure stage
2025-04-14 10:14:35 +02:00
Nathan Ellingwood
ccea1c6c9b trilinos: update for kokkos and kokkos-kernels 4.6.00 (#49977)
Corresponds to the kokkos 4.6.00 release, see PRs:
* https://github.com/spack/spack/pull/49810
* https://github.com/trilinos/Trilinos/pull/13925

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
2025-04-14 10:13:32 +02:00
Stephen Hudson
476863c4e8 libEnsemble: add v1.5.0 (#50012) 2025-04-14 10:10:20 +02:00
dependabot[bot]
7794d51adb build(deps): bump urllib3 from 2.3.0 to 2.4.0 in /lib/spack/docs (#50014)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.3.0...2.4.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 10:07:24 +02:00
Thomas Padioleau
0a6767e602 benchmark: set default build type to Release (#50013) 2025-04-14 10:06:06 +02:00
Kyle Brindley
b3585ff1b8 py-multiprocess: add v0.70.13 -> v0.70.17 (#49947) 2025-04-14 10:02:33 +02:00
Kyle Brindley
7e9c24a789 py-ppft: add v1.7.6.5 -> v1.7.6.9 (#49946) 2025-04-14 10:01:58 +02:00
Massimiliano Culpo
c5b227d14c iconv: add a strong preference on libiconv by default (#50020)
This strong preference fixes a sporadic issue when
concretizing environments with `unify:when_possible`.

In the first round of concretization, it is almost
certain that glibc is installed, and that spec might
provide iconv.

In later rounds using that as a provider might be
preferred, as it leads to less nodes to be "built".

To avoid duplication by default, prefer libiconv
in a stronger way than default preferences.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-14 09:39:54 +02:00
Joshua Finkelstein
620d5c7ef8 bml: add magma and cusolver build options (#49652) 2025-04-14 09:38:37 +02:00
AMD Toolchain Support
74f78bd24f aocl-da & aocl-utils: fix missing compiler dependencies (#50029) 2025-04-14 09:18:29 +02:00
Gerhard Theurich
fa9dcb43bd esmf: remove @:7.0 conditionals with associated patches (#50030) 2025-04-14 09:15:43 +02:00
Richard Berger
9a37a6fcb1 lammps: add versions 20250402 and 20240829.2 (#50031) 2025-04-14 09:14:22 +02:00
Edoardo Zoni
4ae4739537 warpx, py-amrex: add v25.04 (#49891) 2025-04-14 09:13:16 +02:00
Richard Berger
493a307e4f gcc: bump aarch64-darwin patches (#50032)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2025-04-12 12:37:39 +02:00
Cameron Rutherford
6fb5a1492a gslib: add shared library support (#50016) 2025-04-12 09:22:44 +02:00
Harmen Stoppels
cc3d40d9d3 fetch_strategy.py: show progress (#50003)
Show progress meter for fetches when `stdout` is a `tty`.

* fetch_strategy.py: show progress
* "Fetched: x MB at y MB/s"
* add tests, show % if content-length
2025-04-11 12:39:42 -07:00
Massimiliano Culpo
8fc1ccc686 solver: encode % as "build requirement", not as "dependency" (#50011)
This PR fixes the issues with `%` and reused specs, due to https://github.com/spack/spack/issues/49847#issuecomment-2774640234 

It does so by adding another layer of indirection, so that whenever a spec
`foo %bar` is encountered, the `%bar` part is encoded as an
`attr("build_requirement", ...)`.

Then:

1. If `foo` is a node to be built, then the build requirement implies a dependency
2. Otherwise it implies looking e.g. reused specs metadata, and ensure it matches

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-11 11:09:21 -07:00
Pranav Sivaraman
8a8d88aab9 libcxi: add dependencies for autoreconf phase (#50025) 2025-04-11 11:43:04 -06:00
Seth R. Johnson
246ac7ced9 root: remove unnecessary patches (#50022)
* root: 6.34 included this patch

* ROOT: no need to patch unless +root7 +geom +webgui
2025-04-11 13:20:04 -04:00
Harmen Stoppels
fd1b982073 solver: dump output specs to file if not satisfied (#50019)
When the solver produces specs that do not satisfy the input
constraints, dump both input and output specs as json in an temporary
dir and ask the user to upload these files in a bug report.
2025-04-11 19:01:27 +02:00
Harmen Stoppels
fd31f7e014 spec.py: remove exceptions of old concretizer (#50018) 2025-04-11 15:52:11 +02:00
Kyle Brindley
e70d7d4eb7 py-dill: add v0.3.7, v0.3.8, v0.3.9 (#49944) 2025-04-11 07:52:36 +02:00
Thomas Madlener
b4b35f9efd Make podio depend on fmt for newer versions (#49986) 2025-04-10 18:24:08 -06:00
Cody Balos
aa05af81d0 sundials: add v7.3.0 (#49972) 2025-04-10 12:26:05 -07:00
Scott Wittenburg
3da44cff0b ci: Use explicit version of notary image (#50010) 2025-04-10 13:27:36 -05:00
Kyle Shores
95de0c021b New package: musica (#49988)
* adding the musica package with git and version sha256

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2025-04-10 12:00:40 -05:00
Dave Keeshan
9347769d4b yosys: add v0.52 (#49998) 2025-04-10 09:00:29 -07:00
Harmen Stoppels
8885f6b861 defaults/config.yaml: timeout at 30s by default (#50002)
Fetching generated tarballs from github.com sometimes takes pauses for
more than 10 seconds, when the server is slow to put together the next
bits of the tarball. Default to 30s to avoid that issue.
2025-04-10 13:06:22 +02:00
Harmen Stoppels
c5e5ed3a3b rocm ecosystem: deprecate master type versions (#49982) 2025-04-10 10:43:33 +02:00
Scott Wittenburg
23d7305efd buildcache: Remove deprecated commands and arguments (#49999) 2025-04-10 09:42:01 +02:00
psakievich
252ceeedbe spack develop: avoid deprecated package_class (#49997) 2025-04-10 09:40:16 +02:00
Alex Tyler Chapman
6df832d979 Add +axom variant to the hiop spack package (#49817)
* Add missing AXOM_DIR to hiop package
* remove auto-generated compiler comments
2025-04-10 00:07:47 -06:00
Rob Latham
4a88884a8e root's new RNTuple format can use daos backends (#49849)
* root's new RNTuple format can use daos backends

* Update var/spack/repos/builtin/packages/root/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* root: fix style

* hep: root +daos

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
2025-04-09 13:14:16 -06:00
Harmen Stoppels
84dcc654ec util/environment.py: require string values in env mods (#49987) 2025-04-09 19:29:47 +02:00
Olivier Cessenat
b6722ce5c9 scotch: takes care IDXSIZE differs from INTSIZE even with cmake (#49842) 2025-04-09 11:46:48 -04:00
Robert Maaskant
1cbee69bec gh: add v2.69.0 (#49963) 2025-04-08 22:44:18 -06:00
Juan Miguel Carceller
1cf311f217 whizard: add v3.1.5 (#49785)
Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
2025-04-08 21:37:21 -07:00
Fabien Bruneval
c960fa0996 molgw: add v3.4 (#49701)
* update molgw package v3.4

* Set OpenMP variant default to False

---------

Co-authored-by: Fabien Bruneval <fabien.bruneval@.cea.fr>
2025-04-08 21:35:40 -07:00
Chris Marsh
69a95bf1f8 libpng: add v1.6.47 (#49872)
* add 1.6.47, add cmake reqs

* use open ended cmake versions

Co-authored-by: Alec Scott <hi@alecbcs.com>

---------

Co-authored-by: Alec Scott <hi@alecbcs.com>
2025-04-08 21:34:44 -07:00
Adam J. Stewart
513142f154 py-litdata: add new package (#49961) 2025-04-08 21:42:24 -06:00
Robert Maaskant
d6b6910654 go: add v1.23.8 (#49962) 2025-04-08 21:36:44 -06:00
Thomas Padioleau
ae78c7698a Add languages to PDI ecosystem (#49957) 2025-04-08 21:30:23 -06:00
Jon Rood
f4f1606298 hypre: remove shared variant default for darwin (#49749)
* hypre: remove shared variant default for darwin.

* [@spackbot] updating style on behalf of jrood-nrel

* Update var/spack/repos/builtin/packages/hypre/package.py

Co-authored-by: Victor A. P. Magri <50467563+victorapm@users.noreply.github.com>

* hypre: remove sys import.

---------

Co-authored-by: jrood-nrel <jrood-nrel@users.noreply.github.com>
Co-authored-by: Victor A. P. Magri <50467563+victorapm@users.noreply.github.com>
2025-04-08 14:26:07 -07:00
John W. Parent
d2dd4e96d9 Windows: add env name to prompts (#48819) 2025-04-08 14:16:39 -07:00
Jon Rood
4cb64e150f trilinos: patch stk to include cstddef for size_t error (#49952)
* trilinos: patch stk to include cstddef for size_t error

* Update comment.
2025-04-08 14:02:41 -06:00
Kyle Brindley
b74e23a637 pox: add v0.3.5 (#49945) 2025-04-08 12:41:46 -06:00
Harmen Stoppels
8ffd6c29bf gcc/oneapi: inject runtime iff language virtual (#49956)
Currently we inject runtimes when a package has a direct build dep on a
compiler, but what matters is whether the package depends on a language.

That way we can avoid recursion of injecting runtimes to runtimes
without a rule in the solver: runtimes don't depend on languages, they
just have a build dep on the same compiler.
2025-04-08 19:51:16 +02:00
Jon Rood
4372907fc1 h5z-zfp: update to use CMake (#49735)
* h5z-zfp: update to use CMake.

* Add depedency requirement.

* Remove shared variant.
2025-04-08 10:43:40 -07:00
Cameron Smith
63a506ed17 pumi: remove redundant compiler deps (#49936) 2025-04-08 11:39:08 -06:00
Jon Rood
382647c8af trilinos: depends on kokkos~cuda when ~cuda and kokkos~rocm when ~rocm (#49951) 2025-04-08 10:49:10 -06:00
Kyle Brindley
4b73da5bb2 scons: add v4.9.1(#49942) 2025-04-08 10:43:51 -06:00
Adam J. Stewart
17b47c9dbe py-torchmetrics: add v1.7.1 (#49955) 2025-04-08 09:41:35 -07:00
Thomas Padioleau
5075275873 Set tpadioleau and nmm0 as mdspan maintainers (#49938) 2025-04-08 10:39:10 -06:00
arezaii
2acdacb129 py-pyarrow: add depends_on c (#49940) 2025-04-08 10:38:44 -06:00
Nicholson Koukpaizan
bedc7bd518 coinhsl: fix typo when setting liblapack_path (#49937) 2025-04-08 10:38:28 -06:00
Adrien Bernede
dd8d2a2515 Radiuss-Spack-Configs update 2025-03-0 (#49637)
* Clearly split old and new hip settings requirements

* Fix style

* TO REVERT: Trigger CI

* Apply generic rocm handling to every project

* TO REVERT: Trigger CI

* Revert "TO REVERT: Trigger CI"

This reverts commit dcedb2ead5.

* Revert "TO REVERT: Trigger CI"

This reverts commit 02f76a8ca6.

* Update RADIUSS packages with latest release and sync with RSC implementation

* Update CARE package

* make default logic for hip support more robust

* TO REVERT: Trigger CI

* Fix style

* Fix style (bis)

* Shorten message

* GPU_TARGET is only necessary under certain project specific conditions, it should not be necessary in general

* Update logic to find amdclang++

* Fix syntax

* Let's postpone update of hip handling in camp

* Revert "TO REVERT: Trigger CI"

This reverts commit 620fbc1b01.

* Remove unecessary logic from CARE

* Update CARE: add 0.15.1
2025-04-08 09:29:16 -07:00
Massimiliano Culpo
129338c4c9 Group together all concretization unit test (#49960)
In this way, to run them, we just need to run:

spack unit-test lib/spack/spack/test/concretization

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-08 17:27:17 +02:00
Harmen Stoppels
e7b009e350 asp.py: reduce verbosity of "preferences" comment (#49954) 2025-04-08 15:17:21 +02:00
Massimiliano Culpo
9e6e478ccf llvm: don't detect +flang multiple times (#49876)
fixes #49831

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-08 09:12:34 +02:00
Adam J. Stewart
357089f347 py-nbstripout: add v0.8.1 (#49896) 2025-04-08 08:54:39 +02:00
Wouter Deconinck
6228247eda hep: build Geant4 with Qt5 and Qt6 (#49777)
* hep: build geant4 with qt5 and qt6

* hep: keep geant4 ~vtk for now
2025-04-08 08:51:22 +02:00
Wouter Deconinck
a919b67cb4 hep: root +arrow +emaca (#49931) 2025-04-08 08:50:52 +02:00
Wouter Deconinck
58ac6f7cba py-kiwisolver: add v1.4.6, v1.4.7, v1.4.8 (#49911) 2025-04-08 08:49:07 +02:00
Wouter Deconinck
86b57c233d apptainer: add v1.4.0 (#49912) 2025-04-08 08:48:32 +02:00
Wouter Deconinck
b6dec56f4f lbzip2: change URL and deprecate (#49948) 2025-04-08 08:26:26 +02:00
Jon Rood
d403060cf2 trilinos: patch version 16.1.0 to build on MacOS. (#49811) 2025-04-07 11:05:41 -06:00
Robert Maaskant
7d0dd27363 py-setuptools-scm: add v8.2.1 (#49901) 2025-04-07 09:56:45 -07:00
dependabot[bot]
cfbc92c2f0 build(deps): bump flake8 from 7.1.2 to 7.2.0 in /lib/spack/docs (#49816)
Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.2 to 7.2.0.
- [Commits](https://github.com/pycqa/flake8/compare/7.1.2...7.2.0)

---
updated-dependencies:
- dependency-name: flake8
  dependency-version: 7.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 09:49:58 -07:00
Wouter Deconinck
e7bca5b8f6 cppgsl: add v4.2.0 (#49915) 2025-04-07 12:46:37 -04:00
Wouter Deconinck
cf5ba8aee3 dbus: add v1.16.2 (#49916) 2025-04-07 12:46:06 -04:00
Wouter Deconinck
32a4eb4ebb jwt-cpp: add v0.7.1 (#49917)
* jwt-cpp: add v0.7.1

* jwt-cpp: depends on c only thru 0.7.0

* jwt-cpp: fix checksum
2025-04-07 09:45:24 -07:00
Adam J. Stewart
a3f4fd68d6 Packages: add missing compiler dependencies (#49920)
* Packages: add missing compiler dependencies

* Undo changes to cray-mpich
2025-04-07 09:42:54 -07:00
Wouter Deconinck
95f8c7e073 cmark: add v0.31.1 (#49913) 2025-04-07 09:41:42 -07:00
Wouter Deconinck
20f31ce39d voms: add v2.1.2 (#49921)
* voms: add v2.1.2

* voms: patch only when @:2.1.0
2025-04-07 12:39:52 -04:00
Wouter Deconinck
91ef8c056b vdt: add v0.4.5, v0.4.6 (#49922)
* vdt: add thru v0.4.6

* vdt: add maintainer
2025-04-07 12:39:01 -04:00
Wouter Deconinck
c6ce7637fc spdlog: add v1.15.2 (#49923) 2025-04-07 09:37:51 -07:00
Adam J. Stewart
770c6cc612 py-torchgeo: add v0.7.0 (#49903) 2025-04-07 09:36:52 -07:00
Wouter Deconinck
97bad2f5a7 soqt: depends on c (#49924) 2025-04-07 09:35:55 -07:00
Wouter Deconinck
8ca82fb2b6 r: add v4.4.3 (#49926) 2025-04-07 09:34:50 -07:00
Wouter Deconinck
36540708f1 py-zope-interface: add thru v7.2 (#49927) 2025-04-07 09:33:53 -07:00
Wouter Deconinck
7e027cae3e gdbm: add v1.25 (#49928) 2025-04-07 09:32:38 -07:00
Wouter Deconinck
a311d0a8c0 armadillo: add v14.4.1 (#49929) 2025-04-07 09:30:40 -07:00
Wouter Deconinck
cd8ebdcfbd embree: add v4.4.0 (#49930) 2025-04-07 09:28:43 -07:00
Wouter Deconinck
8b3bfbd95e libsm: add v1.2.6 (#49933) 2025-04-07 09:26:21 -07:00
Tahmid Khan
10afe49877 simdjson: new package (#49453)
* simdjson: new package
* simdjson: update description
* simdjson: make line lengths < 100 chars to pass style checks
* simdjson: add variants for enabling sanitizers
* simdjson: improve description
* simdjson: fixes and improvements
* simdjson: fix conditions and requirements for variants

---------

Co-authored-by: Tahmid A. Khan <60913202+tahmid-khan@users.noreply.github.com>
2025-04-07 09:21:01 -07:00
Robert Maaskant
2afbeded25 py-python-dateutil: add v2.9.0.post0 (#49527) 2025-04-07 08:04:03 -07:00
Wouter Deconinck
415055d303 scitokens-cpp: add v1.1.3 (#49925) 2025-04-07 09:45:41 -05:00
Massimiliano Culpo
081e4c463b compilers: add .stdcxx_libs to the compiler adaptor (#49873)
This property is used by a few recipes, including `cp2k` under
certain configurations

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-07 15:39:13 +02:00
Harmen Stoppels
e5ec08771b docs: editor support config files (#49935) 2025-04-07 15:35:21 +02:00
Rémi Lacroix
98605621e7 cuDDN: Add versions 9.5.1, 9.6.0, 9.7.1 and 9.8.0 (#49789) 2025-04-07 05:53:01 -06:00
Rocco Meli
625a4b854c greenx: new package (#49646)
* greenx

* [@spackbot] updating style on behalf of RMeli

* split desc

* license

* Update var/spack/repos/builtin/packages/greenx/package.py

Co-authored-by: Alberto Invernizzi <9337627+albestro@users.noreply.github.com>

---------

Co-authored-by: RMeli <RMeli@users.noreply.github.com>
Co-authored-by: Alberto Invernizzi <9337627+albestro@users.noreply.github.com>
2025-04-07 03:42:33 -06:00
Wouter Deconinck
dcf2c8744a zstd: add v1.5.7 (#49904) 2025-04-07 10:39:50 +02:00
Wouter Deconinck
d1b7cc9b5e zlib-ng: add v2.2.4 (#49905) 2025-04-07 10:39:12 +02:00
Wouter Deconinck
8fbe1ad941 libarchive: add thru v3.7.9 (#49932) 2025-04-07 10:38:54 +02:00
Vanessasaurus
440ae973d1 flux-sched: add v0.44.0 (#49894)
* Automated deployment to update package flux-sched 2025-04-04

* depends on c/cxx... order matters!

* Empty space

---------

Co-authored-by: github-actions <github-actions@users.noreply.github.com>
2025-04-06 00:22:53 -06:00
Wouter Deconinck
2cb140f9a8 py-maturin: add v1.8.3 (#49910) 2025-04-05 22:31:54 -07:00
dependabot[bot]
fb2cca4e1e build(deps): bump clingo in /.github/workflows/requirements/style (#49868)
Bumps [clingo](https://github.com/potassco/clingo) from 5.7.1 to 5.8.0.
- [Release notes](https://github.com/potassco/clingo/releases)
- [Changelog](https://github.com/potassco/clingo/blob/master/CHANGES.md)
- [Commits](https://github.com/potassco/clingo/compare/v5.7.1...v5.8.0)

---
updated-dependencies:
- dependency-name: clingo
  dependency-version: 5.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-05 22:31:31 -07:00
dependabot[bot]
03b0d299f9 build(deps): bump types-six in /.github/workflows/requirements/style (#49869)
Bumps [types-six](https://github.com/typeshed-internal/stub_uploader) from 1.17.0.20250304 to 1.17.0.20250403.
- [Commits](https://github.com/typeshed-internal/stub_uploader/commits)

---
updated-dependencies:
- dependency-name: types-six
  dependency-version: 1.17.0.20250403
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-05 22:30:35 -07:00
Robert Maaskant
8f93ea80fd util-linux-uuid: add v2.41 (#49900) 2025-04-06 01:26:11 -04:00
Wouter Deconinck
5cd5fcdd7f xtrans: add v1.6.0 (#49906) 2025-04-06 01:18:12 -04:00
Wouter Deconinck
da760a898e py-paramiko: add v3.5.1 (#49908) 2025-04-06 01:17:05 -04:00
Wouter Deconinck
dd55635fae py-mplhep: add thru v0.3.59 (#49909) 2025-04-06 01:14:31 -04:00
Richard Berger
320c758fea legion: extend slingshot11 support (#49713)
- allow conduit=ofi-slingshot11 to work with regular OpenMPI and MPICH when
  they are built with ^libfabric fabrics=cxi.
- add missing libfabric dependency for conduit=ofi-slingshot11. Embedded GASNet
  build uses PATH to detect libfabric installation.
2025-04-05 09:42:19 -07:00
Richard Berger
ff82ba24e9 kokkos: allow using new gfx942_apu arch (#48609)
Add an apu variant that promotes GPU architectures to their APU
equivalent. Right now this is just gfx942 -> gfx942_apu.
2025-04-04 22:29:29 -07:00
Alec Scott
d00b05b71e ci: decrease style checks setup time (#49888)
* ci: test speeding up style

* Combine pylint check with existing style checks to reduce overhead
2025-04-05 01:08:40 +00:00
John W. Parent
f8524f9d5e libpng package: find correct zlib library on Windows (#49034)
This explicitly specifies the correct library for zlib to CMake:

CMake's find zlib looks for zlib before zdll. On Windows, zlib is the
static lib, and zdll the import library. LibPNG only links to shared
zlib, but was getting zlib from CMake on Windows, which was resulting
in a linker failure.
2025-04-04 17:58:05 -07:00
John W. Parent
924204828e libxml2 package: add CMake builder; add version 2.13.5 (#47878) 2025-04-04 17:43:01 -07:00
Peter Brady
2f4c5f2aa2 libffi: add v3.4.7 (#49887)
* update libffi to 3.4.7
* Add conflict for libffi/apple-clang

---------

Co-authored-by: pbrady <pbrady@users.noreply.github.com>
2025-04-04 16:58:00 -06:00
12807 changed files with 194935 additions and 188559 deletions

View File

@@ -28,7 +28,7 @@ max-line-length = 99
# - F821: undefined name `name`
#
per-file-ignores =
var/spack/repos/*/package.py:F403,F405,F821
var/spack/*/package.py:F403,F405,F821
*-ci-package.py:F403,F405,F821
# exclude things we usually do not want linting for.

3
.gitattributes vendored
View File

@@ -1,4 +1,3 @@
*.py diff=python
*.lp linguist-language=Prolog
lib/spack/external/* linguist-vendored
*.bat text eol=crlf
*.bat text eol=crlf

View File

@@ -26,7 +26,7 @@ jobs:
dnf install -y \
bzip2 curl file gcc-c++ gcc gcc-gfortran git gzip \
make patch unzip which xz python3 python3-devel tree \
cmake bison bison-devel libstdc++-static
cmake bison bison-devel libstdc++-static gawk
- name: Setup OpenSUSE
if: ${{ matrix.image == 'opensuse/leap:latest' }}
run: |

View File

@@ -42,17 +42,17 @@ jobs:
# built-in repository or documentation
filters: |
bootstrap:
- 'var/spack/repos/builtin/packages/clingo-bootstrap/**'
- 'var/spack/repos/builtin/packages/clingo/**'
- 'var/spack/repos/builtin/packages/python/**'
- 'var/spack/repos/builtin/packages/re2c/**'
- 'var/spack/repos/builtin/packages/gnupg/**'
- 'var/spack/repos/builtin/packages/libassuan/**'
- 'var/spack/repos/builtin/packages/libgcrypt/**'
- 'var/spack/repos/builtin/packages/libgpg-error/**'
- 'var/spack/repos/builtin/packages/libksba/**'
- 'var/spack/repos/builtin/packages/npth/**'
- 'var/spack/repos/builtin/packages/pinentry/**'
- 'var/spack/repos/spack_repo/builtin/packages/clingo-bootstrap/**'
- 'var/spack/repos/spack_repo/builtin/packages/clingo/**'
- 'var/spack/repos/spack_repo/builtin/packages/python/**'
- 'var/spack/repos/spack_repo/builtin/packages/re2c/**'
- 'var/spack/repos/spack_repo/builtin/packages/gnupg/**'
- 'var/spack/repos/spack_repo/builtin/packages/libassuan/**'
- 'var/spack/repos/spack_repo/builtin/packages/libgcrypt/**'
- 'var/spack/repos/spack_repo/builtin/packages/libgpg-error/**'
- 'var/spack/repos/spack_repo/builtin/packages/libksba/**'
- 'var/spack/repos/spack_repo/builtin/packages/npth/**'
- 'var/spack/repos/spack_repo/builtin/packages/pinentry/**'
- 'lib/spack/**'
- 'share/spack/**'
- '.github/workflows/bootstrap.yml'

View File

@@ -25,14 +25,16 @@ jobs:
with:
python-version: '3.13'
cache: 'pip'
cache-dependency-path: '.github/workflows/requirements/style/requirements.txt'
- name: Install Python Packages
run: |
pip install --upgrade pip setuptools
pip install -r .github/workflows/requirements/style/requirements.txt
- name: vermin (Spack's Core)
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
run: |
vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
- name: vermin (Repositories)
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv var/spack/repos
run: |
vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv var/spack/repos var/spack/test_repos
# Run style checks on the files that have been changed
style:
@@ -40,23 +42,20 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
fetch-depth: 2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.13'
cache: 'pip'
cache-dependency-path: '.github/workflows/requirements/style/requirements.txt'
- name: Install Python packages
run: |
pip install --upgrade pip setuptools
pip install -r .github/workflows/requirements/style/requirements.txt
- name: Setup git configuration
run: |
# Need this for the git tests to succeed.
git --version
. .github/workflows/bin/setup_git.sh
- name: Run style tests
run: |
share/spack/qa/run-style-tests
bin/spack style --base HEAD^1
bin/spack license verify
pylint -j $(nproc) --disable=all --enable=unspecified-encoding --ignore-paths=lib/spack/external lib
audit:
uses: ./.github/workflows/audit.yaml
@@ -66,7 +65,11 @@ jobs:
python_version: '3.13'
verify-checksums:
if: ${{ inputs.with_packages == 'true' }}
# do not run if the commit message or PR description contains [skip-verify-checksums]
if: >-
${{ inputs.with_packages == 'true' &&
!contains(github.event.pull_request.body, '[skip-verify-checksums]') &&
!contains(github.event.head_commit.message, '[skip-verify-checksums]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
@@ -103,21 +106,3 @@ jobs:
spack -d bootstrap now --dev
spack -d style -t black
spack unit-test -V
# Further style checks from pylint
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.13'
cache: 'pip'
- name: Install Python packages
run: |
pip install --upgrade pip setuptools pylint
- name: Pylint (Spack Core)
run: |
pylint -j 4 --disable=all --enable=unspecified-encoding --ignore-paths=lib/spack/external lib

View File

@@ -1,7 +1,8 @@
black==25.1.0
clingo==5.7.1
clingo==5.8.0
flake8==7.2.0
isort==6.0.1
mypy==1.15.0
types-six==1.17.0.20250304
types-six==1.17.0.20250403
vermin==1.6.0
pylint==3.3.7

34
.github/workflows/sync-packages.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: sync with spack/spack-packages
on:
push:
branches:
- develop
jobs:
sync:
if: github.repository == 'spack/spack'
runs-on: ubuntu-latest
steps:
- name: Checkout spack/spack
run: git clone https://github.com/spack/spack.git
- name: Checkout spack/spack-packages
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ssh-key: ${{ secrets.SYNC_PACKAGES_KEY }}
path: spack-packages
repository: spack/spack-packages
- name: Install git-filter-repo
run: |
curl -LfsO https://raw.githubusercontent.com/newren/git-filter-repo/refs/tags/v2.47.0/git-filter-repo
echo "67447413e273fc76809289111748870b6f6072f08b17efe94863a92d810b7d94 git-filter-repo" | sha256sum -c -
chmod +x git-filter-repo
sudo mv git-filter-repo /usr/local/bin/
- name: Sync spack/spack-packages with spack/spack
run: |
cd spack-packages
git-filter-repo --quiet --source ../spack --subdirectory-filter var/spack/repos --refs develop
- name: Push
run: |
cd spack-packages
git push git@github.com:spack/spack-packages.git develop:develop --force

View File

@@ -46,18 +46,42 @@ See the
[Feature Overview](https://spack.readthedocs.io/en/latest/features.html)
for examples and highlights.
To install spack and your first package, make sure you have Python & Git.
Installation
----------------
To install spack, first make sure you have Python & Git.
Then:
$ git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git
$ cd spack/bin
$ ./spack install zlib
```bash
git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git
```
<details>
<summary>What are <code>manyFiles=true</code> and <code>--depth=2</code>?</summary>
<br>
> [!TIP]
> `-c feature.manyFiles=true` improves git's performance on repositories with 1,000+ files.
>
> `--depth=2` prunes the git history to reduce the size of the Spack installation.
</details>
```bash
# For bash/zsh/sh
. spack/share/spack/setup-env.sh
# For tcsh/csh
source spack/share/spack/setup-env.csh
# For fish
. spack/share/spack/setup-env.fish
```
```bash
# Now you're ready to install a package!
spack install zlib-ng
```
Documentation
----------------

View File

@@ -90,10 +90,9 @@ config:
misc_cache: $user_cache_path/cache
# Timeout in seconds used for downloading sources etc. This only applies
# to the connection phase and can be increased for slow connections or
# servers. 0 means no timeout.
connect_timeout: 10
# Abort downloads after this many seconds if not data is received.
# Setting this to 0 will disable the timeout.
connect_timeout: 30
# If this is false, tools like curl that use SSL will not verify

View File

@@ -25,6 +25,8 @@ packages:
glu: [apple-glu]
unwind: [apple-libunwind]
uuid: [apple-libuuid]
apple-clang:
buildable: false
apple-gl:
buildable: false
externals:

View File

@@ -72,6 +72,8 @@ packages:
permissions:
read: world
write: user
cce:
buildable: false
cray-fftw:
buildable: false
cray-libsci:
@@ -86,13 +88,23 @@ packages:
buildable: false
essl:
buildable: false
fj:
buildable: false
fujitsu-mpi:
buildable: false
fujitsu-ssl2:
buildable: false
glibc:
buildable: false
hpcx-mpi:
buildable: false
iconv:
prefer: [libiconv]
mpt:
buildable: false
musl:
buildable: false
spectrum-mpi:
buildable: false
xl:
buildable: false

View File

@@ -11,4 +11,4 @@
# ~/.spack/repos.yaml
# -------------------------------------------------------------------------
repos:
- $spack/var/spack/repos/builtin
- $spack/var/spack/repos/spack_repo/builtin

View File

@@ -23,3 +23,5 @@ packages:
mpi:
require:
- one_of: [msmpi]
msvc:
buildable: false

View File

@@ -1916,7 +1916,7 @@ diagnostics. Issues, if found, are reported to stdout:
PKG-DIRECTIVES: 1 issue found
1. lammps: wrong variant in "conflicts" directive
the variant 'adios' does not exist
in /home/spack/spack/var/spack/repos/builtin/packages/lammps/package.py
in /home/spack/spack/var/spack/repos/spack_repo/builtin/packages/lammps/package.py
------------

View File

@@ -45,10 +45,14 @@ provided binary cache, which can be a local directory or a remote URL.
Here is an example where a build cache is created in a local directory named
"spack-cache", to which we push the "ninja" spec:
ninja-1.12.1-vmvycib6vmiofkdqgrblo7zsvp7odwut
.. code-block:: console
$ spack buildcache push ./spack-cache ninja
==> Pushing binary packages to file:///home/spackuser/spack/spack-cache/build_cache
==> Selected 30 specs to push to file:///home/spackuser/spack/spack-cache
...
==> [30/30] Pushed ninja@1.12.1/ngldn2k
Note that ``ninja`` must be installed locally for this to work.
@@ -98,9 +102,10 @@ Now you can use list:
.. code-block:: console
$ spack buildcache list
==> 1 cached build.
-- linux-ubuntu20.04-skylake / gcc@9.3.0 ------------------------
ninja@1.10.2
==> 24 cached builds.
-- linux-ubuntu22.04-sapphirerapids / gcc@12.3.0 ----------------
[ ... ]
ninja@1.12.1
With ``mymirror`` configured and an index available, Spack will automatically
use it during concretization and installation. That means that you can expect
@@ -111,17 +116,17 @@ verify by re-installing ninja:
$ spack uninstall ninja
$ spack install ninja
==> Installing ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz
==> Fetching file:///home/spackuser/spack/spack-cache/build_cache/linux-ubuntu20.04-skylake-gcc-9.3.0-ninja-1.10.2-yxferyhmrjkosgta5ei6b4lqf6bxbscz.spec.json.sig
gpg: Signature made Do 12 Jan 2023 16:01:04 CET
gpg: using RSA key 61B82B2B2350E171BD17A1744E3A689061D57BF6
[ ... ]
==> Installing ninja-1.12.1-ngldn2kpvb6lqc44oqhhow7fzg7xu7lh [24/24]
gpg: Signature made Thu 06 Mar 2025 10:03:38 AM MST
gpg: using RSA key 75BC0528114909C076E2607418010FFAD73C9B07
gpg: Good signature from "example (GPG created for Spack) <example@example.com>" [ultimate]
==> Fetching file:///home/spackuser/spack/spack-cache/build_cache/linux-ubuntu20.04-skylake/gcc-9.3.0/ninja-1.10.2/linux-ubuntu20.04-skylake-gcc-9.3.0-ninja-1.10.2-yxferyhmrjkosgta5ei6b4lqf6bxbscz.spack
==> Extracting ninja-1.10.2-yxferyhmrjkosgta5ei6b4lqf6bxbscz from binary cache
==> ninja: Successfully installed ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz
Search: 0.00s. Fetch: 0.17s. Install: 0.12s. Total: 0.29s
[+] /home/harmen/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz
==> Fetching file:///home/spackuser/spack/spack-cache/blobs/sha256/f0/f08eb62661ad159d2d258890127fc6053f5302a2f490c1c7f7bd677721010ee0
==> Fetching file:///home/spackuser/spack/spack-cache/blobs/sha256/c7/c79ac6e40dfdd01ac499b020e52e57aa91151febaea3ad183f90c0f78b64a31a
==> Extracting ninja-1.12.1-ngldn2kpvb6lqc44oqhhow7fzg7xu7lh from binary cache
==> ninja: Successfully installed ninja-1.12.1-ngldn2kpvb6lqc44oqhhow7fzg7xu7lh
Search: 0.00s. Fetch: 0.11s. Install: 0.11s. Extract: 0.10s. Relocate: 0.00s. Total: 0.22s
[+] /home/spackuser/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-12.3.0/ninja-1.12.1-ngldn2kpvb6lqc44oqhhow7fzg7xu7lh
It worked! You've just completed a full example of creating a build cache with
a spec of interest, adding it as a mirror, updating its index, listing the contents,
@@ -344,19 +349,18 @@ which lets you get started quickly. See the following resources for more informa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Create tarball of installed Spack package and all dependencies.
Tarballs are checksummed and signed if gpg2 is available.
Places them in a directory ``build_cache`` that can be copied to a mirror.
Commands like ``spack buildcache install`` will search Spack mirrors for build_cache to get the list of build caches.
Tarballs and specfiles are compressed and checksummed, manifests are signed if gpg2 is available.
Commands like ``spack buildcache install`` will search Spack mirrors to get the list of build caches.
============== ========================================================================================================================
Arguments Description
============== ========================================================================================================================
``<specs>`` list of partial specs or hashes with a leading ``/`` to match from installed packages and used for creating build caches
``-d <path>`` directory in which ``build_cache`` directory is created, defaults to ``.``
``-f`` overwrite ``.spack`` file in ``build_cache`` directory if it exists
``-d <path>`` directory in which ``v3`` and ``blobs`` directories are created, defaults to ``.``
``-f`` overwrite compressed tarball and spec metadata files if they already exist
``-k <key>`` the key to sign package with. In the case where multiple keys exist, the package will be unsigned unless ``-k`` is used.
``-r`` make paths in binaries relative before creating tarball
``-y`` answer yes to all create unsigned ``build_cache`` questions
``-y`` answer yes to all questions about creating unsigned build caches
============== ========================================================================================================================
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -397,6 +401,165 @@ List public keys available on Spack mirror.
========= ==============================================
Arguments Description
========= ==============================================
``-i`` trust the keys downloaded with prompt for each
``-it`` trust the keys downloaded with prompt for each
``-y`` answer yes to all trust all keys downloaded
========= ==============================================
.. _build_cache_layout:
------------------
Build Cache Layout
------------------
This section describes the structure and content of URL-style build caches, as
distinguished from OCI-style build caches.
The entry point for a binary package is a manifest json file that points to at
least two other files stored as content-addressed blobs. These files include a spec
metadata file, as well as the installation directory of the package stored as
a compressed archive file. Binary package manifest files are named to indicate
the package name and version, as well as the hash of the concrete spec. For
example::
gcc-runtime-12.3.0-qyu2lvgt3nxh7izxycugdbgf5gsdpkjt.spec.manifest.json
would contain the manifest for a binary package of ``gcc-runtime@12.3.0``.
The id of the built package is defined to be the DAG hash of the concrete spec,
and exists in the name of the file as well. The id distinguishes a particular
binary package from all other binary packages with the same package name and
version. Below is an example binary package manifest file. Such a file would
live in the versioned spec manifests directory of a binary mirror, for example
``v3/manifests/spec/``::
{
"version": 3,
"data": [
{
"contentLength": 10731083,
"mediaType": "application/vnd.spack.install.v2.tar+gzip",
"compression": "gzip",
"checksumAlgorithm": "sha256",
"checksum": "0f24aa6b5dd7150067349865217acd3f6a383083f9eca111d2d2fed726c88210"
},
{
"contentLength": 1000,
"mediaType": "application/vnd.spack.spec.v5+json",
"compression": "gzip",
"checksumAlgorithm": "sha256",
"checksum": "fba751c4796536737c9acbb718dad7429be1fa485f5585d450ab8b25d12ae041"
}
]
}
The manifest points to both the compressed tar file as well as the compressed
spec metadata file, and contains the checksum of each. This checksum
is also used as the address of the associated file, and hence, must be
known in order to locate the tarball or spec file within the mirror. Once the
tarball or spec metadata file is downloaded, the checksum should be computed locally
and compared to the checksum in the manifest to ensure the contents have not changed
since the binary package was pushed. Spack stores all data files (including compressed
tar files, spec metadata, indices, public keys, etc) within a ``blobs/<hash-algorithm>/``
directory, using the first two characters of the checksum as a sub-directory
to reduce the number files in a single folder. Here is a depiction of the
organization of binary mirror contents::
mirror_directory/
v3/
layout.json
manifests/
spec/
gcc-runtime/
gcc-runtime-12.3.0-s2nqujezsce4x6uhtvxscu7jhewqzztx.spec.manifest.json
gmake/
gmake-4.4.1-lpr4j77rcgkg5536tmiuzwzlcjsiomph.spec.manifest.json
compiler-wrapper/
compiler-wrapper-1.0-s7ieuyievp57vwhthczhaq2ogowf3ohe.spec.manifest.json
index/
index.manifest.json
key/
75BC0528114909C076E2607418010FFAD73C9B07.key.manifest.json
keys.manifest.json
blobs/
sha256/
0f/
0f24aa6b5dd7150067349865217acd3f6a383083f9eca111d2d2fed726c88210
fb/
fba751c4796536737c9acbb718dad7429be1fa485f5585d450ab8b25d12ae041
2a/
2a21836d206ccf0df780ab0be63fdf76d24501375306a35daa6683c409b7922f
...
Files within the ``manifests`` directory are organized into subdirectories by
the type of entity they represent. Binary package manifests live in the ``spec/``
directory, binary cache index manifests live in the ``index/`` directory, and
manifests for public keys and their indices live in the ``key/`` subdirectory.
Regardless of the type of entity they represent, all manifest files are named
with an extension ``.manifest.json``.
Every manifest contains a ``data`` array, each element of which refers to an
associated file stored a content-addressed blob. Considering the example spec
manifest shown above, the compressed installation archive can be found by
picking out the data blob with the appropriate ``mediaType``, which in this
case would be ``application/vnd.spack.install.v1.tar+gzip``. The associated
file is found by looking in the blobs directory under ``blobs/sha256/fb/`` for
the file named with the complete checksum value.
As mentioned above, every entity in a binary mirror (aka build cache) is stored
as a content-addressed blob pointed to by a manifest. While an example spec
manifest (i.e. a manifest for a binary package) is shown above, here is what
the manifest of a build cache index looks like::
{
"version": 3,
"data": [
{
"contentLength": 6411,
"mediaType": "application/vnd.spack.db.v8+json",
"compression": "none",
"checksumAlgorithm": "sha256",
"checksum": "225a3e9da24d201fdf9d8247d66217f5b3f4d0fc160db1498afd998bfd115234"
}
]
}
Some things to note about this manifest are that it points to a blob that is not
compressed (``compression: "none"``), and that the ``mediaType`` is one we have
not seen yet, ``application/vnd.spack.db.v8+json``. The decision not to compress
build cache indices stems from the fact that spack does not yet sign build cache
index manifests. Once that changes, you may start to see these indices stored as
compressed blobs.
For completeness, here are examples of manifests for the other two types of entities
you might find in a spack build cache. First a public key manifest::
{
"version": 3,
"data": [
{
"contentLength": 2472,
"mediaType": "application/pgp-keys",
"compression": "none",
"checksumAlgorithm": "sha256",
"checksum": "9fc18374aebc84deb2f27898da77d4d4410e5fb44c60c6238cb57fb36147e5c7"
}
]
}
Note the ``mediaType`` of ``application/pgp-keys``. Finally, a public key index manifest::
{
"version": 3,
"data": [
{
"contentLength": 56,
"mediaType": "application/vnd.spack.keyindex.v1+json",
"compression": "none",
"checksumAlgorithm": "sha256",
"checksum": "29b3a0eb6064fd588543bc43ac7d42d708a69058dafe4be0859e3200091a9a1c"
}
]
}
Again note the ``mediaType`` of ``application/vnd.spack.keyindex.v1+json``. Also note
that both the above manifest examples refer to uncompressed blobs, this is for the same
reason spack does not yet compress build cache index blobs.

View File

@@ -83,7 +83,7 @@ packages. You can quickly find examples by running:
.. code-block:: console
$ cd var/spack/repos/builtin/packages
$ cd var/spack/repos/spack_repo/builtin/packages
$ grep -l QMakePackage */package.py

View File

@@ -27,10 +27,10 @@ it could use the ``require`` directive as follows:
Spack has a number of built-in bundle packages, such as:
* `AmdAocl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/amd-aocl/package.py>`_
* `EcpProxyApps <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/ecp-proxy-apps/package.py>`_
* `Libc <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/libc/package.py>`_
* `Xsdk <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/xsdk/package.py>`_
* `AmdAocl <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/amd_aocl/package.py>`_
* `EcpProxyApps <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/ecp_proxy_apps/package.py>`_
* `Libc <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/libc/package.py>`_
* `Xsdk <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/xsdk/package.py>`_
where ``Xsdk`` also inherits from ``CudaPackage`` and ``RocmPackage`` and
``Libc`` is a virtual bundle package for the C standard library.

View File

@@ -199,7 +199,7 @@ a variant to control this:
However, not every CMake package accepts all four of these options.
Grep the ``CMakeLists.txt`` file to see if the default values are
missing or replaced. For example, the
`dealii <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/dealii/package.py>`_
`dealii <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/dealii/package.py>`_
package overrides the default variant with:
.. code-block:: python

View File

@@ -20,8 +20,8 @@ start is to look at the definitions of other build systems. This guide
focuses mostly on how Spack's build systems work.
In this guide, we will be using the
`perl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/perl/package.py>`_ and
`cmake <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cmake/package.py>`_
`perl <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/perl/package.py>`_ and
`cmake <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/cmake/package.py>`_
packages as examples. ``perl``'s build system is a hand-written
``Configure`` shell script, while ``cmake`` bootstraps itself during
installation. Both of these packages require custom build systems.

View File

@@ -91,14 +91,14 @@ there are any other variables you need to set, you can do this in the
.. code-block:: python
def setup_build_environment(self, env):
def setup_build_environment(self, env: EnvironmentModifications) -> None:
env.set("PREFIX", prefix)
env.set("BLASLIB", spec["blas"].libs.ld_flags)
`cbench <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cbench/package.py>`_
`cbench <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/cbench/package.py>`_
is a good example of a simple package that does this, while
`esmf <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/esmf/package.py>`_
`esmf <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/esmf/package.py>`_
is a good example of a more complex package.
""""""""""""""""""""""
@@ -129,7 +129,7 @@ If you do need access to the spec, you can create a property like so:
]
`cloverleaf <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cloverleaf/package.py>`_
`cloverleaf <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/cloverleaf/package.py>`_
is a good example of a package that uses this strategy.
"""""""""""""
@@ -152,7 +152,7 @@ and a ``filter`` method to help with this. For example:
makefile.filter(r"^\s*FC\s*=.*", f"FC = {spack_fc}")
`stream <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/stream/package.py>`_
`stream <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/stream/package.py>`_
is a good example of a package that involves editing a Makefile to set
the appropriate variables.
@@ -192,7 +192,7 @@ well for storing variables:
inc.write(f"{key} = {config[key]}\n")
`elk <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/elk/package.py>`_
`elk <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/elk/package.py>`_
is a good example of a package that uses a dictionary to store
configuration variables.
@@ -213,7 +213,7 @@ them in a list:
inc.write(f"{var}\n")
`hpl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/hpl/package.py>`_
`hpl <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/hpl/package.py>`_
is a good example of a package that uses a list to store
configuration variables.

View File

@@ -39,7 +39,7 @@ for "CRAN <package-name>" and you should quickly find what you want.
If it isn't on CRAN, try Bioconductor, another common R repository.
For the purposes of this tutorial, we will be walking through
`r-caret <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/r-caret/package.py>`_
`r-caret <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/r_caret/package.py>`_
as an example. If you search for "CRAN caret", you will quickly find what
you are looking for at https://cran.r-project.org/package=caret.
https://cran.r-project.org is the main CRAN website. However, CRAN also
@@ -337,7 +337,7 @@ Non-R dependencies
^^^^^^^^^^^^^^^^^^
Some packages depend on non-R libraries for linking. Check out the
`r-stringi <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/r-stringi/package.py>`_
`r-stringi <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/r_stringi/package.py>`_
package for an example: https://cloud.r-project.org/package=stringi.
If you search for the text "SystemRequirements", you will see:
@@ -352,7 +352,7 @@ Passing arguments to the installation
Some R packages provide additional flags that can be passed to
``R CMD INSTALL``, often to locate non-R dependencies.
`r-rmpi <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/r-rmpi/package.py>`_
`r-rmpi <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/r_rmpi/package.py>`_
is an example of this, and flags for linking to an MPI library. To pass
these to the installation command, you can override ``configure_args``
like so:

View File

@@ -104,10 +104,10 @@ Finding available options
The first place to start when looking for a list of valid options to
build a package is ``scons --help``. Some packages like
`kahip <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/kahip/package.py>`_
`kahip <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/kahip/package.py>`_
don't bother overwriting the default SCons help message, so this isn't
very useful, but other packages like
`serf <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/serf/package.py>`_
`serf <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/serf/package.py>`_
print a list of valid command-line variables:
.. code-block:: console
@@ -177,7 +177,7 @@ print a list of valid command-line variables:
More advanced packages like
`cantera <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cantera/package.py>`_
`cantera <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/cantera/package.py>`_
use ``scons --help`` to print a list of subcommands:
.. code-block:: console

View File

@@ -225,8 +225,14 @@ def setup(sphinx):
("py:class", "llnl.util.lang.T"),
("py:class", "llnl.util.lang.KT"),
("py:class", "llnl.util.lang.VT"),
("py:class", "llnl.util.lang.K"),
("py:class", "llnl.util.lang.V"),
("py:class", "llnl.util.lang.ClassPropertyType"),
("py:obj", "llnl.util.lang.KT"),
("py:obj", "llnl.util.lang.VT"),
("py:obj", "llnl.util.lang.ClassPropertyType"),
("py:obj", "llnl.util.lang.K"),
("py:obj", "llnl.util.lang.V"),
]
# The reST default role (used for this markup: `text`) to use for all documents.

View File

@@ -46,6 +46,12 @@ Each Spack configuration file is nested under a top-level section
corresponding to its name. So, ``config.yaml`` starts with ``config:``,
``mirrors.yaml`` starts with ``mirrors:``, etc.
.. tip::
Validation and autocompletion of Spack config files can be enabled in
your editor with the YAML language server. See `spack/schemas
<https://github.com/spack/schemas>`_ for more information.
.. _configuration-scopes:
--------------------

View File

@@ -226,9 +226,9 @@ If all is well, you'll see something like this:
Modified files:
var/spack/repos/builtin/packages/hdf5/package.py
var/spack/repos/builtin/packages/hdf/package.py
var/spack/repos/builtin/packages/netcdf/package.py
var/spack/repos/spack_repo/builtin/packages/hdf5/package.py
var/spack/repos/spack_repo/builtin/packages/hdf/package.py
var/spack/repos/spack_repo/builtin/packages/netcdf/package.py
=======================================================
Flake8 checks were clean.
@@ -236,9 +236,9 @@ However, if you aren't compliant with PEP 8, flake8 will complain:
.. code-block:: console
var/spack/repos/builtin/packages/netcdf/package.py:26: [F401] 'os' imported but unused
var/spack/repos/builtin/packages/netcdf/package.py:61: [E303] too many blank lines (2)
var/spack/repos/builtin/packages/netcdf/package.py:106: [E501] line too long (92 > 79 characters)
var/spack/repos/spack_repo/builtin/packages/netcdf/package.py:26: [F401] 'os' imported but unused
var/spack/repos/spack_repo/builtin/packages/netcdf/package.py:61: [E303] too many blank lines (2)
var/spack/repos/spack_repo/builtin/packages/netcdf/package.py:106: [E501] line too long (92 > 79 characters)
Flake8 found errors.
Most of the error messages are straightforward, but if you don't understand what
@@ -280,7 +280,7 @@ All of these can be installed with Spack, e.g.
.. warning::
Sphinx has `several required dependencies <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-sphinx/package.py>`_.
Sphinx has `several required dependencies <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/py-sphinx/package.py>`_.
If you're using a ``python`` from Spack and you installed
``py-sphinx`` and friends, you need to make them available to your
``python``. The easiest way to do this is to run:

View File

@@ -154,9 +154,7 @@ Package-related modules
:mod:`spack.util.naming`
Contains functions for mapping between Spack package names,
Python module names, and Python class names. Functions like
:func:`~spack.util.naming.mod_to_class` handle mapping package
module names to class names.
Python module names, and Python class names.
:mod:`spack.directives`
*Directives* are functions that can be called inside a package definition

View File

@@ -0,0 +1,34 @@
.. Copyright Spack Project Developers. See COPYRIGHT file for details.
SPDX-License-Identifier: (Apache-2.0 OR MIT)
.. _env-vars-yaml:
=============================================
Environment Variable Settings (env_vars.yaml)
=============================================
Spack allows you to include shell environment variable modifications
for a spack environment by including an ``env_vars.yaml``. Environment
varaibles can be modified by setting, unsetting, appending, and prepending
variables in the shell environment.
The changes to the shell environment will take effect when the spack
environment is activated.
for example,
.. code-block:: yaml
env_vars:
set:
ENVAR_TO_SET_IN_ENV_LOAD: "FOO"
unset:
ENVAR_TO_UNSET_IN_ENV_LOAD:
prepend_path:
PATH_LIST: "path/to/prepend"
append_path:
PATH_LIST: "path/to/append"
remove_path:
PATH_LIST: "path/to/remove"

View File

@@ -539,7 +539,9 @@ from the command line.
You can also include an environment directly in the ``spack.yaml`` file. It
involves adding the ``include_concrete`` heading in the yaml followed by the
absolute path to the independent environments.
absolute path to the independent environments. Note, that you may use Spack
config variables such as ``$spack`` or environment variables as long as the
expression expands to an absolute path.
.. code-block:: yaml
@@ -549,7 +551,7 @@ absolute path to the independent environments.
unify: true
include_concrete:
- /absolute/path/to/environment1
- /absolute/path/to/environment2
- $spack/../path/to/environment2
Once the ``spack.yaml`` has been updated you must concretize the environment to
@@ -1000,6 +1002,28 @@ For example, the following environment has three root packages:
This allows for a much-needed reduction in redundancy between packages
and constraints.
-------------------------------
Modifying Environment Variables
-------------------------------
Spack Environments can modify the active shell's environment variables when activated. The environment can be
configured to set, unset, prepend, or append using ``env_vars`` configuration in the ``spack.yaml`` or through config scopes
file:
.. code-block:: yaml
spack:
env_vars:
set:
ENVAR_TO_SET_IN_ENV_LOAD: "FOO"
unset:
ENVAR_TO_UNSET_IN_ENV_LOAD:
prepend_path:
PATH_LIST: "path/to/prepend"
append_path:
PATH_LIST: "path/to/append"
remove_path:
PATH_LIST: "path/to/remove"
-----------------
Environment Views

View File

@@ -131,7 +131,7 @@ creates a simple python file:
It doesn't take much python coding to get from there to a working
package:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/libelf/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/libelf/package.py
:lines: 5-
Spack also provides wrapper functions around common commands like

View File

@@ -75,6 +75,7 @@ or refer to the full manual below.
packages_yaml
build_settings
environments
env_vars_yaml
containers
mirrors
module_file_support

View File

@@ -128,7 +128,7 @@ depend on the spec:
.. code-block:: python
def setup_run_environment(self, env):
def setup_run_environment(self, env: EnvironmentModifications) -> None:
if self.spec.satisfies("+foo"):
env.set("FOO", "bar")
@@ -142,7 +142,7 @@ For example, a simplified version of the ``python`` package could look like this
.. code-block:: python
def setup_dependent_run_environment(self, env, dependent_spec):
def setup_dependent_run_environment(self, env: EnvironmentModifications, dependent_spec: Spec) -> None:
if dependent_spec.package.extends(self.spec):
env.prepend_path("PYTHONPATH", dependent_spec.prefix.lib.python)

View File

@@ -369,9 +369,9 @@ If you have a collection of software expected to work well together with
no source code of its own, you can create a :ref:`BundlePackage <bundlepackage>`.
Examples where bundle packages can be useful include defining suites of
applications (e.g, `EcpProxyApps
<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/ecp-proxy-apps/package.py>`_), commonly used libraries
(e.g., `AmdAocl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/amd-aocl/package.py>`_),
and software development kits (e.g., `EcpDataVisSdk <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py>`_).
<https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/ecp_proxy_apps/package.py>`_), commonly used libraries
(e.g., `AmdAocl <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/amd_aocl/package.py>`_),
and software development kits (e.g., `EcpDataVisSdk <https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/ecp_data_vis_sdk/package.py>`_).
These versioned packages primarily consist of dependencies on the associated
software packages. They can include :ref:`variants <variants>` to ensure
@@ -443,7 +443,7 @@ lives in:
.. code-block:: console
$ spack location -p gmp
${SPACK_ROOT}/var/spack/repos/builtin/packages/gmp/package.py
${SPACK_ROOT}/var/spack/repos/spack_repo/builtin/packages/gmp/package.py
but ``spack edit`` provides a much simpler shortcut and saves you the
trouble of typing the full path.
@@ -457,19 +457,19 @@ live in Spack's directory structure. In general, :ref:`cmd-spack-create`
handles creating package files for you, so you can skip most of the
details here.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``var/spack/repos/builtin/packages``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``var/spack/repos/spack_repo/builtin/packages``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A Spack installation directory is structured like a standard UNIX
install prefix (``bin``, ``lib``, ``include``, ``var``, ``opt``,
etc.). Most of the code for Spack lives in ``$SPACK_ROOT/lib/spack``.
Packages themselves live in ``$SPACK_ROOT/var/spack/repos/builtin/packages``.
Packages themselves live in ``$SPACK_ROOT/var/spack/repos/spack_repo/builtin/packages``.
If you ``cd`` to that directory, you will see directories for each
package:
.. command-output:: cd $SPACK_ROOT/var/spack/repos/builtin/packages && ls
.. command-output:: cd $SPACK_ROOT/var/spack/repos/spack_repo/builtin/packages && ls
:shell:
:ellipsis: 10
@@ -479,7 +479,7 @@ package lives in:
.. code-block:: none
$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py
$SPACK_ROOT/var/spack/repos/spack_repo/builtin/packages/libelf/package.py
Alongside the ``package.py`` file, a package may contain extra
directories or files (like patches) that it needs to build.
@@ -492,12 +492,12 @@ Packages are named after the directory containing ``package.py``. So,
``libelf``'s ``package.py`` lives in a directory called ``libelf``.
The ``package.py`` file defines a class called ``Libelf``, which
extends Spack's ``Package`` class. For example, here is
``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``:
``$SPACK_ROOT/var/spack/repos/spack_repo/builtin/packages/libelf/package.py``:
.. code-block:: python
:linenos:
from spack import *
from spack.package import *
class Libelf(Package):
""" ... description ... """
@@ -520,7 +520,7 @@ these:
$ spack install libelf@0.8.13
Spack sees the package name in the spec and looks for
``libelf/package.py`` in ``var/spack/repos/builtin/packages``.
``libelf/package.py`` in ``var/spack/repos/spack_repo/builtin/packages``.
Likewise, if you run ``spack install py-numpy``, Spack looks for
``py-numpy/package.py``.
@@ -686,7 +686,7 @@ https://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.bz2
In order to handle this, you can define a ``url_for_version()`` function
like so:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/openmpi/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/openmpi/package.py
:pyobject: Openmpi.url_for_version
With the use of this ``url_for_version()``, Spack knows to download OpenMPI ``2.1.1``
@@ -787,7 +787,7 @@ of GNU. For that, Spack goes a step further and defines a mixin class that
takes care of all of the plumbing and requires packagers to just define a proper
``gnu_mirror_path`` attribute:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/autoconf/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/autoconf/package.py
:lines: 9-18
^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1089,7 +1089,7 @@ You've already seen the ``homepage`` and ``url`` package attributes:
.. code-block:: python
:linenos:
from spack import *
from spack.package import *
class Mpich(Package):
@@ -1995,7 +1995,7 @@ structure like this:
.. code-block:: none
$SPACK_ROOT/var/spack/repos/builtin/packages/
$SPACK_ROOT/var/spack/repos/spack_repo/builtin/packages/
mvapich2/
package.py
ad_lustre_rwcontig_open_source.patch
@@ -2133,7 +2133,7 @@ handles ``RPATH``:
.. _pyside-patch:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/py-pyside/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/py_pyside/package.py
:pyobject: PyPyside.patch
:linenos:
@@ -2201,7 +2201,7 @@ using the ``spack resource show`` command::
$ spack resource show 3877ab54
3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00
path: /home/spackuser/src/spack/var/spack/repos/builtin/packages/m4/gnulib-pgi.patch
path: /home/spackuser/src/spack/var/spack/repos/spack_repo/builtin/packages/m4/gnulib-pgi.patch
applies to: builtin.m4
``spack resource show`` looks up downloadable resources from package
@@ -2219,7 +2219,7 @@ wonder where the extra boost patches are coming from::
^boost@1.68.0%apple-clang@9.0.0+atomic+chrono~clanglibcpp cxxstd=default +date_time~debug+exception+filesystem+graph~icu+iostreams+locale+log+math~mpi+multithreaded~numpy patches=2ab6c72d03dec6a4ae20220a9dfd5c8c572c5294252155b85c6874d97c323199,b37164268f34f7133cbc9a4066ae98fda08adf51e1172223f6a969909216870f ~pic+program_options~python+random+regex+serialization+shared+signals~singlethreaded+system~taggedlayout+test+thread+timer~versionedlayout+wave arch=darwin-highsierra-x86_64
$ spack resource show b37164268
b37164268f34f7133cbc9a4066ae98fda08adf51e1172223f6a969909216870f
path: /home/spackuser/src/spack/var/spack/repos/builtin/packages/dealii/boost_1.68.0.patch
path: /home/spackuser/src/spack/var/spack/repos/spack_repo/builtin/packages/dealii/boost_1.68.0.patch
applies to: builtin.boost
patched by: builtin.dealii
@@ -2930,7 +2930,7 @@ this, Spack provides four different methods that can be overridden in a package:
The Qt package, for instance, uses this call:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/qt/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/qt/package.py
:pyobject: Qt.setup_dependent_build_environment
:linenos:
@@ -2958,7 +2958,7 @@ variables to be used by the dependent. This is done by implementing
:meth:`setup_dependent_package <spack.package_base.PackageBase.setup_dependent_package>`. An
example of this can be found in the ``Python`` package:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/python/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/python/package.py
:pyobject: Python.setup_dependent_package
:linenos:
@@ -3785,7 +3785,7 @@ It is usually sufficient for a packager to override a few
build system specific helper methods or attributes to provide, for instance,
configure arguments:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/m4/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/m4/package.py
:pyobject: M4.configure_args
:linenos:
@@ -4110,7 +4110,7 @@ Shell command functions
Recall the install method from ``libelf``:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/libelf/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/libelf/package.py
:pyobject: Libelf.install
:linenos:
@@ -4901,7 +4901,7 @@ the one passed to install, only the MPI implementations all set some
additional properties on it to help you out. E.g., in openmpi, you'll
find this:
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/openmpi/package.py
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/packages/openmpi/package.py
:pyobject: Openmpi.setup_dependent_package
That code allows the ``openmpi`` package to associate an ``mpicc`` property
@@ -6001,16 +6001,16 @@ with those implemented in the package itself.
* - Parent/Provider Package
- Stand-alone Tests
* - `C
<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/c>`_
<https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/c>`_
- Compiles ``hello.c`` and runs it
* - `Cxx
<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cxx>`_
<https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/cxx>`_
- Compiles and runs several ``hello`` programs
* - `Fortran
<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/fortran>`_
<https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/fortran>`_
- Compiles and runs ``hello`` programs (``F`` and ``f90``)
* - `Mpi
<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/mpi>`_
<https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/mpi>`_
- Compiles and runs ``mpi_hello`` (``c``, ``fortran``)
* - :ref:`PythonPackage <pythonpackage>`
- Imports modules listed in the ``self.import_modules`` property with defaults derived from the tarball
@@ -6031,7 +6031,7 @@ maintainers provide additional stand-alone tests customized to the package.
One example of a package that adds its own stand-alone tests to those
"inherited" by the virtual package it provides an implementation for is
the `Openmpi package
<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/openmpi/package.py>`_.
<https://github.com/spack/spack/blob/develop/var/spack/repos/spack_repo/builtin/packages/openmpi/package.py>`_.
Below are snippets from running and viewing the stand-alone test results
for ``openmpi``:
@@ -6183,7 +6183,7 @@ running:
.. code-block:: python
from spack import *
from spack.package import *
This is already part of the boilerplate for packages created with
``spack create``.

View File

@@ -9,7 +9,7 @@ Package Repositories (repos.yaml)
=================================
Spack comes with thousands of built-in package recipes in
``var/spack/repos/builtin/``. This is a **package repository** -- a
``var/spack/repos/spack_repo/builtin/``. This is a **package repository** -- a
directory that Spack searches when it needs to find a package by name.
You may need to maintain packages for restricted, proprietary or
experimental software separately from the built-in repository. Spack
@@ -69,7 +69,7 @@ The default ``etc/spack/defaults/repos.yaml`` file looks like this:
.. code-block:: yaml
repos:
- $spack/var/spack/repos/builtin
- $spack/var/spack/repos/spack_repo/builtin
The file starts with ``repos:`` and contains a single ordered list of
paths to repositories. Each path is on a separate line starting with
@@ -78,16 +78,16 @@ paths to repositories. Each path is on a separate line starting with
.. code-block:: yaml
repos:
- /opt/local-repo
- $spack/var/spack/repos/builtin
- /opt/repos/spack_repo/local_repo
- $spack/var/spack/repos/spack_repo/builtin
When Spack interprets a spec, e.g., ``mpich`` in ``spack install mpich``,
it searches these repositories in order (first to last) to resolve each
package name. In this example, Spack will look for the following
packages and use the first valid file:
1. ``/opt/local-repo/packages/mpich/package.py``
2. ``$spack/var/spack/repos/builtin/packages/mpich/package.py``
1. ``/opt/repos/spack_repo/local_repo/packages/mpich/package.py``
2. ``$spack/var/spack/repos/spack_repo/builtin/packages/mpich/package.py``
.. note::
@@ -101,14 +101,15 @@ Namespaces
Every repository in Spack has an associated **namespace** defined in its
top-level ``repo.yaml`` file. If you look at
``var/spack/repos/builtin/repo.yaml`` in the built-in repository, you'll
``var/spack/repos/spack_repo/builtin/repo.yaml`` in the built-in repository, you'll
see that its namespace is ``builtin``:
.. code-block:: console
$ cat var/spack/repos/builtin/repo.yaml
$ cat var/spack/repos/spack_repo/builtin/repo.yaml
repo:
namespace: builtin
api: v2.0
Spack records the repository namespace of each installed package. For
example, if you install the ``mpich`` package from the ``builtin`` repo,
@@ -217,15 +218,15 @@ Suppose you have three repositories: the builtin Spack repo
repo containing your own prototype packages (``proto``). Suppose they
contain packages as follows:
+--------------+------------------------------------+-----------------------------+
| Namespace | Path to repo | Packages |
+==============+====================================+=============================+
| ``proto`` | ``~/proto`` | ``mpich`` |
+--------------+------------------------------------+-----------------------------+
| ``llnl`` | ``/usr/local/llnl`` | ``hdf5`` |
+--------------+------------------------------------+-----------------------------+
| ``builtin`` | ``$spack/var/spack/repos/builtin`` | ``mpich``, ``hdf5``, others |
+--------------+------------------------------------+-----------------------------+
+--------------+-----------------------------------------------+-----------------------------+
| Namespace | Path to repo | Packages |
+==============+===============================================+=============================+
| ``proto`` | ``~/my_spack_repos/spack_repo/proto`` | ``mpich`` |
+--------------+-----------------------------------------------+-----------------------------+
| ``llnl`` | ``/usr/local/repos/spack_repo/llnl`` | ``hdf5`` |
+--------------+-----------------------------------------------+-----------------------------+
| ``builtin`` | ``$spack/var/spack/repos/spack_repo/builtin`` | ``mpich``, ``hdf5``, others |
+--------------+-----------------------------------------------+-----------------------------+
Suppose that ``hdf5`` depends on ``mpich``. You can override the
built-in ``hdf5`` by adding the ``llnl`` repo to ``repos.yaml``:
@@ -233,8 +234,8 @@ built-in ``hdf5`` by adding the ``llnl`` repo to ``repos.yaml``:
.. code-block:: yaml
repos:
- /usr/local/llnl
- $spack/var/spack/repos/builtin
- /usr/local/repos/spack_repo/llnl
- $spack/var/spack/repos/spack_repo/builtin
``spack install hdf5`` will install ``llnl.hdf5 ^builtin.mpich``.
@@ -243,9 +244,9 @@ If, instead, ``repos.yaml`` looks like this:
.. code-block:: yaml
repos:
- ~/proto
- /usr/local/llnl
- $spack/var/spack/repos/builtin
- ~/my_spack_repos/spack_repo/proto
- /usr/local/repos/spack_repo/llnl
- $spack/var/spack/repos/spack_repo/builtin
``spack install hdf5`` will install ``llnl.hdf5 ^proto.mpich``.
@@ -326,8 +327,8 @@ files, use ``spack repo list``.
$ spack repo list
==> 2 package repositories.
myrepo ~/myrepo
builtin ~/spack/var/spack/repos/builtin
myrepo v2.0 ~/my_spack_repos/spack_repo/myrepo
builtin v2.0 ~/spack/var/spack/repos/spack_repo/builtin
Each repository is listed with its associated namespace. To get the raw,
merged YAML from all configuration files, use ``spack config get repos``:
@@ -335,9 +336,9 @@ merged YAML from all configuration files, use ``spack config get repos``:
.. code-block:: console
$ spack config get repos
repos:srepos:
- ~/myrepo
- $spack/var/spack/repos/builtin
repos:
- ~/my_spack_repos/spack_repo/myrepo
- $spack/var/spack/repos/spack_repo/builtin
Note that, unlike ``spack repo list``, this does not include the
namespace, which is read from each repo's ``repo.yaml``.
@@ -351,66 +352,54 @@ yourself; you can use the ``spack repo create`` command.
.. code-block:: console
$ spack repo create myrepo
$ spack repo create ~/my_spack_repos myrepo
==> Created repo with namespace 'myrepo'.
==> To register it with spack, run this command:
spack repo add ~/myrepo
spack repo add ~/my_spack_repos/spack_repo/myrepo
$ ls myrepo
$ ls ~/my_spack_repos/spack_repo/myrepo
packages/ repo.yaml
$ cat myrepo/repo.yaml
$ cat ~/my_spack_repos/spack_repo/myrepo/repo.yaml
repo:
namespace: 'myrepo'
api: v2.0
By default, the namespace of a new repo matches its directory's name.
You can supply a custom namespace with a second argument, e.g.:
Namespaces can also be nested, which can be useful if you have
multiple package repositories for an organization. Spack will
create the corresponding directory structure for you:
.. code-block:: console
$ spack repo create myrepo llnl.comp
$ spack repo create ~/my_spack_repos llnl.comp
==> Created repo with namespace 'llnl.comp'.
==> To register it with spack, run this command:
spack repo add ~/myrepo
spack repo add ~/my_spack_repos/spack_repo/llnl/comp
$ cat myrepo/repo.yaml
$ cat ~/my_spack_repos/spack_repo/llnl/comp/repo.yaml
repo:
namespace: 'llnl.comp'
You can also create repositories with custom structure with the ``-d/--subdirectory``
argument, e.g.:
.. code-block:: console
$ spack repo create -d applications myrepo apps
==> Created repo with namespace 'apps'.
==> To register it with Spack, run this command:
spack repo add ~/myrepo
$ ls myrepo
applications/ repo.yaml
$ cat myrepo/repo.yaml
repo:
namespace: apps
subdirectory: applications
api: v2.0
^^^^^^^^^^^^^^^^^^
``spack repo add``
^^^^^^^^^^^^^^^^^^
Once your repository is created, you can register it with Spack with
``spack repo add``:
``spack repo add``. You nee to specify the path to the directory that
contains the ``repo.yaml`` file.
.. code-block:: console
$ spack repo add ./myrepo
$ spack repo add ~/my_spack_repos/spack_repo/llnl/comp
==> Added repo with namespace 'llnl.comp'.
$ spack repo list
==> 2 package repositories.
llnl.comp ~/myrepo
builtin ~/spack/var/spack/repos/builtin
llnl.comp v2.0 ~/my_spack_repos/spack_repo/llnl/comp
builtin v2.0 ~/spack/var/spack/repos/spack_repo/builtin
This simply adds the repo to your ``repos.yaml`` file.
@@ -432,46 +421,43 @@ By namespace:
.. code-block:: console
$ spack repo rm llnl.comp
==> Removed repository ~/myrepo with namespace 'llnl.comp'.
==> Removed repository ~/my_spack_repos/spack_repo/llnl/comp with namespace 'llnl.comp'.
$ spack repo list
==> 1 package repository.
builtin ~/spack/var/spack/repos/builtin
builtin ~/spack/var/spack/repos/spack_repo/builtin
By path:
.. code-block:: console
$ spack repo rm ~/myrepo
==> Removed repository ~/myrepo
$ spack repo rm ~/my_spack_repos/spack_repo/llnl/comp
==> Removed repository ~/my_spack_repos/spack_repo/llnl/comp
$ spack repo list
==> 1 package repository.
builtin ~/spack/var/spack/repos/builtin
builtin ~/spack/var/spack/repos/spack_repo/builtin
--------------------------------
Repo namespaces and Python
--------------------------------
You may have noticed that namespace notation for repositories is similar
to the notation for namespaces in Python. As it turns out, you *can*
treat Spack repositories like Python packages; this is how they are
implemented.
Package repositories are implemented as Python packages. To be precise,
they are `namespace packages
<https://packaging.python.org/en/latest/guides/packaging-namespace-packages/>`_
with ``spack_repo`` the top-level namespace, followed by the repository
namespace as submodules. For example, the builtin repository corresponds
to the Python module ``spack_repo.builtin.packages``.
You could, for example, extend a ``builtin`` package in your own
This structure allows you to extend a ``builtin`` package in your own
repository:
.. code-block:: python
from spack.pkg.builtin.mpich import Mpich
from spack_repo.builtin.packages.mpich.package import Mpich
class MyPackage(Mpich):
...
Spack repo namespaces are actually Python namespaces tacked on under
``spack.pkg``. The search semantics of ``repos.yaml`` are actually
implemented using Python's built-in `sys.path
<https://docs.python.org/2/library/sys.html#sys.path>`_ search. The
:py:mod:`spack.repo` module implements a custom `Python importer
<https://docs.python.org/2/library/imp.html>`_.
Spack populates ``sys.path`` at runtime with the path to the root of your
package repository's ``spack_repo`` directory.

View File

@@ -5,9 +5,9 @@ sphinx-rtd-theme==3.0.2
python-levenshtein==0.27.1
docutils==0.21.2
pygments==2.19.1
urllib3==2.3.0
urllib3==2.4.0
pytest==8.3.5
isort==6.0.1
black==25.1.0
flake8==7.1.2
flake8==7.2.0
mypy==1.11.1

View File

@@ -176,92 +176,72 @@ community without needing deep familiarity with GnuPG or Public Key
Infrastructure.
.. _build_cache_format:
.. _build_cache_signing:
------------------
Build Cache Format
------------------
-------------------
Build Cache Signing
-------------------
A binary package consists of a metadata file unambiguously defining the
built package (and including other details such as how to relocate it)
and the installation directory of the package stored as a compressed
archive file. The metadata files can either be unsigned, in which case
the contents are simply the json-serialized concrete spec plus metadata,
or they can be signed, in which case the json-serialized concrete spec
plus metadata is wrapped in a gpg cleartext signature. Built package
metadata files are named to indicate the operating system and
architecture for which the package was built as well as the compiler
used to build it and the packages name and version. For example::
For an in-depth description of the layout of a binary mirror, see
the :ref:`documentation<build_cache_layout>` covering binary caches. The
key takeaway from that discussion that applies here is that the entry point
to a binary package is it's manifest. The manifest refers unambiguously to the
spec metadata and compressed archive, which are stored as content-addressed
blobs.
linux-ubuntu18.04-haswell-gcc-7.5.0-zlib-1.2.12-llv2ysfdxnppzjrt5ldybb5c52qbmoow.spec.json.sig
would contain the concrete spec and binary metadata for a binary package
of ``zlib@1.2.12``, built for the ``ubuntu`` operating system and ``haswell``
architecture. The id of the built package exists in the name of the file
as well (after the package name and version) and in this case begins
with ``llv2ys``. The id distinguishes a particular built package from all
other built packages with the same os/arch, compiler, name, and version.
Below is an example of a signed binary package metadata file. Such a
file would live in the ``build_cache`` directory of a binary mirror::
The manifest files can either be signed or unsigned, but are always given
a name ending with ``.spec.manifest.json`` regardless. The difference between
signed and unsigned manifests is simply that the signed version is wrapped in
a gpg cleartext signature, as illustrated below::
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
{
"spec": {
<concrete-spec-contents-omitted>
},
"buildcache_layout_version": 1,
"binary_cache_checksum": {
"hash_algorithm": "sha256",
"hash": "4f1e46452c35a5e61bcacca205bae1bfcd60a83a399af201a29c95b7cc3e1423"
}
"version": 3,
"data": [
{
"contentLength": 10731083,
"mediaType": "application/vnd.spack.install.v2.tar+gzip",
"compression": "gzip",
"checksumAlgorithm": "sha256",
"checksum": "0f24aa6b5dd7150067349865217acd3f6a383083f9eca111d2d2fed726c88210"
},
{
"contentLength": 1000,
"mediaType": "application/vnd.spack.spec.v5+json",
"compression": "gzip",
"checksumAlgorithm": "sha256",
"checksum": "fba751c4796536737c9acbb718dad7429be1fa485f5585d450ab8b25d12ae041"
}
]
}
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEETZn0sLle8jIrdAPLx/P+voVcifMFAmKAGvwACgkQx/P+voVc
ifNoVgv/VrhA+wurVs5GB9PhmMA1m5U/AfXZb4BElDRwpT8ZcTPIv5X8xtv60eyn
4EOneGVbZoMThVxgev/NKARorGmhFXRqhWf+jknJZ1dicpqn/qpv34rELKUpgXU+
QDQ4d1P64AIdTczXe2GI9ZvhOo6+bPvK7LIsTkBbtWmopkomVxF0LcMuxAVIbA6b
887yBvVO0VGlqRnkDW7nXx49r3AG2+wDcoU1f8ep8QtjOcMNaPTPJ0UnjD0VQGW6
4ZFaGZWzdo45MY6tF3o5mqM7zJkVobpoW3iUz6J5tjz7H/nMlGgMkUwY9Kxp2PVH
qoj6Zip3LWplnl2OZyAY+vflPFdFh12Xpk4FG7Sxm/ux0r+l8tCAPvtw+G38a5P7
QEk2JBr8qMGKASmnRlJUkm1vwz0a95IF3S9YDfTAA2vz6HH3PtsNLFhtorfx8eBi
Wn5aPJAGEPOawEOvXGGbsH4cDEKPeN0n6cy1k92uPEmBLDVsdnur8q42jk5c2Qyx
j3DXty57
=3gvm
iQGzBAEBCgAdFiEEdbwFKBFJCcB24mB0GAEP+tc8mwcFAmf2rr4ACgkQGAEP+tc8
mwfefwv+KJs8MsQ5ovFaBdmyx5H/3k4rO4QHBzuSPOB6UaxErA9IyOB31iP6vNTU
HzYpxz6F5dJCJWmmNEMN/0+vjhMHEOkqd7M1l5reVcxduTF2yc4tBZUO2gienEHL
W0e+SnUznl1yc/aVpChUiahO2zToCsI8HZRNT4tu6iCnE/OpghqjsSdBOZHmSNDD
5wuuCxfDUyWI6ZlLclaaB7RdbCUUJf/iqi711J+wubvnDFhc6Ynwm1xai5laJ1bD
ev3NrSb2AAroeNFVo4iECA0fZC1OZQYzaRmAEhBXtCideGJ5Zf2Cp9hmCwNK8Hq6
bNt94JP9LqC3FCCJJOMsPyOOhMSA5MU44zyyzloRwEQpHHLuFzVdbTHA3dmTc18n
HxNLkZoEMYRc8zNr40g0yb2lCbc+P11TtL1E+5NlE34MX15mPewRCiIFTMwhCnE3
gFSKtW1MKustZE35/RUwd2mpJRf+mSRVCl1f1RiFjktLjz7vWQq7imIUSam0fPDr
XD4aDogm
=RrFX
-----END PGP SIGNATURE-----
If a user has trusted the public key associated with the private key
used to sign the above spec file, the signature can be verified with
used to sign the above manifest file, the signature can be verified with
gpg, as follows::
$ gpg verify linux-ubuntu18.04-haswell-gcc-7.5.0-zlib-1.2.12-llv2ysfdxnppzjrt5ldybb5c52qbmoow.spec.json.sig
$ gpg --verify gcc-runtime-12.3.0-s2nqujezsce4x6uhtvxscu7jhewqzztx.spec.manifest.json
The metadata (regardless whether signed or unsigned) contains the checksum
of the ``.spack`` file containing the actual installation. The checksum should
be compared to a checksum computed locally on the ``.spack`` file to ensure the
contents have not changed since the binary spec plus metadata were signed. The
``.spack`` files are actually tarballs containing the compressed archive of the
install tree. These files, along with the metadata files, live within the
``build_cache`` directory of the mirror, and together are organized as follows::
build_cache/
# unsigned metadata (for indexing, contains sha256 of .spack file)
<arch>-<compiler>-<name>-<ver>-24zvipcqgg2wyjpvdq2ajy5jnm564hen.spec.json
# clearsigned metadata (same as above, but signed)
<arch>-<compiler>-<name>-<ver>-24zvipcqgg2wyjpvdq2ajy5jnm564hen.spec.json.sig
<arch>/
<compiler>/
<name>-<ver>/
# tar.gz-compressed prefix (may support more compression formats later)
<arch>-<compiler>-<name>-<ver>-24zvipcqgg2wyjpvdq2ajy5jnm564hen.spack
Uncompressing and extracting the ``.spack`` file results in the install tree.
This is in contrast to previous versions of spack, where the ``.spack`` file
contained a (duplicated) metadata file, a signature file and a nested tarball
containing the install tree.
When attempting to install a binary package that has been signed, spack will
attempt to verify the signature with one of the trusted keys in its keyring,
and will fail if unable to do so. While not recommended, it is possible to
force installation of a signed package without verification by providing the
``--no-check-signature`` argument to ``spack install ...``.
.. _internal_implementation:
@@ -320,10 +300,10 @@ the following way:
Reputational Public Key are imported into a keyring by the ``spack gpg …``
sub-command. This is initiated by the jobs build script which is created by
the generate job at the beginning of the pipeline.
4. Assuming the package has dependencies those specs are verified using
4. Assuming the package has dependencies those spec manifests are verified using
the keyring.
5. The package is built and the spec.json is generated
6. The spec.json is signed by the keyring and uploaded to the mirrors
5. The package is built and the spec manifest is generated
6. The spec manifest is signed by the keyring and uploaded to the mirrors
build cache.
**Reputational Key**
@@ -376,24 +356,24 @@ following way:
4. In addition to the secret, the runner creates a tmpfs memory mounted
directory where the GnuPG keyring will be created to verify, and
then resign the package specs.
5. The job script syncs all spec.json.sig files from the build cache to
5. The job script syncs all spec manifest files from the build cache to
a working directory in the jobs execution environment.
6. The job script then runs the ``sign.sh`` script built into the
notary Docker image.
7. The ``sign.sh`` script imports the public components of the
Reputational and Intermediate CI Keys and uses them to verify good
signatures on the spec.json.sig files. If any signed spec does not
verify the job immediately fails.
8. Assuming all specs are verified, the ``sign.sh`` script then unpacks
the spec json data from the signed file in preparation for being
signatures on the spec.manifest.json files. If any signed manifest
does not verify, the job immediately fails.
8. Assuming all manifests are verified, the ``sign.sh`` script then unpacks
the manifest json data from the signed file in preparation for being
re-signed with the Reputational Key.
9. The private components of the Reputational Key are decrypted to
standard out using ``aws-encryption-cli`` directly into a ``gpg
import …`` statement which imports the key into the
keyring mounted in-memory.
10. The private key is then used to sign each of the json specs and the
10. The private key is then used to sign each of the manifests and the
keyring is removed from disk.
11. The re-signed json specs are resynced to the AWS S3 Mirror and the
11. The re-signed manifests are resynced to the AWS S3 Mirror and the
public signing of the packages for the develop or release pipeline
that created them is complete.

View File

@@ -11,6 +11,7 @@
* Homepage: https://altgraph.readthedocs.io/en/latest/index.html
* Usage: dependency of macholib
* Version: 0.17.3
* License: MIT
archspec
--------
@@ -18,6 +19,7 @@
* Homepage: https://pypi.python.org/pypi/archspec
* Usage: Labeling, comparison and detection of microarchitectures
* Version: 0.2.5 (commit 38ce485258ffc4fc6dd6688f8dc90cb269478c47)
* License: Apache-2.0 or MIT
astunparse
----------------
@@ -25,6 +27,7 @@
* Homepage: https://github.com/simonpercivall/astunparse
* Usage: Unparsing Python ASTs for package hashes in Spack
* Version: 1.6.3 (plus modifications)
* License: PSF-2.0
* Note: This is in ``spack.util.unparse`` because it's very heavily
modified, and we want to track coverage for it.
Specifically, we have modified this library to generate consistent unparsed ASTs
@@ -41,6 +44,7 @@
* Homepage: https://github.com/python-attrs/attrs
* Usage: Needed by jsonschema.
* Version: 22.1.0
* License: MIT
ctest_log_parser
----------------
@@ -48,6 +52,7 @@
* Homepage: https://github.com/Kitware/CMake/blob/master/Source/CTest/cmCTestBuildHandler.cxx
* Usage: Functions to parse build logs and extract error messages.
* Version: Unversioned
* License: BSD-3-Clause
* Note: This is a homemade port of Kitware's CTest build handler.
distro
@@ -56,6 +61,7 @@
* Homepage: https://pypi.python.org/pypi/distro
* Usage: Provides a more stable linux distribution detection.
* Version: 1.8.0
* License: Apache-2.0
jinja2
------
@@ -63,6 +69,7 @@
* Homepage: https://pypi.python.org/pypi/Jinja2
* Usage: A modern and designer-friendly templating language for Python.
* Version: 3.0.3 (last version supporting Python 3.6)
* License: BSD-3-Clause
jsonschema
----------
@@ -70,6 +77,7 @@
* Homepage: https://pypi.python.org/pypi/jsonschema
* Usage: An implementation of JSON Schema for Python.
* Version: 3.2.0 (last version before 2.7 and 3.6 support was dropped)
* License: MIT
* Note: We don't include tests or benchmarks; just what Spack needs.
macholib
@@ -78,6 +86,7 @@
* Homepage: https://macholib.readthedocs.io/en/latest/index.html#
* Usage: Manipulation of Mach-o binaries for relocating macOS buildcaches on Linux
* Version: 1.16.2
* License: MIT
markupsafe
----------
@@ -85,6 +94,7 @@
* Homepage: https://pypi.python.org/pypi/MarkupSafe
* Usage: Implements a XML/HTML/XHTML Markup safe string for Python.
* Version: 2.0.1 (last version supporting Python 3.6)
* License: BSD-3-Clause
pyrsistent
----------
@@ -92,6 +102,7 @@
* Homepage: http://github.com/tobgu/pyrsistent/
* Usage: Needed by `jsonschema`
* Version: 0.18.0
* License: MIT
ruamel.yaml
------
@@ -101,6 +112,7 @@
actively maintained and has more features, including round-tripping
comments read from config files.
* Version: 0.17.21
* License: MIT
six
---
@@ -108,5 +120,6 @@
* Homepage: https://pypi.python.org/pypi/six
* Usage: Python 2 and 3 compatibility utilities.
* Version: 1.16.0
* License: MIT
"""

View File

@@ -1,8 +1,8 @@
"""
altgraph.Dot - Interface to the dot language
_vendoring.altgraph.Dot - Interface to the dot language
============================================
The :py:mod:`~altgraph.Dot` module provides a simple interface to the
The :py:mod:`~_vendoring.altgraph.Dot` module provides a simple interface to the
file format used in the
`graphviz <http://www.research.att.com/sw/tools/graphviz/>`_
program. The module is intended to offload the most tedious part of the process
@@ -20,7 +20,7 @@
Here is a typical usage::
from altgraph import Graph, Dot
from _vendoring.altgraph import Graph, Dot
# create a graph
edges = [ (1,2), (1,3), (3,4), (3,5), (4,5), (5,4) ]
@@ -77,7 +77,7 @@
.. note::
dotty (invoked via :py:func:`~altgraph.Dot.display`) may not be able to
dotty (invoked via :py:func:`~_vendoring.altgraph.Dot.display`) may not be able to
display all graphics styles. To verify the output save it to an image file
and look at it that way.
@@ -111,7 +111,7 @@
import os
import warnings
from altgraph import GraphError
from _vendoring.altgraph import GraphError
class Dot(object):

View File

@@ -1,5 +1,5 @@
"""
altgraph.Graph - Base Graph class
_vendoring.altgraph.Graph - Base Graph class
=================================
..
@@ -15,7 +15,7 @@
from collections import deque
from altgraph import GraphError
from _vendoring.altgraph import GraphError
class Graph(object):

View File

@@ -1,8 +1,8 @@
"""
altgraph.GraphAlgo - Graph algorithms
_vendoring.altgraph.GraphAlgo - Graph algorithms
=====================================
"""
from altgraph import GraphError
from _vendoring.altgraph import GraphError
def dijkstra(graph, start, end=None):
@@ -25,7 +25,7 @@ def dijkstra(graph, start, end=None):
and will raise an exception if it discovers that a negative edge has
caused it to make a mistake.
Adapted to altgraph by Istvan Albert, Pennsylvania State University -
Adapted to _vendoring.altgraph by Istvan Albert, Pennsylvania State University -
June, 9 2004
"""
D = {} # dictionary of final distances

View File

@@ -1,5 +1,5 @@
"""
altgraph.GraphStat - Functions providing various graph statistics
_vendoring.altgraph.GraphStat - Functions providing various graph statistics
=================================================================
"""

View File

@@ -1,17 +1,17 @@
"""
altgraph.GraphUtil - Utility classes and functions
_vendoring.altgraph.GraphUtil - Utility classes and functions
==================================================
"""
import random
from collections import deque
from altgraph import Graph, GraphError
from _vendoring.altgraph import Graph, GraphError
def generate_random_graph(node_num, edge_num, self_loops=False, multi_edges=False):
"""
Generates and returns a :py:class:`~altgraph.Graph.Graph` instance with
Generates and returns a :py:class:`~_vendoring.altgraph.Graph.Graph` instance with
*node_num* nodes randomly connected by *edge_num* edges.
"""
g = Graph.Graph()
@@ -52,7 +52,7 @@ def generate_random_graph(node_num, edge_num, self_loops=False, multi_edges=Fals
def generate_scale_free_graph(steps, growth_num, self_loops=False, multi_edges=False):
"""
Generates and returns a :py:class:`~altgraph.Graph.Graph` instance that
Generates and returns a :py:class:`~_vendoring.altgraph.Graph.Graph` instance that
will have *steps* \\* *growth_num* nodes and a scale free (powerlaw)
connectivity. Starting with a fully connected graph with *growth_num*
nodes at every step *growth_num* nodes are added to the graph and are

View File

@@ -1,14 +1,14 @@
"""
altgraph.ObjectGraph - Graph of objects with an identifier
_vendoring.altgraph.ObjectGraph - Graph of objects with an identifier
==========================================================
A graph of objects that have a "graphident" attribute.
graphident is the key for the object in the graph
"""
from altgraph import GraphError
from altgraph.Graph import Graph
from altgraph.GraphUtil import filter_stack
from _vendoring.altgraph import GraphError
from _vendoring.altgraph.Graph import Graph
from _vendoring.altgraph.GraphUtil import filter_stack
class ObjectGraph(object):

View File

@@ -1,18 +1,18 @@
"""
altgraph - a python graph library
_vendoring.altgraph - a python graph library
=================================
altgraph is a fork of `graphlib <http://pygraphlib.sourceforge.net>`_ tailored
_vendoring.altgraph is a fork of `graphlib <http://pygraphlib.sourceforge.net>`_ tailored
to use newer Python 2.3+ features, including additional support used by the
py2app suite (modulegraph and macholib, specifically).
py2app suite (modulegraph and _vendoring.macholib, specifically).
altgraph is a python based graph (network) representation and manipulation
_vendoring.altgraph is a python based graph (network) representation and manipulation
package. It has started out as an extension to the
`graph_lib module
<http://www.ece.arizona.edu/~denny/python_nest/graph_lib_1.0.1.html>`_
written by Nathan Denny it has been significantly optimized and expanded.
The :class:`altgraph.Graph.Graph` class is loosely modeled after the
The :class:`_vendoring.altgraph.Graph.Graph` class is loosely modeled after the
`LEDA <http://www.algorithmic-solutions.com/enleda.htm>`_
(Library of Efficient Datatypes) representation. The library
includes methods for constructing graphs, BFS and DFS traversals,
@@ -22,22 +22,22 @@
The package contains the following modules:
- the :py:mod:`altgraph.Graph` module contains the
:class:`~altgraph.Graph.Graph` class that stores the graph data
- the :py:mod:`_vendoring.altgraph.Graph` module contains the
:class:`~_vendoring.altgraph.Graph.Graph` class that stores the graph data
- the :py:mod:`altgraph.GraphAlgo` module implements graph algorithms
operating on graphs (:py:class:`~altgraph.Graph.Graph`} instances)
- the :py:mod:`_vendoring.altgraph.GraphAlgo` module implements graph algorithms
operating on graphs (:py:class:`~_vendoring.altgraph.Graph.Graph`} instances)
- the :py:mod:`altgraph.GraphStat` module contains functions for
- the :py:mod:`_vendoring.altgraph.GraphStat` module contains functions for
computing statistical measures on graphs
- the :py:mod:`altgraph.GraphUtil` module contains functions for
- the :py:mod:`_vendoring.altgraph.GraphUtil` module contains functions for
generating, reading and saving graphs
- the :py:mod:`altgraph.Dot` module contains functions for displaying
- the :py:mod:`_vendoring.altgraph.Dot` module contains functions for displaying
graphs via `graphviz <http://www.research.att.com/sw/tools/graphviz/>`_
- the :py:mod:`altgraph.ObjectGraph` module implements a graph of
- the :py:mod:`_vendoring.altgraph.ObjectGraph` module implements a graph of
objects with a unique identifier
Installation
@@ -62,7 +62,7 @@
Lets assume that we want to analyze the graph below (links to the full picture)
GRAPH_IMG. Our script then might look the following way::
from altgraph import Graph, GraphAlgo, Dot
from _vendoring.altgraph import Graph, GraphAlgo, Dot
# these are the edges
edges = [ (1,2), (2,4), (1,3), (2,4), (3,4), (4,5), (6,5),
@@ -141,7 +141,7 @@
"""
import pkg_resources
__version__ = pkg_resources.require("altgraph")[0].version
__version__ = pkg_resources.require("_vendoring.altgraph")[0].version
class GraphError(ValueError):

View File

@@ -38,7 +38,7 @@
"typing.ClassVar",
"t.ClassVar",
"ClassVar",
"typing_extensions.ClassVar",
"_vendoring.typing_extensions.ClassVar",
)
# we don't use a double-underscore prefix because that triggers
# name mangling when trying to create a slot for the field

View File

@@ -1,6 +1,6 @@
# SPDX-License-Identifier: MIT
from attr import (
from _vendoring.attr import (
NOTHING,
Attribute,
Factory,
@@ -28,7 +28,7 @@
resolve_types,
validate,
)
from attr._next_gen import asdict, astuple
from _vendoring.attr._next_gen import asdict, astuple
from . import converters, exceptions, filters, setters, validators

View File

@@ -1,3 +1,3 @@
# SPDX-License-Identifier: MIT
from attr.converters import * # noqa
from _vendoring.attr.converters import * # noqa

View File

@@ -1,3 +1,3 @@
# SPDX-License-Identifier: MIT
from attr.exceptions import * # noqa
from _vendoring.attr.exceptions import * # noqa

View File

@@ -1,3 +1,3 @@
# SPDX-License-Identifier: MIT
from attr.filters import * # noqa
from _vendoring.attr.filters import * # noqa

View File

@@ -1,3 +1,3 @@
# SPDX-License-Identifier: MIT
from attr.setters import * # noqa
from _vendoring.attr.setters import * # noqa

View File

@@ -1,3 +1,3 @@
# SPDX-License-Identifier: MIT
from attr.validators import * # noqa
from _vendoring.attr.validators import * # noqa

View File

@@ -19,7 +19,7 @@
from types import CodeType
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
class _MemcachedClient(te.Protocol):
@@ -101,7 +101,7 @@ def bytecode_to_string(self) -> bytes:
class BytecodeCache:
"""To implement your own bytecode cache you have to subclass this class
and override :meth:`load_bytecode` and :meth:`dump_bytecode`. Both of
these methods are passed a :class:`~jinja2.bccache.Bucket`.
these methods are passed a :class:`~_vendoring.jinja2.bccache.Bucket`.
A very basic bytecode cache that saves the bytecode on the file system::
@@ -193,7 +193,7 @@ class FileSystemBytecodeCache(BytecodeCache):
is created for the user in the system temp directory.
The pattern can be used to have multiple separate caches operate on the
same directory. The default pattern is ``'__jinja2_%s.cache'``. ``%s``
same directory. The default pattern is ``'___vendoring.jinja2_%s.cache'``. ``%s``
is replaced with the cache key.
>>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
@@ -202,7 +202,7 @@ class FileSystemBytecodeCache(BytecodeCache):
"""
def __init__(
self, directory: t.Optional[str] = None, pattern: str = "__jinja2_%s.cache"
self, directory: t.Optional[str] = None, pattern: str = "___vendoring.jinja2_%s.cache"
) -> None:
if directory is None:
directory = self._get_default_cache_dir()
@@ -225,7 +225,7 @@ def _unsafe_dir() -> "te.NoReturn":
if not hasattr(os, "getuid"):
_unsafe_dir()
dirname = f"_jinja2-cache-{os.getuid()}"
dirname = f"__vendoring.jinja2-cache-{os.getuid()}"
actual_dir = os.path.join(tmpdir, dirname)
try:
@@ -332,7 +332,7 @@ class MemcachedBytecodeCache(BytecodeCache):
def __init__(
self,
client: "_MemcachedClient",
prefix: str = "jinja2/bytecode/",
prefix: str = "_vendoring.jinja2/bytecode/",
timeout: t.Optional[int] = None,
ignore_memcache_errors: bool = True,
):

View File

@@ -6,8 +6,8 @@
from itertools import chain
from keyword import iskeyword as is_python_keyword
from markupsafe import escape
from markupsafe import Markup
from _vendoring.markupsafe import escape
from _vendoring.markupsafe import Markup
from . import nodes
from .exceptions import TemplateAssertionError
@@ -23,7 +23,7 @@
from .visitor import NodeVisitor
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
F = t.TypeVar("F", bound=t.Callable[..., t.Any])
@@ -836,7 +836,7 @@ def visit_Template(
exported_names = sorted(exported)
self.writeline("from __future__ import generator_stop") # Python < 3.7
self.writeline("from jinja2.runtime import " + ", ".join(exported_names))
self.writeline("from _vendoring.jinja2.runtime import " + ", ".join(exported_names))
# if we want a deferred initialization we cannot move the
# environment into a local name

View File

@@ -8,7 +8,7 @@
from .utils import Namespace
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
# defaults for the parser / lexer
BLOCK_START_STRING = "{%"

View File

@@ -12,7 +12,7 @@
from functools import reduce
from types import CodeType
from markupsafe import Markup
from _vendoring.markupsafe import Markup
from . import nodes
from .compiler import CodeGenerator
@@ -55,7 +55,7 @@
from .utils import missing
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .bccache import BytecodeCache
from .ext import Extension
from .loaders import BaseLoader
@@ -126,7 +126,7 @@ def _environment_config_check(environment: "Environment") -> "Environment":
"""Perform a sanity check on the environment."""
assert issubclass(
environment.undefined, Undefined
), "'undefined' must be a subclass of 'jinja2.Undefined'."
), "'undefined' must be a subclass of '_vendoring.jinja2.Undefined'."
assert (
environment.block_start_string
!= environment.variable_start_string
@@ -221,7 +221,7 @@ class Environment:
`autoescape`
If set to ``True`` the XML/HTML autoescaping feature is enabled by
default. For more details about autoescaping see
:class:`~markupsafe.Markup`. As of Jinja 2.4 this can also
:class:`~_vendoring.markupsafe.Markup`. As of Jinja 2.4 this can also
be a callable that is passed the template name and has to
return ``True`` or ``False`` depending on autoescape should be
enabled by default.
@@ -264,7 +264,7 @@ class Environment:
#: if this environment is sandboxed. Modifying this variable won't make
#: the environment sandboxed though. For a real sandboxed environment
#: have a look at jinja2.sandbox. This flag alone controls the code
#: have a look at _vendoring.jinja2.sandbox. This flag alone controls the code
#: generation by the compiler.
sandboxed = False
@@ -279,11 +279,11 @@ class Environment:
shared = False
#: the class that is used for code generation. See
#: :class:`~jinja2.compiler.CodeGenerator` for more information.
#: :class:`~_vendoring.jinja2.compiler.CodeGenerator` for more information.
code_generator_class: t.Type["CodeGenerator"] = CodeGenerator
#: the context class that is used for templates. See
#: :class:`~jinja2.runtime.Context` for more information.
#: :class:`~_vendoring.jinja2.runtime.Context` for more information.
context_class: t.Type[Context] = Context
template_class: t.Type["Template"]
@@ -650,7 +650,7 @@ def _tokenize(
state: t.Optional[str] = None,
) -> TokenStream:
"""Called by the parser to do the preprocessing and filtering
for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`.
for all the extensions. Returns a :class:`~_vendoring.jinja2.lexer.TokenStream`.
"""
source = self.preprocess(source, name, filename)
stream = self.lexer.tokenize(source, name, filename, state)
@@ -1547,7 +1547,7 @@ def __repr__(self) -> str:
class TemplateExpression:
"""The :meth:`jinja2.Environment.compile_expression` method returns an
"""The :meth:`_vendoring.jinja2.Environment.compile_expression` method returns an
instance of this object. It encapsulates the expression-like access
to the template with an expression it wraps.
"""

View File

@@ -4,7 +4,7 @@
import typing as t
import warnings
from markupsafe import Markup
from _vendoring.markupsafe import Markup
from . import defaults
from . import nodes
@@ -18,7 +18,7 @@
from .utils import pass_context
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .lexer import Token
from .lexer import TokenStream
from .parser import Parser
@@ -108,10 +108,10 @@ def preprocess(
def filter_stream(
self, stream: "TokenStream"
) -> t.Union["TokenStream", t.Iterable["Token"]]:
"""It's passed a :class:`~jinja2.lexer.TokenStream` that can be used
"""It's passed a :class:`~_vendoring.jinja2.lexer.TokenStream` that can be used
to filter tokens returned. This method has to return an iterable of
:class:`~jinja2.lexer.Token`\\s, but it doesn't have to return a
:class:`~jinja2.lexer.TokenStream`.
:class:`~_vendoring.jinja2.lexer.Token`\\s, but it doesn't have to return a
:class:`~_vendoring.jinja2.lexer.TokenStream`.
"""
return stream
@@ -145,7 +145,7 @@ def call_method(
lineno: t.Optional[int] = None,
) -> nodes.Call:
"""Call a method of the extension. This is a shortcut for
:meth:`attr` + :class:`jinja2.nodes.Call`.
:meth:`attr` + :class:`_vendoring.jinja2.nodes.Call`.
"""
if args is None:
args = []
@@ -629,9 +629,9 @@ class DebugExtension(Extension):
.. code-block:: text
{'context': {'cycler': <class 'jinja2.utils.Cycler'>,
{'context': {'cycler': <class '_vendoring.jinja2.utils.Cycler'>,
...,
'namespace': <class 'jinja2.utils.Namespace'>},
'namespace': <class '_vendoring.jinja2.utils.Namespace'>},
'filters': ['abs', 'attr', 'batch', 'capitalize', 'center', 'count', 'd',
..., 'urlencode', 'urlize', 'wordcount', 'wordwrap', 'xmlattr'],
'tests': ['!=', '<', '<=', '==', '>', '>=', 'callable', 'defined',
@@ -679,7 +679,7 @@ def extract_from_ast(
This example explains the behavior:
>>> from jinja2 import Environment
>>> from _vendoring.jinja2 import Environment
>>> env = Environment()
>>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}')
>>> list(extract_from_ast(node))

View File

@@ -9,9 +9,9 @@
from itertools import chain
from itertools import groupby
from markupsafe import escape
from markupsafe import Markup
from markupsafe import soft_str
from _vendoring.markupsafe import escape
from _vendoring.markupsafe import Markup
from _vendoring.markupsafe import soft_str
from .async_utils import async_variant
from .async_utils import auto_aiter
@@ -28,7 +28,7 @@
from .utils import urlize
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
from .nodes import EvalContext
from .runtime import Context
@@ -48,7 +48,7 @@ def contextfilter(f: F) -> F:
"""Pass the context as the first argument to the decorated function.
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use :func:`~jinja2.pass_context`
Will be removed in Jinja 3.1. Use :func:`~_vendoring.jinja2.pass_context`
instead.
"""
warnings.warn(
@@ -66,7 +66,7 @@ def evalcontextfilter(f: F) -> F:
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use
:func:`~jinja2.pass_eval_context` instead.
:func:`~_vendoring.jinja2.pass_eval_context` instead.
.. versionadded:: 2.4
"""
@@ -85,7 +85,7 @@ def environmentfilter(f: F) -> F:
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use
:func:`~jinja2.pass_environment` instead.
:func:`~_vendoring.jinja2.pass_environment` instead.
"""
warnings.warn(
"'environmentfilter' is renamed to 'pass_environment', the old"
@@ -547,10 +547,10 @@ def do_default(
{{ ''|default('the string was empty', true) }}
.. versionchanged:: 2.11
It's now possible to configure the :class:`~jinja2.Environment` with
:class:`~jinja2.ChainableUndefined` to make the `default` filter work
It's now possible to configure the :class:`~_vendoring.jinja2.Environment` with
:class:`~_vendoring.jinja2.ChainableUndefined` to make the `default` filter work
on nested elements and attributes that may contain undefined values
in the chain without getting an :exc:`~jinja2.UndefinedError`.
in the chain without getting an :exc:`~_vendoring.jinja2.UndefinedError`.
"""
if isinstance(value, Undefined) or (boolean and not value):
return default_value

View File

@@ -14,7 +14,7 @@
from .utils import LRUCache
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
# cache for the lexers. Exists in order to be able to have multiple
@@ -400,7 +400,7 @@ def close(self) -> None:
def expect(self, expr: str) -> Token:
"""Expect a given token type and return it. This accepts the same
argument as :meth:`jinja2.lexer.Token.test`.
argument as :meth:`_vendoring.jinja2.lexer.Token.test`.
"""
if not self.current.test(expr):
expr = describe_token_expr(expr)

View File

@@ -47,7 +47,7 @@ class BaseLoader:
A very basic example for a loader that looks up templates on the file
system could look like this::
from jinja2 import BaseLoader, TemplateNotFound
from _vendoring.jinja2 import BaseLoader, TemplateNotFound
from os.path import join, exists, getmtime
class MyLoader(BaseLoader):
@@ -594,7 +594,7 @@ class ModuleLoader(BaseLoader):
def __init__(
self, path: t.Union[str, os.PathLike, t.Sequence[t.Union[str, os.PathLike]]]
) -> None:
package_name = f"_jinja2_module_templates_{id(self):x}"
package_name = f"__vendoring.jinja2_module_templates_{id(self):x}"
# create a fake module that looks for the templates in the
# path given.

View File

@@ -36,7 +36,7 @@ def find_undeclared_variables(ast: nodes.Template) -> t.Set[str]:
variables will be used depending on the path the execution takes at
runtime, all variables are returned.
>>> from jinja2 import Environment, meta
>>> from _vendoring.jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
>>> meta.find_undeclared_variables(ast) == {'bar'}
@@ -64,7 +64,7 @@ def find_referenced_templates(ast: nodes.Template) -> t.Iterator[t.Optional[str]
imports. If dynamic inheritance or inclusion is used, `None` will be
yielded.
>>> from jinja2 import Environment, meta
>>> from _vendoring.jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
>>> list(meta.find_referenced_templates(ast))

View File

@@ -7,12 +7,12 @@
import typing as t
from collections import deque
from markupsafe import Markup
from _vendoring.markupsafe import Markup
from .utils import _PassArg
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
_NodeBound = t.TypeVar("_NodeBound", bound="Node")
@@ -1041,7 +1041,7 @@ class ExtensionAttribute(Expr):
The identifier is the identifier of the :class:`Extension`.
This node is usually constructed by calling the
:meth:`~jinja2.ext.Extension.attr` method on an extension.
:meth:`~_vendoring.jinja2.ext.Extension.attr` method on an extension.
"""
fields = ("identifier", "name")
@@ -1063,7 +1063,7 @@ class ImportedName(Expr):
class InternalName(Expr):
"""An internal name in the compiler. You cannot create these nodes
yourself but the parser provides a
:meth:`~jinja2.parser.Parser.free_identifier` method that creates
:meth:`~_vendoring.jinja2.parser.Parser.free_identifier` method that creates
a new identifier for you. This identifier is not available from the
template and is not treated specially by the compiler.
"""
@@ -1114,7 +1114,7 @@ def as_const(
class ContextReference(Expr):
"""Returns the current template context. It can be used like a
:class:`Name` node, with a ``'load'`` ctx and will return the
current :class:`~jinja2.runtime.Context` object.
current :class:`~_vendoring.jinja2.runtime.Context` object.
Here an example that assigns the current template name to a
variable named `foo`::
@@ -1123,7 +1123,7 @@ class ContextReference(Expr):
Getattr(ContextReference(), 'name'))
This is basically equivalent to using the
:func:`~jinja2.pass_context` decorator when using the high-level
:func:`~_vendoring.jinja2.pass_context` decorator when using the high-level
API, which causes a reference to the context to be passed as the
first argument to a function.
"""
@@ -1188,7 +1188,7 @@ class EvalContextModifier(Stmt):
class ScopedEvalContextModifier(EvalContextModifier):
"""Modifies the eval context and reverts it later. Works exactly like
:class:`EvalContextModifier` but will only modify the
:class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
:class:`~_vendoring.jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
"""
fields = ("body",)

View File

@@ -9,7 +9,7 @@
from .lexer import describe_token_expr
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
_ImportInclude = t.TypeVar("_ImportInclude", nodes.Import, nodes.Include)
@@ -156,7 +156,7 @@ def is_tuple_end(
return False
def free_identifier(self, lineno: t.Optional[int] = None) -> nodes.InternalName:
"""Return a new free identifier as :class:`~jinja2.nodes.InternalName`."""
"""Return a new free identifier as :class:`~_vendoring.jinja2.nodes.InternalName`."""
self._last_identifier += 1
rv = object.__new__(nodes.InternalName)
nodes.Node.__init__(rv, f"fi{self._last_identifier}", lineno=lineno)
@@ -687,7 +687,7 @@ def parse_tuple(
explicit_parentheses: bool = False,
) -> t.Union[nodes.Tuple, nodes.Expr]:
"""Works like `parse_expression` but if multiple expressions are
delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.
delimited by a comma a :class:`~_vendoring.jinja2.nodes.Tuple` node is created.
This method could also return a regular expression instead of a tuple
if no commas where found.

View File

@@ -5,9 +5,9 @@
from collections import abc
from itertools import chain
from markupsafe import escape # noqa: F401
from markupsafe import Markup
from markupsafe import soft_str
from _vendoring.markupsafe import escape # noqa: F401
from _vendoring.markupsafe import Markup
from _vendoring.markupsafe import soft_str
from .async_utils import auto_aiter
from .async_utils import auto_await # noqa: F401
@@ -28,7 +28,7 @@
if t.TYPE_CHECKING:
import logging
import typing_extensions as te
import _vendoring.typing_extensions as te
from .environment import Environment
class LoopRenderFunc(te.Protocol):
@@ -849,7 +849,7 @@ class Undefined:
>>> foo + 42
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
_vendoring.jinja2.exceptions.UndefinedError: 'foo' is undefined
"""
__slots__ = (
@@ -1020,7 +1020,7 @@ class ChainableUndefined(Undefined):
>>> foo.bar['baz'] + 42
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
_vendoring.jinja2.exceptions.UndefinedError: 'foo' is undefined
.. versionadded:: 2.11.0
"""
@@ -1047,7 +1047,7 @@ class DebugUndefined(Undefined):
>>> foo + 42
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
_vendoring.jinja2.exceptions.UndefinedError: 'foo' is undefined
"""
__slots__ = ()
@@ -1077,15 +1077,15 @@ class StrictUndefined(Undefined):
>>> str(foo)
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
_vendoring.jinja2.exceptions.UndefinedError: 'foo' is undefined
>>> not foo
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
_vendoring.jinja2.exceptions.UndefinedError: 'foo' is undefined
>>> foo + 42
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
_vendoring.jinja2.exceptions.UndefinedError: 'foo' is undefined
"""
__slots__ = ()

View File

@@ -9,8 +9,8 @@
from collections import deque
from string import Formatter
from markupsafe import EscapeFormatter
from markupsafe import Markup
from _vendoring.markupsafe import EscapeFormatter
from _vendoring.markupsafe import Markup
from .environment import Environment
from .exceptions import SecurityError
@@ -128,7 +128,7 @@ def is_internal_attribute(obj: t.Any, attr: str) -> bool:
python objects. This is useful if the environment method
:meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.
>>> from jinja2.sandbox import is_internal_attribute
>>> from _vendoring.jinja2.sandbox import is_internal_attribute
>>> is_internal_attribute(str, "mro")
True
>>> is_internal_attribute(str, "upper")

View File

@@ -12,10 +12,10 @@
from types import CodeType
from urllib.parse import quote_from_bytes
import markupsafe
import _vendoring.markupsafe
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
F = t.TypeVar("F", bound=t.Callable[..., t.Any])
@@ -28,7 +28,7 @@
def pass_context(f: F) -> F:
"""Pass the :class:`~jinja2.runtime.Context` as the first argument
"""Pass the :class:`~_vendoring.jinja2.runtime.Context` as the first argument
to the decorated function when called while rendering a template.
Can be used on functions, filters, and tests.
@@ -45,7 +45,7 @@ def pass_context(f: F) -> F:
def pass_eval_context(f: F) -> F:
"""Pass the :class:`~jinja2.nodes.EvalContext` as the first argument
"""Pass the :class:`~_vendoring.jinja2.nodes.EvalContext` as the first argument
to the decorated function when called while rendering a template.
See :ref:`eval-context`.
@@ -62,7 +62,7 @@ def pass_eval_context(f: F) -> F:
def pass_environment(f: F) -> F:
"""Pass the :class:`~jinja2.Environment` as the first argument to
"""Pass the :class:`~_vendoring.jinja2.Environment` as the first argument to
the decorated function when called while rendering a template.
Can be used on functions, filters, and tests.
@@ -104,7 +104,7 @@ def contextfunction(f: F) -> F:
"""Pass the context as the first argument to the decorated function.
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use :func:`~jinja2.pass_context`
Will be removed in Jinja 3.1. Use :func:`~_vendoring.jinja2.pass_context`
instead.
"""
warnings.warn(
@@ -122,7 +122,7 @@ def evalcontextfunction(f: F) -> F:
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use
:func:`~jinja2.pass_eval_context` instead.
:func:`~_vendoring.jinja2.pass_eval_context` instead.
.. versionadded:: 2.4
"""
@@ -141,7 +141,7 @@ def environmentfunction(f: F) -> F:
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use
:func:`~jinja2.pass_environment` instead.
:func:`~_vendoring.jinja2.pass_environment` instead.
"""
warnings.warn(
"'environmentfunction' is renamed to 'pass_environment', the"
@@ -335,9 +335,9 @@ def trim_url(x: str) -> str:
def trim_url(x: str) -> str:
return x
words = re.split(r"(\s+)", str(markupsafe.escape(text)))
rel_attr = f' rel="{markupsafe.escape(rel)}"' if rel else ""
target_attr = f' target="{markupsafe.escape(target)}"' if target else ""
words = re.split(r"(\s+)", str(_vendoring.markupsafe.escape(text)))
rel_attr = f' rel="{_vendoring.markupsafe.escape(rel)}"' if rel else ""
target_attr = f' target="{_vendoring.markupsafe.escape(target)}"' if target else ""
for i, word in enumerate(words):
head, middle, tail = "", word, ""
@@ -455,8 +455,8 @@ def generate_lorem_ipsum(
if not html:
return "\n\n".join(result)
return markupsafe.Markup(
"\n".join(f"<p>{markupsafe.escape(x)}</p>" for x in result)
return _vendoring.markupsafe.Markup(
"\n".join(f"<p>{_vendoring.markupsafe.escape(x)}</p>" for x in result)
)
@@ -658,7 +658,7 @@ def select_autoescape(
If you want to enable it for all templates created from strings or
for all templates with `.html` and `.xml` extensions::
from jinja2 import Environment, select_autoescape
from _vendoring.jinja2 import Environment, select_autoescape
env = Environment(autoescape=select_autoescape(
enabled_extensions=('html', 'xml'),
default_for_string=True,
@@ -667,7 +667,7 @@ def select_autoescape(
Example configuration to turn it on at all times except if the template
ends with `.txt`::
from jinja2 import Environment, select_autoescape
from _vendoring.jinja2 import Environment, select_autoescape
env = Environment(autoescape=select_autoescape(
disabled_extensions=('txt',),
default_for_string=True,
@@ -703,10 +703,10 @@ def autoescape(template_name: t.Optional[str]) -> bool:
def htmlsafe_json_dumps(
obj: t.Any, dumps: t.Optional[t.Callable[..., str]] = None, **kwargs: t.Any
) -> markupsafe.Markup:
) -> _vendoring.markupsafe.Markup:
"""Serialize an object to a string of JSON with :func:`json.dumps`,
then replace HTML-unsafe characters with Unicode escapes and mark
the result safe with :class:`~markupsafe.Markup`.
the result safe with :class:`~_vendoring.markupsafe.Markup`.
This is available in templates as the ``|tojson`` filter.
@@ -732,7 +732,7 @@ def htmlsafe_json_dumps(
if dumps is None:
dumps = json.dumps
return markupsafe.Markup(
return _vendoring.markupsafe.Markup(
dumps(obj, **kwargs)
.replace("<", "\\u003c")
.replace(">", "\\u003e")
@@ -833,11 +833,11 @@ def __repr__(self) -> str:
return f"<Namespace {self.__attrs!r}>"
class Markup(markupsafe.Markup):
class Markup(_vendoring.markupsafe.Markup):
def __new__(cls, base="", encoding=None, errors="strict"): # type: ignore
warnings.warn(
"'jinja2.Markup' is deprecated and will be removed in Jinja"
" 3.1. Import 'markupsafe.Markup' instead.",
"'_vendoring.jinja2.Markup' is deprecated and will be removed in Jinja"
" 3.1. Import '_vendoring.markupsafe.Markup' instead.",
DeprecationWarning,
stacklevel=2,
)
@@ -846,9 +846,9 @@ def __new__(cls, base="", encoding=None, errors="strict"): # type: ignore
def escape(s: t.Any) -> str:
warnings.warn(
"'jinja2.escape' is deprecated and will be removed in Jinja"
" 3.1. Import 'markupsafe.escape' instead.",
"'_vendoring.jinja2.escape' is deprecated and will be removed in Jinja"
" 3.1. Import '_vendoring.markupsafe.escape' instead.",
DeprecationWarning,
stacklevel=2,
)
return markupsafe.escape(s)
return _vendoring.markupsafe.escape(s)

View File

@@ -6,7 +6,7 @@
from .nodes import Node
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
class VisitCallable(te.Protocol):
def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:

View File

@@ -8,18 +8,18 @@
instance under a schema, and will create a validator for you.
"""
from jsonschema.exceptions import (
from _vendoring.jsonschema.exceptions import (
ErrorTree, FormatError, RefResolutionError, SchemaError, ValidationError
)
from jsonschema._format import (
from _vendoring.jsonschema._format import (
FormatChecker,
draft3_format_checker,
draft4_format_checker,
draft6_format_checker,
draft7_format_checker,
)
from jsonschema._types import TypeChecker
from jsonschema.validators import (
from _vendoring.jsonschema._types import TypeChecker
from _vendoring.jsonschema.validators import (
Draft3Validator,
Draft4Validator,
Draft6Validator,

View File

@@ -1,2 +1,2 @@
from jsonschema.cli import main
from _vendoring.jsonschema.cli import main
main()

View File

@@ -3,8 +3,8 @@
import socket
import struct
from jsonschema.compat import str_types
from jsonschema.exceptions import FormatError
from _vendoring.jsonschema.compat import str_types
from _vendoring.jsonschema.exceptions import FormatError
class FormatChecker(object):

View File

@@ -1,6 +1,6 @@
from jsonschema import _utils
from jsonschema.compat import iteritems
from jsonschema.exceptions import ValidationError
from _vendoring.jsonschema import _utils
from _vendoring.jsonschema.compat import iteritems
from _vendoring.jsonschema.exceptions import ValidationError
def dependencies_draft3(validator, dependencies, instance, schema):

View File

@@ -9,7 +9,7 @@
import sys
from jsonschema.compat import PY3
from _vendoring.jsonschema.compat import PY3
class _NoModuleFound(Exception):

View File

@@ -1,10 +1,10 @@
import numbers
from pyrsistent import pmap
import attr
from _vendoring.pyrsistent import pmap
import _vendoring.attr
from jsonschema.compat import int_types, str_types
from jsonschema.exceptions import UndefinedTypeCheck
from _vendoring.jsonschema.compat import int_types, str_types
from _vendoring.jsonschema.exceptions import UndefinedTypeCheck
def is_array(checker, instance):
@@ -45,7 +45,7 @@ def is_any(checker, instance):
return True
@attr.s(frozen=True)
@_vendoring.attr.s(frozen=True)
class TypeChecker(object):
"""
A ``type`` property checker.
@@ -61,7 +61,7 @@ class TypeChecker(object):
The initial mapping of types to their checking functions.
"""
_type_checkers = attr.ib(default=pmap(), converter=pmap)
_type_checkers = _vendoring.attr.ib(default=pmap(), converter=pmap)
def is_type(self, instance, type):
"""
@@ -131,7 +131,7 @@ def redefine_many(self, definitions=()):
A new `TypeChecker` instance.
"""
return attr.evolve(
return _vendoring.attr.evolve(
self, type_checkers=self._type_checkers.update(definitions),
)
@@ -162,7 +162,7 @@ def remove(self, *types):
checkers = checkers.remove(each)
except KeyError:
raise UndefinedTypeCheck(each)
return attr.evolve(self, type_checkers=checkers)
return _vendoring.attr.evolve(self, type_checkers=checkers)
draft3_type_checker = TypeChecker(

View File

@@ -3,7 +3,7 @@
import pkgutil
import re
from jsonschema.compat import MutableMapping, str_types, urlsplit
from _vendoring.jsonschema.compat import MutableMapping, str_types, urlsplit
class URIDict(MutableMapping):
@@ -51,7 +51,7 @@ def load_schema(name):
Load a schema from ./schemas/``name``.json and return it.
"""
data = pkgutil.get_data("jsonschema", "schemas/{0}.json".format(name))
data = pkgutil.get_data("_vendoring.jsonschema", "schemas/{0}.json".format(name))
return json.loads(data.decode("utf-8"))

View File

@@ -1,6 +1,6 @@
import re
from jsonschema._utils import (
from _vendoring.jsonschema._utils import (
ensure_list,
equal,
extras_msg,
@@ -9,8 +9,8 @@
unbool,
uniq,
)
from jsonschema.exceptions import FormatError, ValidationError
from jsonschema.compat import iteritems
from _vendoring.jsonschema.exceptions import FormatError, ValidationError
from _vendoring.jsonschema.compat import iteritems
def patternProperties(validator, patternProperties, instance, schema):

View File

@@ -6,10 +6,10 @@
"""
from twisted.python.filepath import FilePath
from pyperf import Runner
from pyrsistent import m
from _vendoring.pyrsistent import m
from jsonschema.tests._suite import Version
import jsonschema
from _vendoring.jsonschema.tests._suite import Version
import _vendoring.jsonschema
issue232 = Version(

View File

@@ -7,7 +7,7 @@
"""
from pyperf import Runner
from jsonschema.tests._suite import Suite
from _vendoring.jsonschema.tests._suite import Suite
if __name__ == "__main__":

View File

@@ -6,9 +6,9 @@
import json
import sys
from jsonschema import __version__
from jsonschema._reflect import namedAny
from jsonschema.validators import validator_for
from _vendoring.jsonschema import __version__
from _vendoring.jsonschema._reflect import namedAny
from _vendoring.jsonschema.validators import validator_for
def _namedAnyWithDefault(name):

View File

@@ -6,10 +6,10 @@
import pprint
import textwrap
import attr
import _vendoring.attr
from jsonschema import _utils
from jsonschema.compat import PY3, iteritems
from _vendoring.jsonschema import _utils
from _vendoring.jsonschema.compat import PY3, iteritems
WEAK_MATCHES = frozenset(["anyOf", "oneOf"])
@@ -149,13 +149,13 @@ class SchemaError(_Error):
_word_for_instance_in_error_message = "schema"
@attr.s(hash=True)
@_vendoring.attr.s(hash=True)
class RefResolutionError(Exception):
"""
A ref could not be resolved.
"""
_cause = attr.ib()
_cause = _vendoring.attr.ib()
def __str__(self):
return str(self._cause)

View File

@@ -1,5 +0,0 @@
def bug(issue=None):
message = "A known bug."
if issue is not None:
message += " See issue #{issue}.".format(issue=issue)
return message

View File

@@ -1,239 +0,0 @@
"""
Python representations of the JSON Schema Test Suite tests.
"""
from functools import partial
import json
import os
import re
import subprocess
import sys
import unittest
from twisted.python.filepath import FilePath
import attr
from jsonschema.compat import PY3
from jsonschema.validators import validators
import jsonschema
def _find_suite():
root = os.environ.get("JSON_SCHEMA_TEST_SUITE")
if root is not None:
return FilePath(root)
root = FilePath(jsonschema.__file__).parent().sibling("json")
if not root.isdir(): # pragma: no cover
raise ValueError(
(
"Can't find the JSON-Schema-Test-Suite directory. "
"Set the 'JSON_SCHEMA_TEST_SUITE' environment "
"variable or run the tests from alongside a checkout "
"of the suite."
),
)
return root
@attr.s(hash=True)
class Suite(object):
_root = attr.ib(default=attr.Factory(_find_suite))
def _remotes(self):
jsonschema_suite = self._root.descendant(["bin", "jsonschema_suite"])
remotes = subprocess.check_output(
[sys.executable, jsonschema_suite.path, "remotes"],
)
return {
"http://localhost:1234/" + name: schema
for name, schema in json.loads(remotes.decode("utf-8")).items()
}
def benchmark(self, runner): # pragma: no cover
for name in validators:
self.version(name=name).benchmark(runner=runner)
def version(self, name):
return Version(
name=name,
path=self._root.descendant(["tests", name]),
remotes=self._remotes(),
)
@attr.s(hash=True)
class Version(object):
_path = attr.ib()
_remotes = attr.ib()
name = attr.ib()
def benchmark(self, runner, **kwargs): # pragma: no cover
for suite in self.tests():
for test in suite:
runner.bench_func(
test.fully_qualified_name,
partial(test.validate_ignoring_errors, **kwargs),
)
def tests(self):
return (
test
for child in self._path.globChildren("*.json")
for test in self._tests_in(
subject=child.basename()[:-5],
path=child,
)
)
def format_tests(self):
path = self._path.descendant(["optional", "format"])
return (
test
for child in path.globChildren("*.json")
for test in self._tests_in(
subject=child.basename()[:-5],
path=child,
)
)
def tests_of(self, name):
return self._tests_in(
subject=name,
path=self._path.child(name + ".json"),
)
def optional_tests_of(self, name):
return self._tests_in(
subject=name,
path=self._path.descendant(["optional", name + ".json"]),
)
def to_unittest_testcase(self, *suites, **kwargs):
name = kwargs.pop("name", "Test" + self.name.title())
methods = {
test.method_name: test.to_unittest_method(**kwargs)
for suite in suites
for tests in suite
for test in tests
}
cls = type(name, (unittest.TestCase,), methods)
try:
cls.__module__ = _someone_save_us_the_module_of_the_caller()
except Exception: # pragma: no cover
# We're doing crazy things, so if they go wrong, like a function
# behaving differently on some other interpreter, just make them
# not happen.
pass
return cls
def _tests_in(self, subject, path):
for each in json.loads(path.getContent().decode("utf-8")):
yield (
_Test(
version=self,
subject=subject,
case_description=each["description"],
schema=each["schema"],
remotes=self._remotes,
**test
) for test in each["tests"]
)
@attr.s(hash=True, repr=False)
class _Test(object):
version = attr.ib()
subject = attr.ib()
case_description = attr.ib()
description = attr.ib()
data = attr.ib()
schema = attr.ib(repr=False)
valid = attr.ib()
_remotes = attr.ib()
def __repr__(self): # pragma: no cover
return "<Test {}>".format(self.fully_qualified_name)
@property
def fully_qualified_name(self): # pragma: no cover
return " > ".join(
[
self.version.name,
self.subject,
self.case_description,
self.description,
]
)
@property
def method_name(self):
delimiters = r"[\W\- ]+"
name = "test_%s_%s_%s" % (
re.sub(delimiters, "_", self.subject),
re.sub(delimiters, "_", self.case_description),
re.sub(delimiters, "_", self.description),
)
if not PY3: # pragma: no cover
name = name.encode("utf-8")
return name
def to_unittest_method(self, skip=lambda test: None, **kwargs):
if self.valid:
def fn(this):
self.validate(**kwargs)
else:
def fn(this):
with this.assertRaises(jsonschema.ValidationError):
self.validate(**kwargs)
fn.__name__ = self.method_name
reason = skip(self)
return unittest.skipIf(reason is not None, reason)(fn)
def validate(self, Validator, **kwargs):
resolver = jsonschema.RefResolver.from_schema(
schema=self.schema,
store=self._remotes,
id_of=Validator.ID_OF,
)
jsonschema.validate(
instance=self.data,
schema=self.schema,
cls=Validator,
resolver=resolver,
**kwargs
)
def validate_ignoring_errors(self, Validator): # pragma: no cover
try:
self.validate(Validator=Validator)
except jsonschema.ValidationError:
pass
def _someone_save_us_the_module_of_the_caller():
"""
The FQON of the module 2nd stack frames up from here.
This is intended to allow us to dynamicallly return test case classes that
are indistinguishable from being defined in the module that wants them.
Otherwise, trial will mis-print the FQON, and copy pasting it won't re-run
the class that really is running.
Save us all, this is all so so so so so terrible.
"""
return sys._getframe(2).f_globals["__name__"]

View File

@@ -1,151 +0,0 @@
from unittest import TestCase
import json
import subprocess
import sys
from jsonschema import Draft4Validator, ValidationError, cli, __version__
from jsonschema.compat import NativeIO
from jsonschema.exceptions import SchemaError
def fake_validator(*errors):
errors = list(reversed(errors))
class FakeValidator(object):
def __init__(self, *args, **kwargs):
pass
def iter_errors(self, instance):
if errors:
return errors.pop()
return []
def check_schema(self, schema):
pass
return FakeValidator
class TestParser(TestCase):
FakeValidator = fake_validator()
instance_file = "foo.json"
schema_file = "schema.json"
def setUp(self):
cli.open = self.fake_open
self.addCleanup(delattr, cli, "open")
def fake_open(self, path):
if path == self.instance_file:
contents = ""
elif path == self.schema_file:
contents = {}
else: # pragma: no cover
self.fail("What is {!r}".format(path))
return NativeIO(json.dumps(contents))
def test_find_validator_by_fully_qualified_object_name(self):
arguments = cli.parse_args(
[
"--validator",
"jsonschema.tests.test_cli.TestParser.FakeValidator",
"--instance", self.instance_file,
self.schema_file,
]
)
self.assertIs(arguments["validator"], self.FakeValidator)
def test_find_validator_in_jsonschema(self):
arguments = cli.parse_args(
[
"--validator", "Draft4Validator",
"--instance", self.instance_file,
self.schema_file,
]
)
self.assertIs(arguments["validator"], Draft4Validator)
class TestCLI(TestCase):
def test_draft3_schema_draft4_validator(self):
stdout, stderr = NativeIO(), NativeIO()
with self.assertRaises(SchemaError):
cli.run(
{
"validator": Draft4Validator,
"schema": {
"anyOf": [
{"minimum": 20},
{"type": "string"},
{"required": True},
],
},
"instances": [1],
"error_format": "{error.message}",
},
stdout=stdout,
stderr=stderr,
)
def test_successful_validation(self):
stdout, stderr = NativeIO(), NativeIO()
exit_code = cli.run(
{
"validator": fake_validator(),
"schema": {},
"instances": [1],
"error_format": "{error.message}",
},
stdout=stdout,
stderr=stderr,
)
self.assertFalse(stdout.getvalue())
self.assertFalse(stderr.getvalue())
self.assertEqual(exit_code, 0)
def test_unsuccessful_validation(self):
error = ValidationError("I am an error!", instance=1)
stdout, stderr = NativeIO(), NativeIO()
exit_code = cli.run(
{
"validator": fake_validator([error]),
"schema": {},
"instances": [1],
"error_format": "{error.instance} - {error.message}",
},
stdout=stdout,
stderr=stderr,
)
self.assertFalse(stdout.getvalue())
self.assertEqual(stderr.getvalue(), "1 - I am an error!")
self.assertEqual(exit_code, 1)
def test_unsuccessful_validation_multiple_instances(self):
first_errors = [
ValidationError("9", instance=1),
ValidationError("8", instance=1),
]
second_errors = [ValidationError("7", instance=2)]
stdout, stderr = NativeIO(), NativeIO()
exit_code = cli.run(
{
"validator": fake_validator(first_errors, second_errors),
"schema": {},
"instances": [1, 2],
"error_format": "{error.instance} - {error.message}\t",
},
stdout=stdout,
stderr=stderr,
)
self.assertFalse(stdout.getvalue())
self.assertEqual(stderr.getvalue(), "1 - 9\t1 - 8\t2 - 7\t")
self.assertEqual(exit_code, 1)
def test_version(self):
version = subprocess.check_output(
[sys.executable, "-m", "jsonschema", "--version"],
stderr=subprocess.STDOUT,
)
version = version.decode("utf-8").strip()
self.assertEqual(version, __version__)

View File

@@ -1,462 +0,0 @@
from unittest import TestCase
import textwrap
from jsonschema import Draft4Validator, exceptions
from jsonschema.compat import PY3
class TestBestMatch(TestCase):
def best_match(self, errors):
errors = list(errors)
best = exceptions.best_match(errors)
reversed_best = exceptions.best_match(reversed(errors))
msg = "Didn't return a consistent best match!\nGot: {0}\n\nThen: {1}"
self.assertEqual(
best._contents(), reversed_best._contents(),
msg=msg.format(best, reversed_best),
)
return best
def test_shallower_errors_are_better_matches(self):
validator = Draft4Validator(
{
"properties": {
"foo": {
"minProperties": 2,
"properties": {"bar": {"type": "object"}},
},
},
},
)
best = self.best_match(validator.iter_errors({"foo": {"bar": []}}))
self.assertEqual(best.validator, "minProperties")
def test_oneOf_and_anyOf_are_weak_matches(self):
"""
A property you *must* match is probably better than one you have to
match a part of.
"""
validator = Draft4Validator(
{
"minProperties": 2,
"anyOf": [{"type": "string"}, {"type": "number"}],
"oneOf": [{"type": "string"}, {"type": "number"}],
}
)
best = self.best_match(validator.iter_errors({}))
self.assertEqual(best.validator, "minProperties")
def test_if_the_most_relevant_error_is_anyOf_it_is_traversed(self):
"""
If the most relevant error is an anyOf, then we traverse its context
and select the otherwise *least* relevant error, since in this case
that means the most specific, deep, error inside the instance.
I.e. since only one of the schemas must match, we look for the most
relevant one.
"""
validator = Draft4Validator(
{
"properties": {
"foo": {
"anyOf": [
{"type": "string"},
{"properties": {"bar": {"type": "array"}}},
],
},
},
},
)
best = self.best_match(validator.iter_errors({"foo": {"bar": 12}}))
self.assertEqual(best.validator_value, "array")
def test_if_the_most_relevant_error_is_oneOf_it_is_traversed(self):
"""
If the most relevant error is an oneOf, then we traverse its context
and select the otherwise *least* relevant error, since in this case
that means the most specific, deep, error inside the instance.
I.e. since only one of the schemas must match, we look for the most
relevant one.
"""
validator = Draft4Validator(
{
"properties": {
"foo": {
"oneOf": [
{"type": "string"},
{"properties": {"bar": {"type": "array"}}},
],
},
},
},
)
best = self.best_match(validator.iter_errors({"foo": {"bar": 12}}))
self.assertEqual(best.validator_value, "array")
def test_if_the_most_relevant_error_is_allOf_it_is_traversed(self):
"""
Now, if the error is allOf, we traverse but select the *most* relevant
error from the context, because all schemas here must match anyways.
"""
validator = Draft4Validator(
{
"properties": {
"foo": {
"allOf": [
{"type": "string"},
{"properties": {"bar": {"type": "array"}}},
],
},
},
},
)
best = self.best_match(validator.iter_errors({"foo": {"bar": 12}}))
self.assertEqual(best.validator_value, "string")
def test_nested_context_for_oneOf(self):
validator = Draft4Validator(
{
"properties": {
"foo": {
"oneOf": [
{"type": "string"},
{
"oneOf": [
{"type": "string"},
{
"properties": {
"bar": {"type": "array"},
},
},
],
},
],
},
},
},
)
best = self.best_match(validator.iter_errors({"foo": {"bar": 12}}))
self.assertEqual(best.validator_value, "array")
def test_one_error(self):
validator = Draft4Validator({"minProperties": 2})
error, = validator.iter_errors({})
self.assertEqual(
exceptions.best_match(validator.iter_errors({})).validator,
"minProperties",
)
def test_no_errors(self):
validator = Draft4Validator({})
self.assertIsNone(exceptions.best_match(validator.iter_errors({})))
class TestByRelevance(TestCase):
def test_short_paths_are_better_matches(self):
shallow = exceptions.ValidationError("Oh no!", path=["baz"])
deep = exceptions.ValidationError("Oh yes!", path=["foo", "bar"])
match = max([shallow, deep], key=exceptions.relevance)
self.assertIs(match, shallow)
match = max([deep, shallow], key=exceptions.relevance)
self.assertIs(match, shallow)
def test_global_errors_are_even_better_matches(self):
shallow = exceptions.ValidationError("Oh no!", path=[])
deep = exceptions.ValidationError("Oh yes!", path=["foo"])
errors = sorted([shallow, deep], key=exceptions.relevance)
self.assertEqual(
[list(error.path) for error in errors],
[["foo"], []],
)
errors = sorted([deep, shallow], key=exceptions.relevance)
self.assertEqual(
[list(error.path) for error in errors],
[["foo"], []],
)
def test_weak_validators_are_lower_priority(self):
weak = exceptions.ValidationError("Oh no!", path=[], validator="a")
normal = exceptions.ValidationError("Oh yes!", path=[], validator="b")
best_match = exceptions.by_relevance(weak="a")
match = max([weak, normal], key=best_match)
self.assertIs(match, normal)
match = max([normal, weak], key=best_match)
self.assertIs(match, normal)
def test_strong_validators_are_higher_priority(self):
weak = exceptions.ValidationError("Oh no!", path=[], validator="a")
normal = exceptions.ValidationError("Oh yes!", path=[], validator="b")
strong = exceptions.ValidationError("Oh fine!", path=[], validator="c")
best_match = exceptions.by_relevance(weak="a", strong="c")
match = max([weak, normal, strong], key=best_match)
self.assertIs(match, strong)
match = max([strong, normal, weak], key=best_match)
self.assertIs(match, strong)
class TestErrorTree(TestCase):
def test_it_knows_how_many_total_errors_it_contains(self):
# FIXME: https://github.com/Julian/jsonschema/issues/442
errors = [
exceptions.ValidationError("Something", validator=i)
for i in range(8)
]
tree = exceptions.ErrorTree(errors)
self.assertEqual(tree.total_errors, 8)
def test_it_contains_an_item_if_the_item_had_an_error(self):
errors = [exceptions.ValidationError("a message", path=["bar"])]
tree = exceptions.ErrorTree(errors)
self.assertIn("bar", tree)
def test_it_does_not_contain_an_item_if_the_item_had_no_error(self):
errors = [exceptions.ValidationError("a message", path=["bar"])]
tree = exceptions.ErrorTree(errors)
self.assertNotIn("foo", tree)
def test_validators_that_failed_appear_in_errors_dict(self):
error = exceptions.ValidationError("a message", validator="foo")
tree = exceptions.ErrorTree([error])
self.assertEqual(tree.errors, {"foo": error})
def test_it_creates_a_child_tree_for_each_nested_path(self):
errors = [
exceptions.ValidationError("a bar message", path=["bar"]),
exceptions.ValidationError("a bar -> 0 message", path=["bar", 0]),
]
tree = exceptions.ErrorTree(errors)
self.assertIn(0, tree["bar"])
self.assertNotIn(1, tree["bar"])
def test_children_have_their_errors_dicts_built(self):
e1, e2 = (
exceptions.ValidationError("1", validator="foo", path=["bar", 0]),
exceptions.ValidationError("2", validator="quux", path=["bar", 0]),
)
tree = exceptions.ErrorTree([e1, e2])
self.assertEqual(tree["bar"][0].errors, {"foo": e1, "quux": e2})
def test_multiple_errors_with_instance(self):
e1, e2 = (
exceptions.ValidationError(
"1",
validator="foo",
path=["bar", "bar2"],
instance="i1"),
exceptions.ValidationError(
"2",
validator="quux",
path=["foobar", 2],
instance="i2"),
)
exceptions.ErrorTree([e1, e2])
def test_it_does_not_contain_subtrees_that_are_not_in_the_instance(self):
error = exceptions.ValidationError("123", validator="foo", instance=[])
tree = exceptions.ErrorTree([error])
with self.assertRaises(IndexError):
tree[0]
def test_if_its_in_the_tree_anyhow_it_does_not_raise_an_error(self):
"""
If a validator is dumb (like :validator:`required` in draft 3) and
refers to a path that isn't in the instance, the tree still properly
returns a subtree for that path.
"""
error = exceptions.ValidationError(
"a message", validator="foo", instance={}, path=["foo"],
)
tree = exceptions.ErrorTree([error])
self.assertIsInstance(tree["foo"], exceptions.ErrorTree)
class TestErrorInitReprStr(TestCase):
def make_error(self, **kwargs):
defaults = dict(
message=u"hello",
validator=u"type",
validator_value=u"string",
instance=5,
schema={u"type": u"string"},
)
defaults.update(kwargs)
return exceptions.ValidationError(**defaults)
def assertShows(self, expected, **kwargs):
if PY3: # pragma: no cover
expected = expected.replace("u'", "'")
expected = textwrap.dedent(expected).rstrip("\n")
error = self.make_error(**kwargs)
message_line, _, rest = str(error).partition("\n")
self.assertEqual(message_line, error.message)
self.assertEqual(rest, expected)
def test_it_calls_super_and_sets_args(self):
error = self.make_error()
self.assertGreater(len(error.args), 1)
def test_repr(self):
self.assertEqual(
repr(exceptions.ValidationError(message="Hello!")),
"<ValidationError: %r>" % "Hello!",
)
def test_unset_error(self):
error = exceptions.ValidationError("message")
self.assertEqual(str(error), "message")
kwargs = {
"validator": "type",
"validator_value": "string",
"instance": 5,
"schema": {"type": "string"},
}
# Just the message should show if any of the attributes are unset
for attr in kwargs:
k = dict(kwargs)
del k[attr]
error = exceptions.ValidationError("message", **k)
self.assertEqual(str(error), "message")
def test_empty_paths(self):
self.assertShows(
"""
Failed validating u'type' in schema:
{u'type': u'string'}
On instance:
5
""",
path=[],
schema_path=[],
)
def test_one_item_paths(self):
self.assertShows(
"""
Failed validating u'type' in schema:
{u'type': u'string'}
On instance[0]:
5
""",
path=[0],
schema_path=["items"],
)
def test_multiple_item_paths(self):
self.assertShows(
"""
Failed validating u'type' in schema[u'items'][0]:
{u'type': u'string'}
On instance[0][u'a']:
5
""",
path=[0, u"a"],
schema_path=[u"items", 0, 1],
)
def test_uses_pprint(self):
self.assertShows(
"""
Failed validating u'maxLength' in schema:
{0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
10: 10,
11: 11,
12: 12,
13: 13,
14: 14,
15: 15,
16: 16,
17: 17,
18: 18,
19: 19}
On instance:
[0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24]
""",
instance=list(range(25)),
schema=dict(zip(range(20), range(20))),
validator=u"maxLength",
)
def test_str_works_with_instances_having_overriden_eq_operator(self):
"""
Check for https://github.com/Julian/jsonschema/issues/164 which
rendered exceptions unusable when a `ValidationError` involved
instances with an `__eq__` method that returned truthy values.
"""
class DontEQMeBro(object):
def __eq__(this, other): # pragma: no cover
self.fail("Don't!")
def __ne__(this, other): # pragma: no cover
self.fail("Don't!")
instance = DontEQMeBro()
error = exceptions.ValidationError(
"a message",
validator="foo",
instance=instance,
validator_value="some",
schema="schema",
)
self.assertIn(repr(instance), str(error))
class TestHashable(TestCase):
def test_hashable(self):
set([exceptions.ValidationError("")])
set([exceptions.SchemaError("")])

View File

@@ -1,89 +0,0 @@
"""
Tests for the parts of jsonschema related to the :validator:`format` property.
"""
from unittest import TestCase
from jsonschema import FormatError, ValidationError, FormatChecker
from jsonschema.validators import Draft4Validator
BOOM = ValueError("Boom!")
BANG = ZeroDivisionError("Bang!")
def boom(thing):
if thing == "bang":
raise BANG
raise BOOM
class TestFormatChecker(TestCase):
def test_it_can_validate_no_formats(self):
checker = FormatChecker(formats=())
self.assertFalse(checker.checkers)
def test_it_raises_a_key_error_for_unknown_formats(self):
with self.assertRaises(KeyError):
FormatChecker(formats=["o noes"])
def test_it_can_register_cls_checkers(self):
original = dict(FormatChecker.checkers)
self.addCleanup(FormatChecker.checkers.pop, "boom")
FormatChecker.cls_checks("boom")(boom)
self.assertEqual(
FormatChecker.checkers,
dict(original, boom=(boom, ())),
)
def test_it_can_register_checkers(self):
checker = FormatChecker()
checker.checks("boom")(boom)
self.assertEqual(
checker.checkers,
dict(FormatChecker.checkers, boom=(boom, ()))
)
def test_it_catches_registered_errors(self):
checker = FormatChecker()
checker.checks("boom", raises=type(BOOM))(boom)
with self.assertRaises(FormatError) as cm:
checker.check(instance=12, format="boom")
self.assertIs(cm.exception.cause, BOOM)
self.assertIs(cm.exception.__cause__, BOOM)
# Unregistered errors should not be caught
with self.assertRaises(type(BANG)):
checker.check(instance="bang", format="boom")
def test_format_error_causes_become_validation_error_causes(self):
checker = FormatChecker()
checker.checks("boom", raises=ValueError)(boom)
validator = Draft4Validator({"format": "boom"}, format_checker=checker)
with self.assertRaises(ValidationError) as cm:
validator.validate("BOOM")
self.assertIs(cm.exception.cause, BOOM)
self.assertIs(cm.exception.__cause__, BOOM)
def test_format_checkers_come_with_defaults(self):
# This is bad :/ but relied upon.
# The docs for quite awhile recommended people do things like
# validate(..., format_checker=FormatChecker())
# We should change that, but we can't without deprecation...
checker = FormatChecker()
with self.assertRaises(FormatError):
checker.check(instance="not-an-ipv4", format="ipv4")
def test_repr(self):
checker = FormatChecker(formats=())
checker.checks("foo")(lambda thing: True)
checker.checks("bar")(lambda thing: True)
checker.checks("baz")(lambda thing: True)
self.assertEqual(
repr(checker),
"<FormatChecker checkers=['bar', 'baz', 'foo']>",
)

View File

@@ -1,277 +0,0 @@
"""
Test runner for the JSON Schema official test suite
Tests comprehensive correctness of each draft's validator.
See https://github.com/json-schema-org/JSON-Schema-Test-Suite for details.
"""
import sys
import warnings
from jsonschema import (
Draft3Validator,
Draft4Validator,
Draft6Validator,
Draft7Validator,
draft3_format_checker,
draft4_format_checker,
draft6_format_checker,
draft7_format_checker,
)
from jsonschema.tests._helpers import bug
from jsonschema.tests._suite import Suite
from jsonschema.validators import _DEPRECATED_DEFAULT_TYPES, create
SUITE = Suite()
DRAFT3 = SUITE.version(name="draft3")
DRAFT4 = SUITE.version(name="draft4")
DRAFT6 = SUITE.version(name="draft6")
DRAFT7 = SUITE.version(name="draft7")
def skip(message, **kwargs):
def skipper(test):
if all(value == getattr(test, attr) for attr, value in kwargs.items()):
return message
return skipper
def missing_format(checker):
def missing_format(test):
schema = test.schema
if schema is True or schema is False or "format" not in schema:
return
if schema["format"] not in checker.checkers:
return "Format checker {0!r} not found.".format(schema["format"])
return missing_format
is_narrow_build = sys.maxunicode == 2 ** 16 - 1
if is_narrow_build: # pragma: no cover
message = "Not running surrogate Unicode case, this Python is narrow."
def narrow_unicode_build(test): # pragma: no cover
return skip(
message=message,
description="one supplementary Unicode code point is not long enough",
)(test) or skip(
message=message,
description="two supplementary Unicode code points is long enough",
)(test)
else:
def narrow_unicode_build(test): # pragma: no cover
return
TestDraft3 = DRAFT3.to_unittest_testcase(
DRAFT3.tests(),
DRAFT3.optional_tests_of(name="bignum"),
DRAFT3.optional_tests_of(name="format"),
DRAFT3.optional_tests_of(name="zeroTerminatedFloats"),
Validator=Draft3Validator,
format_checker=draft3_format_checker,
skip=lambda test: (
narrow_unicode_build(test)
or missing_format(draft3_format_checker)(test)
or skip(
message="Upstream bug in strict_rfc3339",
subject="format",
description="case-insensitive T and Z",
)(test)
),
)
TestDraft4 = DRAFT4.to_unittest_testcase(
DRAFT4.tests(),
DRAFT4.optional_tests_of(name="bignum"),
DRAFT4.optional_tests_of(name="format"),
DRAFT4.optional_tests_of(name="zeroTerminatedFloats"),
Validator=Draft4Validator,
format_checker=draft4_format_checker,
skip=lambda test: (
narrow_unicode_build(test)
or missing_format(draft4_format_checker)(test)
or skip(
message=bug(),
subject="ref",
case_description="Recursive references between schemas",
)(test)
or skip(
message=bug(371),
subject="ref",
case_description="Location-independent identifier",
)(test)
or skip(
message=bug(371),
subject="ref",
case_description=(
"Location-independent identifier with absolute URI"
),
)(test)
or skip(
message=bug(371),
subject="ref",
case_description=(
"Location-independent identifier with base URI change in subschema"
),
)(test)
or skip(
message=bug(),
subject="refRemote",
case_description="base URI change - change folder in subschema",
)(test)
or skip(
message="Upstream bug in strict_rfc3339",
subject="format",
description="case-insensitive T and Z",
)(test)
),
)
TestDraft6 = DRAFT6.to_unittest_testcase(
DRAFT6.tests(),
DRAFT6.optional_tests_of(name="bignum"),
DRAFT6.optional_tests_of(name="format"),
DRAFT6.optional_tests_of(name="zeroTerminatedFloats"),
Validator=Draft6Validator,
format_checker=draft6_format_checker,
skip=lambda test: (
narrow_unicode_build(test)
or missing_format(draft6_format_checker)(test)
or skip(
message=bug(),
subject="ref",
case_description="Recursive references between schemas",
)(test)
or skip(
message=bug(371),
subject="ref",
case_description="Location-independent identifier",
)(test)
or skip(
message=bug(371),
subject="ref",
case_description=(
"Location-independent identifier with absolute URI"
),
)(test)
or skip(
message=bug(371),
subject="ref",
case_description=(
"Location-independent identifier with base URI change in subschema"
),
)(test)
or skip(
message=bug(),
subject="refRemote",
case_description="base URI change - change folder in subschema",
)(test)
or skip(
message="Upstream bug in strict_rfc3339",
subject="format",
description="case-insensitive T and Z",
)(test)
),
)
TestDraft7 = DRAFT7.to_unittest_testcase(
DRAFT7.tests(),
DRAFT7.format_tests(),
DRAFT7.optional_tests_of(name="bignum"),
DRAFT7.optional_tests_of(name="content"),
DRAFT7.optional_tests_of(name="zeroTerminatedFloats"),
Validator=Draft7Validator,
format_checker=draft7_format_checker,
skip=lambda test: (
narrow_unicode_build(test)
or missing_format(draft7_format_checker)(test)
or skip(
message=bug(),
subject="ref",
case_description="Recursive references between schemas",
)(test)
or skip(
message=bug(371),
subject="ref",
case_description="Location-independent identifier",
)(test)
or skip(
message=bug(371),
subject="ref",
case_description=(
"Location-independent identifier with absolute URI"
),
)(test)
or skip(
message=bug(371),
subject="ref",
case_description=(
"Location-independent identifier with base URI change in subschema"
),
)(test)
or skip(
message=bug(),
subject="refRemote",
case_description="base URI change - change folder in subschema",
)(test)
or skip(
message="Upstream bug in strict_rfc3339",
subject="date-time",
description="case-insensitive T and Z",
)(test)
or skip(
message=bug(593),
subject="content",
case_description=(
"validation of string-encoded content based on media type"
),
)(test)
or skip(
message=bug(593),
subject="content",
case_description="validation of binary string-encoding",
)(test)
or skip(
message=bug(593),
subject="content",
case_description=(
"validation of binary-encoded media type documents"
),
)(test)
),
)
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
TestDraft3LegacyTypeCheck = DRAFT3.to_unittest_testcase(
# Interestingly the any part couldn't really be done w/the old API.
(
(test for test in each if test.schema != {"type": "any"})
for each in DRAFT3.tests_of(name="type")
),
name="TestDraft3LegacyTypeCheck",
Validator=create(
meta_schema=Draft3Validator.META_SCHEMA,
validators=Draft3Validator.VALIDATORS,
default_types=_DEPRECATED_DEFAULT_TYPES,
),
)
TestDraft4LegacyTypeCheck = DRAFT4.to_unittest_testcase(
DRAFT4.tests_of(name="type"),
name="TestDraft4LegacyTypeCheck",
Validator=create(
meta_schema=Draft4Validator.META_SCHEMA,
validators=Draft4Validator.VALIDATORS,
default_types=_DEPRECATED_DEFAULT_TYPES,
),
)

View File

@@ -1,190 +0,0 @@
"""
Tests on the new type interface. The actual correctness of the type checking
is handled in test_jsonschema_test_suite; these tests check that TypeChecker
functions correctly and can facilitate extensions to type checking
"""
from collections import namedtuple
from unittest import TestCase
from jsonschema import ValidationError, _validators
from jsonschema._types import TypeChecker
from jsonschema.exceptions import UndefinedTypeCheck
from jsonschema.validators import Draft4Validator, extend
def equals_2(checker, instance):
return instance == 2
def is_namedtuple(instance):
return isinstance(instance, tuple) and getattr(instance, "_fields", None)
def is_object_or_named_tuple(checker, instance):
if Draft4Validator.TYPE_CHECKER.is_type(instance, "object"):
return True
return is_namedtuple(instance)
def coerce_named_tuple(fn):
def coerced(validator, value, instance, schema):
if is_namedtuple(instance):
instance = instance._asdict()
return fn(validator, value, instance, schema)
return coerced
required = coerce_named_tuple(_validators.required)
properties = coerce_named_tuple(_validators.properties)
class TestTypeChecker(TestCase):
def test_is_type(self):
checker = TypeChecker({"two": equals_2})
self.assertEqual(
(
checker.is_type(instance=2, type="two"),
checker.is_type(instance="bar", type="two"),
),
(True, False),
)
def test_is_unknown_type(self):
with self.assertRaises(UndefinedTypeCheck) as context:
TypeChecker().is_type(4, "foobar")
self.assertIn("foobar", str(context.exception))
def test_checks_can_be_added_at_init(self):
checker = TypeChecker({"two": equals_2})
self.assertEqual(checker, TypeChecker().redefine("two", equals_2))
def test_redefine_existing_type(self):
self.assertEqual(
TypeChecker().redefine("two", object()).redefine("two", equals_2),
TypeChecker().redefine("two", equals_2),
)
def test_remove(self):
self.assertEqual(
TypeChecker({"two": equals_2}).remove("two"),
TypeChecker(),
)
def test_remove_unknown_type(self):
with self.assertRaises(UndefinedTypeCheck) as context:
TypeChecker().remove("foobar")
self.assertIn("foobar", str(context.exception))
def test_redefine_many(self):
self.assertEqual(
TypeChecker().redefine_many({"foo": int, "bar": str}),
TypeChecker().redefine("foo", int).redefine("bar", str),
)
def test_remove_multiple(self):
self.assertEqual(
TypeChecker({"foo": int, "bar": str}).remove("foo", "bar"),
TypeChecker(),
)
def test_type_check_can_raise_key_error(self):
"""
Make sure no one writes:
try:
self._type_checkers[type](...)
except KeyError:
ignoring the fact that the function itself can raise that.
"""
error = KeyError("Stuff")
def raises_keyerror(checker, instance):
raise error
with self.assertRaises(KeyError) as context:
TypeChecker({"foo": raises_keyerror}).is_type(4, "foo")
self.assertIs(context.exception, error)
class TestCustomTypes(TestCase):
def test_simple_type_can_be_extended(self):
def int_or_str_int(checker, instance):
if not isinstance(instance, (int, str)):
return False
try:
int(instance)
except ValueError:
return False
return True
CustomValidator = extend(
Draft4Validator,
type_checker=Draft4Validator.TYPE_CHECKER.redefine(
"integer", int_or_str_int,
),
)
validator = CustomValidator({"type": "integer"})
validator.validate(4)
validator.validate("4")
with self.assertRaises(ValidationError):
validator.validate(4.4)
def test_object_can_be_extended(self):
schema = {"type": "object"}
Point = namedtuple("Point", ["x", "y"])
type_checker = Draft4Validator.TYPE_CHECKER.redefine(
u"object", is_object_or_named_tuple,
)
CustomValidator = extend(Draft4Validator, type_checker=type_checker)
validator = CustomValidator(schema)
validator.validate(Point(x=4, y=5))
def test_object_extensions_require_custom_validators(self):
schema = {"type": "object", "required": ["x"]}
type_checker = Draft4Validator.TYPE_CHECKER.redefine(
u"object", is_object_or_named_tuple,
)
CustomValidator = extend(Draft4Validator, type_checker=type_checker)
validator = CustomValidator(schema)
Point = namedtuple("Point", ["x", "y"])
# Cannot handle required
with self.assertRaises(ValidationError):
validator.validate(Point(x=4, y=5))
def test_object_extensions_can_handle_custom_validators(self):
schema = {
"type": "object",
"required": ["x"],
"properties": {"x": {"type": "integer"}},
}
type_checker = Draft4Validator.TYPE_CHECKER.redefine(
u"object", is_object_or_named_tuple,
)
CustomValidator = extend(
Draft4Validator,
type_checker=type_checker,
validators={"required": required, "properties": properties},
)
validator = CustomValidator(schema)
Point = namedtuple("Point", ["x", "y"])
# Can now process required and properties
validator.validate(Point(x=4, y=5))
with self.assertRaises(ValidationError):
validator.validate(Point(x="not an integer", y=5))

File diff suppressed because it is too large Load Diff

View File

@@ -8,16 +8,16 @@
import json
import numbers
from six import add_metaclass
from _vendoring.six import add_metaclass
from jsonschema import (
from _vendoring.jsonschema import (
_legacy_validators,
_types,
_utils,
_validators,
exceptions,
)
from jsonschema.compat import (
from _vendoring.jsonschema.compat import (
Sequence,
int_types,
iteritems,
@@ -33,7 +33,7 @@
# Sigh. https://gitlab.com/pycqa/flake8/issues/280
# https://github.com/pyga/ebb-lint/issues/7
# Imported for backwards compatibility.
from jsonschema.exceptions import ErrorTree
from _vendoring.jsonschema.exceptions import ErrorTree
ErrorTree

View File

@@ -7,7 +7,7 @@
import struct
import sys
from macholib.util import fileview
from _vendoring.macholib.util import fileview
from .mach_o import (
FAT_MAGIC,
@@ -41,7 +41,7 @@
from .ptypes import sizeof
try:
from macholib.compat import bytes
from _vendoring.macholib.compat import bytes
except ImportError:
pass

View File

@@ -5,11 +5,11 @@
import os
import sys
from altgraph.ObjectGraph import ObjectGraph
from _vendoring.altgraph.ObjectGraph import ObjectGraph
from macholib.dyld import dyld_find
from macholib.itergraphreport import itergraphreport
from macholib.MachO import MachO
from _vendoring.macholib.dyld import dyld_find
from _vendoring.macholib.itergraphreport import itergraphreport
from _vendoring.macholib.MachO import MachO
__all__ = ["MachOGraph"]

View File

@@ -1,9 +1,9 @@
import os
from collections import deque
from macholib.dyld import framework_info
from macholib.MachOGraph import MachOGraph, MissingMachO
from macholib.util import (
from _vendoring.macholib.dyld import framework_info
from _vendoring.macholib.MachOGraph import MachOGraph, MissingMachO
from _vendoring.macholib.util import (
flipwritable,
has_filename_filter,
in_system_path,

View File

@@ -5,7 +5,7 @@
import sys
from macholib.mach_o import (
from _vendoring.macholib.mach_o import (
MH_CIGAM_64,
MH_MAGIC_64,
dylib_module,

View File

@@ -3,8 +3,8 @@
import os
import sys
from macholib import macho_dump, macho_standalone
from macholib.util import is_platform_file
from _vendoring.macholib import macho_dump, macho_standalone
from _vendoring.macholib.util import is_platform_file
gCommand = None
@@ -43,10 +43,10 @@ def walk_tree(callback, paths):
def print_usage(fp):
print("Usage:", file=fp)
print(" python -mmacholib [help|--help]", file=fp)
print(" python -mmacholib dump FILE ...", file=fp)
print(" python -mmacholib find DIR ...", file=fp)
print(" python -mmacholib standalone DIR ...", file=fp)
print(" python -m_vendoring.macholib [help|--help]", file=fp)
print(" python -m_vendoring.macholib dump FILE ...", file=fp)
print(" python -m_vendoring.macholib find DIR ...", file=fp)
print(" python -m_vendoring.macholib standalone DIR ...", file=fp)
def main():

View File

@@ -6,7 +6,7 @@
import os
import sys
from macholib.util import is_platform_file
from _vendoring.macholib.util import is_platform_file
def check_file(fp, path, callback):

View File

@@ -8,8 +8,8 @@
import sys
from itertools import chain
from macholib.dylib import dylib_info
from macholib.framework import framework_info
from _vendoring.macholib.dylib import dylib_info
from _vendoring.macholib.framework import framework_info
__all__ = ["dyld_find", "framework_find", "framework_info", "dylib_info"]

View File

@@ -13,7 +13,7 @@
import time
from macholib.ptypes import (
from _vendoring.macholib.ptypes import (
Structure,
p_int32,
p_int64,

View File

@@ -4,9 +4,9 @@
import sys
from macholib._cmdline import main as _main
from macholib.mach_o import CPU_TYPE_NAMES, MH_CIGAM_64, MH_MAGIC_64, get_cpu_subtype
from macholib.MachO import MachO
from _vendoring.macholib._cmdline import main as _main
from _vendoring.macholib.mach_o import CPU_TYPE_NAMES, MH_CIGAM_64, MH_MAGIC_64, get_cpu_subtype
from _vendoring.macholib.MachO import MachO
ARCH_MAP = {
("<", "64-bit"): "x86_64",
@@ -45,7 +45,7 @@ def print_file(fp, path):
def main():
print(
"WARNING: 'macho_dump' is deprecated, use 'python -mmacholib dump' " "instead"
"WARNING: 'macho_dump' is deprecated, use 'python -m_vendoring.macholib dump' " "instead"
)
_main(print_file)

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python
from __future__ import print_function
from macholib._cmdline import main as _main
from _vendoring.macholib._cmdline import main as _main
def print_file(fp, path):
@@ -10,7 +10,7 @@ def print_file(fp, path):
def main():
print(
"WARNING: 'macho_find' is deprecated, " "use 'python -mmacholib dump' instead"
"WARNING: 'macho_find' is deprecated, " "use 'python -m_vendoring.macholib dump' instead"
)
_main(print_file)

View File

@@ -3,8 +3,8 @@
import os
import sys
from macholib.MachOStandalone import MachOStandalone
from macholib.util import strip_files
from _vendoring.macholib.MachOStandalone import MachOStandalone
from _vendoring.macholib.util import strip_files
def standaloneApp(path):
@@ -18,7 +18,7 @@ def standaloneApp(path):
def main():
print(
"WARNING: 'macho_standalone' is deprecated, use "
"'python -mmacholib standalone' instead"
"'python -m_vendoring.macholib standalone' instead"
)
if not sys.argv[1:]:
raise SystemExit("usage: %s [appbundle ...]" % (sys.argv[0],))

View File

@@ -4,7 +4,7 @@
import struct
import sys
from macholib import mach_o
from _vendoring.macholib import mach_o
MAGIC = [
struct.pack("!L", getattr(mach_o, "MH_" + _))

View File

@@ -4,7 +4,7 @@
import typing as t
if t.TYPE_CHECKING:
import typing_extensions as te
import _vendoring.typing_extensions as te
class HasHTML(te.Protocol):
def __html__(self) -> str:

Some files were not shown because too many files have changed in this diff Show More