From 3540f8200a536434946492d60b5e56b302112305 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 14 Jan 2022 12:37:57 -0600 Subject: PythonPackage: install packages with pip (#27798) * Use pip to bootstrap pip * Bootstrap wheel from source * Update PythonPackage to install using pip * Update several packages * Add wheel as base class dep * Build phase no longer exists * Add py-poetry package, fix py-flit-core bootstrapping * Fix isort build * Clean up many more packages * Remove unused import * Fix unit tests * Don't directly run setup.py * Typo fix * Remove unused imports * Fix issues caught by CI * Remove custom setup.py file handling * Use PythonPackage for installing wheels * Remove custom phases in PythonPackages * Remove _args methods * Remove unused import * Fix various packages * Try to test Python packages directly in CI * Actually run the pipeline * Fix more packages * Fix mappings, fix packages * Fix dep version * Work around bug in concretizer * Various concretization fixes * Fix gitlab yaml, packages * Fix typo in gitlab yaml * Skip more packages that fail to concretize * Fix? jupyter ecosystem concretization issues * Solve Jupyter concretization issues * Prevent duplicate entries in PYTHONPATH * Skip fenics-dolfinx * Build fewer Python packages * Fix missing npm dep * Specify image * More package fixes * Add backends for every from-source package * Fix version arg * Remove GitLab CI stuff, add py-installer package * Remove test deps, re-add install_options * Function declaration syntax fix * More build fixes * Update spack create template * Update PythonPackage documentation * Fix documentation build * Fix unit tests * Remove pip flag added only in newer pip * flux: add explicit dependency on jsonschema * Update packages that have been added since this was branched off of develop * Move Python 2 deprecation to a separate PR * py-neurolab: add build dep on py-setuptools * Use wheels for pip/wheel * Allow use of pre-installed pip for external Python * pip -> python -m pip * Use python -m pip for all packages * Fix py-wrapt * Add both platlib and purelib to PYTHONPATH * py-pyyaml: setuptools is needed for all versions * py-pyyaml: link flags aren't needed * Appease spack audit packages * Some build backend is required for all versions, distutils -> setuptools * Correctly handle different setup.py filename * Use wheels for py-tomli to avoid circular dep on py-flit-core * Fix busco installation procedure * Clarify things in spack create template * Test other Python build backends * Undo changes to busco * Various fixes * Don't test other backends --- lib/spack/docs/build_systems/pythonpackage.rst | 777 ++++++++------------- lib/spack/spack/build_environment.py | 4 +- lib/spack/spack/build_systems/python.py | 248 ++----- lib/spack/spack/cmd/create.py | 71 +- lib/spack/spack/stage.py | 8 +- lib/spack/spack/test/cmd/create.py | 2 +- .../repos/builtin.mock/packages/py-pip/package.py | 15 + .../builtin.mock/packages/py-wheel/package.py | 15 + .../packages/aws-parallelcluster/package.py | 2 +- var/spack/repos/builtin/packages/busco/package.py | 16 +- var/spack/repos/builtin/packages/cmor/package.py | 7 +- .../builtin/packages/codar-cheetah/package.py | 1 + .../repos/builtin/packages/easybuild/package.py | 2 + var/spack/repos/builtin/packages/faiss/package.py | 6 +- var/spack/repos/builtin/packages/fenics/package.py | 6 +- .../repos/builtin/packages/flatbuffers/package.py | 10 +- .../repos/builtin/packages/flux-core/package.py | 11 +- .../repos/builtin/packages/flux-sched/package.py | 3 +- .../repos/builtin/packages/gatetools/package.py | 2 +- var/spack/repos/builtin/packages/gurobi/package.py | 8 +- var/spack/repos/builtin/packages/kitty/package.py | 8 +- .../repos/builtin/packages/memsurfer/package.py | 1 + .../repos/builtin/packages/mercurial/package.py | 2 +- .../repos/builtin/packages/minimap2/package.py | 1 + var/spack/repos/builtin/packages/mxnet/package.py | 12 +- var/spack/repos/builtin/packages/nnpack/package.py | 2 +- .../repos/builtin/packages/ont-albacore/package.py | 9 +- .../repos/builtin/packages/phyluce/package.py | 4 - .../repos/builtin/packages/py-3to2/package.py | 3 + .../builtin/packages/py-4suite-xml/package.py | 4 +- .../repos/builtin/packages/py-abipy/package.py | 2 +- .../repos/builtin/packages/py-accimage/package.py | 4 +- .../repos/builtin/packages/py-adios/package.py | 14 +- .../builtin/packages/py-aioitertools/package.py | 1 + .../repos/builtin/packages/py-appnope/package.py | 3 + .../repos/builtin/packages/py-arcgis/package.py | 4 +- .../repos/builtin/packages/py-astropy/package.py | 2 +- .../packages/py-azureml-automl-core/package.py | 8 +- .../builtin/packages/py-azureml-core/package.py | 8 +- .../packages/py-azureml-dataprep-native/package.py | 10 +- .../packages/py-azureml-dataprep-rslex/package.py | 9 +- .../packages/py-azureml-dataprep/package.py | 9 +- .../packages/py-azureml-dataset-runtime/package.py | 8 +- .../packages/py-azureml-pipeline-core/package.py | 11 +- .../packages/py-azureml-pipeline-steps/package.py | 8 +- .../packages/py-azureml-pipeline/package.py | 8 +- .../builtin/packages/py-azureml-sdk/package.py | 8 +- .../packages/py-azureml-telemetry/package.py | 11 +- .../py-azureml-train-automl-client/package.py | 8 +- .../packages/py-azureml-train-core/package.py | 8 +- .../package.py | 8 +- .../builtin/packages/py-azureml-train/package.py | 11 +- .../repos/builtin/packages/py-backcall/package.py | 2 + .../py-backports-ssl-match-hostname/package.py | 3 + .../repos/builtin/packages/py-bandit/package.py | 1 + .../repos/builtin/packages/py-basemap/package.py | 17 - .../builtin/packages/py-bash-kernel/package.py | 1 + .../repos/builtin/packages/py-biomine/package.py | 2 + .../repos/builtin/packages/py-biopandas/package.py | 1 + .../repos/builtin/packages/py-bitstring/package.py | 3 + .../repos/builtin/packages/py-blosc/package.py | 4 +- .../repos/builtin/packages/py-brian/package.py | 2 + .../repos/builtin/packages/py-brian2/package.py | 2 +- .../repos/builtin/packages/py-bz2file/package.py | 3 + .../builtin/packages/py-cachecontrol/package.py | 24 + .../repos/builtin/packages/py-cachy/package.py | 19 + .../repos/builtin/packages/py-cartopy/package.py | 23 - .../repos/builtin/packages/py-cclib/package.py | 2 + .../repos/builtin/packages/py-cdat-lite/package.py | 11 - .../repos/builtin/packages/py-charm4py/package.py | 8 +- .../builtin/packages/py-checkm-genome/package.py | 2 + .../repos/builtin/packages/py-cleo/package.py | 19 + .../repos/builtin/packages/py-clikit/package.py | 25 + .../repos/builtin/packages/py-climate/package.py | 10 - .../repos/builtin/packages/py-cmake/package.py | 9 +- .../repos/builtin/packages/py-coapthon3/package.py | 2 + .../repos/builtin/packages/py-colorpy/package.py | 2 + .../builtin/packages/py-configargparse/package.py | 1 + .../repos/builtin/packages/py-configobj/package.py | 2 + .../builtin/packages/py-configspace/package.py | 1 + .../repos/builtin/packages/py-crashtest/package.py | 19 + .../repos/builtin/packages/py-crcmod/package.py | 5 - .../repos/builtin/packages/py-cssselect/package.py | 2 + .../repos/builtin/packages/py-cudf/package.py | 5 +- .../repos/builtin/packages/py-cuml/package.py | 2 - .../builtin/packages/py-cyordereddict/package.py | 2 + .../repos/builtin/packages/py-cython/package.py | 2 +- .../repos/builtin/packages/py-damask/package.py | 13 +- .../repos/builtin/packages/py-datalad/package.py | 1 - var/spack/repos/builtin/packages/py-dbf/package.py | 3 + var/spack/repos/builtin/packages/py-dgl/package.py | 6 +- .../repos/builtin/packages/py-dipy/package.py | 6 - .../repos/builtin/packages/py-discover/package.py | 3 + .../repos/builtin/packages/py-distlib/package.py | 3 + .../repos/builtin/packages/py-dlcpar/package.py | 2 + .../builtin/packages/py-dotnetcore2/package.py | 8 +- .../repos/builtin/packages/py-doxypy/package.py | 4 +- .../builtin/packages/py-dp-gp-cluster/package.py | 4 +- .../repos/builtin/packages/py-dpath/package.py | 2 + .../repos/builtin/packages/py-dryscrape/package.py | 2 + .../packages/py-easybuild-easyblocks/package.py | 2 + .../packages/py-easybuild-easyconfigs/package.py | 2 + .../packages/py-easybuild-framework/package.py | 2 +- .../repos/builtin/packages/py-empy/package.py | 3 + .../builtin/packages/py-entrypoints/package.py | 3 +- .../repos/builtin/packages/py-ephem/package.py | 3 + .../repos/builtin/packages/py-epydoc/package.py | 3 + .../repos/builtin/packages/py-fallocate/package.py | 3 + .../repos/builtin/packages/py-fastrlock/package.py | 6 +- .../builtin/packages/py-faststructure/package.py | 2 + .../builtin/packages/py-fenics-basix/package.py | 2 - .../builtin/packages/py-fenics-dolfinx/package.py | 2 - .../repos/builtin/packages/py-flit-core/package.py | 35 +- .../repos/builtin/packages/py-flit/package.py | 1 + .../repos/builtin/packages/py-flye/package.py | 2 +- .../builtin/packages/py-fortranformat/package.py | 3 + .../builtin/packages/py-functools32/package.py | 3 + .../repos/builtin/packages/py-geeup/package.py | 2 +- .../repos/builtin/packages/py-genders/package.py | 1 + .../repos/builtin/packages/py-glob2/package.py | 19 + .../builtin/packages/py-globus-sdk/package.py | 9 +- .../repos/builtin/packages/py-gluoncv/package.py | 6 +- .../repos/builtin/packages/py-gnuplot/package.py | 2 + .../repos/builtin/packages/py-goatools/package.py | 1 + .../repos/builtin/packages/py-gosam/package.py | 2 + .../repos/builtin/packages/py-gpaw/package.py | 1 + .../repos/builtin/packages/py-gputil/package.py | 6 - .../repos/builtin/packages/py-gpyopt/package.py | 1 - .../repos/builtin/packages/py-greenlet/package.py | 2 +- .../repos/builtin/packages/py-h5glance/package.py | 1 + .../repos/builtin/packages/py-h5py/package.py | 13 - .../repos/builtin/packages/py-heapdict/package.py | 6 - .../repos/builtin/packages/py-humanize/package.py | 1 - .../builtin/packages/py-imageio-ffmpeg/package.py | 5 +- .../repos/builtin/packages/py-importlib/package.py | 3 + .../packages/py-inference-schema/package.py | 8 +- .../repos/builtin/packages/py-iniparse/package.py | 2 + .../repos/builtin/packages/py-installer/package.py | 20 + .../builtin/packages/py-intel-openmp/package.py | 8 +- .../repos/builtin/packages/py-ipycanvas/package.py | 5 +- .../repos/builtin/packages/py-ipyevents/package.py | 4 +- .../repos/builtin/packages/py-ipykernel/package.py | 7 +- .../builtin/packages/py-ipyparallel/package.py | 26 +- .../packages/py-ipython-genutils/package.py | 3 +- .../builtin/packages/py-ipywidgets/package.py | 2 + .../repos/builtin/packages/py-isort/package.py | 2 +- var/spack/repos/builtin/packages/py-itk/package.py | 10 +- .../repos/builtin/packages/py-jdatetime/package.py | 3 + .../repos/builtin/packages/py-jeepney/package.py | 1 + .../repos/builtin/packages/py-joblib/package.py | 2 +- .../repos/builtin/packages/py-jplephem/package.py | 2 + .../builtin/packages/py-jupyter-core/package.py | 2 +- .../packages/py-jupyter-packaging/package.py | 11 +- .../packages/py-jupyter-packaging11/package.py | 26 + .../packages/py-jupyter-packaging7/package.py | 23 + .../builtin/packages/py-jupyter-server/package.py | 5 +- .../repos/builtin/packages/py-jupyter/package.py | 2 + .../packages/py-jupyterlab-server/package.py | 3 + .../packages/py-jupyterlab-widgets/package.py | 10 +- .../builtin/packages/py-jupyterlab/package.py | 8 +- .../repos/builtin/packages/py-keyring/package.py | 26 +- .../builtin/packages/py-kiwisolver/package.py | 3 +- .../repos/builtin/packages/py-lazyarray/package.py | 1 + .../repos/builtin/packages/py-lightgbm/package.py | 2 +- .../builtin/packages/py-line-profiler/package.py | 2 +- .../repos/builtin/packages/py-locket/package.py | 3 + .../builtin/packages/py-matplotlib/package.py | 4 +- .../repos/builtin/packages/py-meshio/package.py | 4 - .../repos/builtin/packages/py-meshio/setup.patch | 10 - .../repos/builtin/packages/py-mikado/package.py | 1 + .../repos/builtin/packages/py-mmcv/package.py | 1 + var/spack/repos/builtin/packages/py-mne/package.py | 2 - .../repos/builtin/packages/py-mo-pack/package.py | 1 + .../repos/builtin/packages/py-mpi4py/package.py | 2 +- .../builtin/packages/py-multi-key-dict/package.py | 3 + var/spack/repos/builtin/packages/py-mx/package.py | 3 + .../packages/py-mysql-connector-python/package.py | 4 - .../py-mysql-connector-python/single-version.patch | 22 - .../repos/builtin/packages/py-nbformat/package.py | 2 + .../repos/builtin/packages/py-nbmake/package.py | 1 + .../builtin/packages/py-nc-time-axis/package.py | 1 + .../repos/builtin/packages/py-nestle/package.py | 3 + .../repos/builtin/packages/py-netcdf4/package.py | 3 - .../repos/builtin/packages/py-networkit/package.py | 9 +- .../repos/builtin/packages/py-neurolab/package.py | 2 +- .../repos/builtin/packages/py-ninja/package.py | 1 + .../repos/builtin/packages/py-nipype/package.py | 2 - .../repos/builtin/packages/py-numpy/package.py | 4 +- .../builtin/packages/py-nvidia-ml-py/package.py | 3 + .../builtin/packages/py-nvidia-ml-py3/package.py | 3 + .../repos/builtin/packages/py-olefile/package.py | 2 + .../packages/py-opencensus-context/package.py | 8 +- .../repos/builtin/packages/py-or-tools/package.py | 6 +- .../builtin/packages/py-ordereddict/package.py | 3 + .../repos/builtin/packages/py-pager/package.py | 3 + .../builtin/packages/py-pandocfilters/package.py | 4 +- .../repos/builtin/packages/py-parsl/package.py | 34 +- .../repos/builtin/packages/py-pastel/package.py | 18 + .../repos/builtin/packages/py-pathlib/package.py | 3 + .../repos/builtin/packages/py-pauvre/package.py | 1 + .../repos/builtin/packages/py-pep517/package.py | 3 +- .../repos/builtin/packages/py-pexpect/package.py | 2 + .../repos/builtin/packages/py-phonopy/package.py | 2 + .../repos/builtin/packages/py-pillow/package.py | 7 - var/spack/repos/builtin/packages/py-pip/package.py | 50 +- .../repos/builtin/packages/py-pkgconfig/package.py | 9 +- .../repos/builtin/packages/py-planar/package.py | 3 + var/spack/repos/builtin/packages/py-pmw/package.py | 3 + .../builtin/packages/py-poetry-core/package.py | 22 + .../repos/builtin/packages/py-poetry/package.py | 43 ++ .../repos/builtin/packages/py-protobuf/package.py | 7 +- .../builtin/packages/py-ptyprocess/package.py | 2 + .../repos/builtin/packages/py-pyarrow/package.py | 4 +- .../repos/builtin/packages/py-pycares/package.py | 5 +- .../repos/builtin/packages/py-pychecker/package.py | 3 + .../repos/builtin/packages/py-pycosat/package.py | 3 + .../repos/builtin/packages/py-pycuda/package.py | 2 +- .../repos/builtin/packages/py-pycurl/package.py | 6 +- .../repos/builtin/packages/py-pydatalog/package.py | 3 + .../repos/builtin/packages/py-pydmd/package.py | 10 +- .../repos/builtin/packages/py-pydv/package.py | 1 + .../builtin/packages/py-pyelftools/package.py | 2 +- .../repos/builtin/packages/py-pyem/package.py | 6 +- .../repos/builtin/packages/py-pygpu/package.py | 7 +- .../repos/builtin/packages/py-pygtrie/package.py | 3 + .../builtin/packages/py-pyheadtail/package.py | 1 + .../repos/builtin/packages/py-pyke/package.py | 2 + .../repos/builtin/packages/py-pylev/package.py | 18 + .../repos/builtin/packages/py-pylikwid/package.py | 2 + .../repos/builtin/packages/py-pymatgen/package.py | 2 - .../repos/builtin/packages/py-pymol/package.py | 8 +- .../repos/builtin/packages/py-pympler/package.py | 4 +- .../repos/builtin/packages/py-pymumps/package.py | 4 +- .../repos/builtin/packages/py-pynio/package.py | 2 + .../repos/builtin/packages/py-pynn/package.py | 4 +- .../repos/builtin/packages/py-pyodbc/package.py | 8 +- .../repos/builtin/packages/py-pyopencl/package.py | 2 +- .../repos/builtin/packages/py-pypar/package.py | 2 + .../repos/builtin/packages/py-pyparsing/package.py | 2 +- .../repos/builtin/packages/py-pypeg2/package.py | 2 + .../repos/builtin/packages/py-pyscf/package.py | 1 + .../repos/builtin/packages/py-pyside/package.py | 2 +- .../repos/builtin/packages/py-pyside2/package.py | 6 +- .../repos/builtin/packages/py-pysqlite/package.py | 2 + .../builtin/packages/py-pytest-isort/package.py | 1 + .../packages/py-pytest-random-order/package.py | 7 +- .../builtin/packages/py-python-fmask/package.py | 2 + .../builtin/packages/py-python-logstash/package.py | 3 + .../builtin/packages/py-python-lzo/package.py | 2 + .../builtin/packages/py-python-meep/package.py | 22 +- .../builtin/packages/py-python3-xlib/package.py | 2 + .../repos/builtin/packages/py-pythonqwt/package.py | 3 - .../builtin/packages/py-pythonsollya/package.py | 2 +- .../repos/builtin/packages/py-pytoml/package.py | 19 + .../repos/builtin/packages/py-pyutilib/package.py | 1 + .../repos/builtin/packages/py-pyyaml/package.py | 42 +- .../builtin/packages/py-qiskit-aer/package.py | 2 +- .../repos/builtin/packages/py-qtconsole/package.py | 1 + .../builtin/packages/py-quantities/package.py | 2 + .../repos/builtin/packages/py-ranger-fm/package.py | 3 + .../repos/builtin/packages/py-rdflib/package.py | 3 +- .../repos/builtin/packages/py-requests/package.py | 3 +- .../builtin/packages/py-resultsfile/package.py | 2 + .../repos/builtin/packages/py-rios/package.py | 2 + .../packages/py-scientificpython/package.py | 2 + .../repos/builtin/packages/py-scipy/package.py | 4 +- var/spack/repos/builtin/packages/py-scs/package.py | 2 +- .../builtin/packages/py-secretstorage/package.py | 8 +- .../builtin/packages/py-setuptools-rust/package.py | 4 +- .../py-setuptools-scm-git-archive/package.py | 2 +- .../builtin/packages/py-setuptools/package.py | 2 + .../repos/builtin/packages/py-sgp4/package.py | 2 + .../builtin/packages/py-shellingham/package.py | 1 - .../repos/builtin/packages/py-shiboken/package.py | 2 +- .../repos/builtin/packages/py-shiboken2/package.py | 16 +- .../repos/builtin/packages/py-simplekml/package.py | 4 +- var/spack/repos/builtin/packages/py-sip/package.py | 4 + .../builtin/packages/py-snowballstemmer/package.py | 2 +- .../py-sphinx-autodoc-typehints/package.py | 11 +- .../packages/py-sphinxcontrib-mermaid/package.py | 3 +- .../packages/py-sphinxcontrib-trio/package.py | 3 +- .../repos/builtin/packages/py-spyder/package.py | 2 + .../packages/py-sqlalchemy-stubs/package.py | 4 +- .../builtin/packages/py-statsmodels/package.py | 4 +- .../repos/builtin/packages/py-symengine/package.py | 3 +- .../repos/builtin/packages/py-sympy/package.py | 2 + .../builtin/packages/py-systemd-python/package.py | 3 + .../packages/py-tensorboard-plugin-wit/package.py | 6 +- .../builtin/packages/py-tensorboard/package.py | 6 +- .../packages/py-tensorflow-estimator/package.py | 6 +- .../builtin/packages/py-tensorflow-hub/package.py | 6 +- .../packages/py-tensorflow-probability/package.py | 6 +- .../builtin/packages/py-tensorflow/package.py | 7 +- .../repos/builtin/packages/py-termcolor/package.py | 3 + .../repos/builtin/packages/py-terminado/package.py | 8 +- .../repos/builtin/packages/py-testpath/package.py | 1 + .../repos/builtin/packages/py-tfdlpack/package.py | 6 +- .../builtin/packages/py-thirdorder/package.py | 3 +- .../builtin/packages/py-threadpoolctl/package.py | 1 + .../repos/builtin/packages/py-tomli/package.py | 13 +- .../repos/builtin/packages/py-tomlkit/package.py | 11 +- .../repos/builtin/packages/py-tomopy/package.py | 5 +- .../packages/py-torch-nvidia-apex/package.py | 6 +- .../repos/builtin/packages/py-torch/package.py | 9 - .../repos/builtin/packages/py-torchfile/package.py | 2 + .../repos/builtin/packages/py-traitlets/package.py | 1 + .../builtin/packages/py-transforms3d/package.py | 2 + .../repos/builtin/packages/py-treehash/package.py | 3 + .../repos/builtin/packages/py-triangle/package.py | 1 + .../repos/builtin/packages/py-tuiview/package.py | 2 + .../repos/builtin/packages/py-typeguard/package.py | 8 +- .../builtin/packages/py-typesentry/package.py | 1 + var/spack/repos/builtin/packages/py-uhi/package.py | 3 +- .../repos/builtin/packages/py-vcf-kit/package.py | 2 +- .../repos/builtin/packages/py-vermin/package.py | 2 +- .../builtin/packages/py-webkit-server/package.py | 3 + .../repos/builtin/packages/py-wget/package.py | 3 + .../repos/builtin/packages/py-wheel/package.py | 37 +- .../repos/builtin/packages/py-wrapt/package.py | 2 +- .../repos/builtin/packages/py-xgboost/package.py | 15 +- .../repos/builtin/packages/py-xlrd/package.py | 2 +- .../builtin/packages/py-xlsxwriter/package.py | 2 + .../repos/builtin/packages/py-yahmm/package.py | 2 + .../repos/builtin/packages/py-yarl/package.py | 2 +- .../repos/builtin/packages/py-yolk3k/package.py | 4 +- .../repos/builtin/packages/py-ytopt/package.py | 1 + var/spack/repos/builtin/packages/python/package.py | 2 - .../repos/builtin/packages/reditools/package.py | 4 +- var/spack/repos/builtin/packages/scons/package.py | 8 +- var/spack/repos/builtin/packages/sgpp/package.py | 12 +- .../repos/builtin/packages/treelite/package.py | 31 +- 331 files changed, 1474 insertions(+), 1563 deletions(-) create mode 100644 var/spack/repos/builtin.mock/packages/py-pip/package.py create mode 100644 var/spack/repos/builtin.mock/packages/py-wheel/package.py create mode 100644 var/spack/repos/builtin/packages/py-cachecontrol/package.py create mode 100644 var/spack/repos/builtin/packages/py-cachy/package.py create mode 100644 var/spack/repos/builtin/packages/py-cleo/package.py create mode 100644 var/spack/repos/builtin/packages/py-clikit/package.py create mode 100644 var/spack/repos/builtin/packages/py-crashtest/package.py create mode 100644 var/spack/repos/builtin/packages/py-glob2/package.py create mode 100644 var/spack/repos/builtin/packages/py-installer/package.py create mode 100644 var/spack/repos/builtin/packages/py-jupyter-packaging11/package.py create mode 100644 var/spack/repos/builtin/packages/py-jupyter-packaging7/package.py delete mode 100644 var/spack/repos/builtin/packages/py-meshio/setup.patch delete mode 100644 var/spack/repos/builtin/packages/py-mysql-connector-python/single-version.patch create mode 100644 var/spack/repos/builtin/packages/py-pastel/package.py create mode 100644 var/spack/repos/builtin/packages/py-poetry-core/package.py create mode 100644 var/spack/repos/builtin/packages/py-poetry/package.py create mode 100644 var/spack/repos/builtin/packages/py-pylev/package.py create mode 100644 var/spack/repos/builtin/packages/py-pytoml/package.py diff --git a/lib/spack/docs/build_systems/pythonpackage.rst b/lib/spack/docs/build_systems/pythonpackage.rst index 365c5d7bce..6fdd3ee9b0 100644 --- a/lib/spack/docs/build_systems/pythonpackage.rst +++ b/lib/spack/docs/build_systems/pythonpackage.rst @@ -9,216 +9,80 @@ PythonPackage ------------- -Python packages and modules have their own special build system. +Python packages and modules have their own special build system. This +documentation covers everything you'll need to know in order to write +a Spack build recipe for a Python library. -^^^^^^ -Phases -^^^^^^ - -The ``PythonPackage`` base class provides the following phases that -can be overridden: - -* ``build`` -* ``build_py`` -* ``build_ext`` -* ``build_clib`` -* ``build_scripts`` -* ``install`` -* ``install_lib`` -* ``install_headers`` -* ``install_scripts`` -* ``install_data`` - -These are all standard ``setup.py`` commands and can be found by running: - -.. code-block:: console - - $ python setup.py --help-commands - - -By default, only the ``build`` and ``install`` phases are run: - -#. ``build`` - build everything needed to install -#. ``install`` - install everything from build directory - -If for whatever reason you need to run more phases, simply modify your -``phases`` list like so: - -.. code-block:: python - - phases = ['build_ext', 'install'] - - -Each phase provides a function ```` that runs: - -.. code-block:: console - - $ python -s setup.py --no-user-cfg - - -Each phase also has a ```` function that can pass arguments to -this call. All of these functions are empty except for the ``install_args`` -function, which passes ``--prefix=/path/to/installation/prefix``. There is -also some additional logic specific to setuptools and eggs. - -If you need to run a phase that is not a standard ``setup.py`` command, -you'll need to define a function for it like so: - -.. code-block:: python - - phases = ['configure', 'build', 'install'] - - def configure(self, spec, prefix): - self.setup_py('configure') - - -^^^^^^ -Wheels -^^^^^^ - -Some Python packages are closed-source and distributed as wheels. -Instead of using the ``PythonPackage`` base class, you should extend -the ``Package`` base class and implement the following custom installation -procedure: - -.. code-block:: python - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) - - -This will require a dependency on pip, as mentioned below. - -^^^^^^^^^^^^^^^ -Important files -^^^^^^^^^^^^^^^ - -Python packages can be identified by the presence of a ``setup.py`` file. -This file is used by package managers like ``pip`` to determine a -package's dependencies and the version of dependencies required, so if -the ``setup.py`` file is not accurate, the package will not build properly. -For this reason, the ``setup.py`` file should be fairly reliable. If the -documentation and ``setup.py`` disagree on something, the ``setup.py`` -file should be considered to be the truth. As dependencies are added or -removed, the documentation is much more likely to become outdated than -the ``setup.py``. - -The Python ecosystem has evolved significantly over the years. Before -setuptools became popular, most packages listed their dependencies in a -``requirements.txt`` file. Once setuptools took over, these dependencies -were listed directly in the ``setup.py``. Newer PEPs introduced additional -files, like ``setup.cfg`` and ``pyproject.toml``. You should look out for -all of these files, as they may all contain important information about -package dependencies. - -Some Python packages are closed-source and are distributed as Python -wheels. For example, ``py-azureml-sdk`` downloads a ``.whl`` file. This -file is simply a zip file, and can be extracted using: - -.. code-block:: console - - $ unzip *.whl - - -The zip file will not contain a ``setup.py``, but it will contain a -``METADATA`` file which contains all the information you need to -write a ``package.py`` build recipe. - -.. _pypi: - -^^^^ -PyPI -^^^^ +^^^^^^^^^^^ +Terminology +^^^^^^^^^^^ -The vast majority of Python packages are hosted on PyPI (The Python -Package Index), which is :ref:`preferred over GitHub ` -for downloading packages. ``pip`` only supports packages hosted on PyPI, making -it the only option for developers who want a simple installation. -Search for "PyPI " to find the download page. Note that -some pages are versioned, and the first result may not be the newest -version. Click on the "Latest Version" button to the top right to see -if a newer version is available. The download page is usually at:: +In the Python ecosystem, there are a number of terms that are +important to understand. - https://pypi.org/project/ +**PyPI** + The `Python Package Index `_, where most Python + libraries are hosted. +**sdist** + Source distributions, distributed as tarballs (.tar.gz) and zip + files (.zip). Contain the source code of the package. -Since PyPI is so common, the ``PythonPackage`` base class has a -``pypi`` attribute that can be set. Once set, ``pypi`` will be used -to define the ``homepage``, ``url``, and ``list_url``. For example, -the following: +**bdist** + Built distributions, distributed as wheels (.whl). Contain the + pre-built library. -.. code-block:: python - - homepage = 'https://pypi.org/project/setuptools/' - url = 'https://pypi.org/packages/source/s/setuptools/setuptools-49.2.0.zip' - list_url = 'https://pypi.org/simple/setuptools/' - - -is equivalent to: - -.. code-block:: python +**wheel** + A binary distribution format common in the Python ecosystem. This + file is actually just a zip file containing specific metadata and + code. See the + `documentation `_ + for more details. - pypi = 'setuptools/setuptools-49.2.0.zip' +**build frontend** + Command-line tools used to build and install wheels. Examples + include `pip `_, + `build `_, and + `installer `_. +**build backend** + Libraries used to define how to build a wheel. Examples + include `setuptools `__, + `flit `_, and + `poetry `_. ^^^^^^^^^^^ -Description +Downloading ^^^^^^^^^^^ -The top of the PyPI downloads page contains a description of the -package. The first line is usually a short description, while there -may be a several line "Project Description" that follows. Choose whichever -is more useful. You can also get these descriptions on the command-line -using: - -.. code-block:: console +The first step in packaging a Python library is to figure out where +to download it from. The vast majority of Python packages are hosted +on `PyPI `_, which is +:ref:`preferred over GitHub ` for downloading +packages. Search for the package name on PyPI to find the project +page. The project page is usually located at:: - $ python setup.py --description - $ python setup.py --long-description + https://pypi.org/project/ +On the project page, there is a "Download files" tab containing +download URLs. Whenever possible, we prefer to build Spack packages +from source. If PyPI only has wheels, check to see if the project is +hosted on GitHub and see if GitHub has source distributions. The +project page usually has a "Homepage" and/or "Source code" link for +this. If the project is closed-source, it may only have wheels +available. For example, ``py-azureml-sdk`` is closed-source and can +be downloaded from:: -^^^^^^^^ -Homepage -^^^^^^^^ + https://pypi.io/packages/py3/a/azureml_sdk/azureml_sdk-1.11.0-py3-none-any.whl -Package developers use ``setup.py`` to upload new versions to PyPI. -The ``setup`` method often passes metadata like ``homepage`` to PyPI. -This metadata is displayed on the left side of the download page. -Search for the text "Homepage" under "Project links" to find it. You -should use this page instead of the PyPI page if they differ. You can -also get the homepage on the command-line by running: +Once you've found a URL to download the package from, run: .. code-block:: console - $ python setup.py --url - - -^^^ -URL -^^^ - -If ``pypi`` is set as mentioned above, ``url`` and ``list_url`` will -be automatically set for you. If both ``.tar.gz`` and ``.zip`` versions -are available, ``.tar.gz`` is preferred. If some releases offer both -``.tar.gz`` and ``.zip`` versions, but some only offer ``.zip`` versions, -use ``.zip``. - -Some Python packages are closed-source and do not ship ``.tar.gz`` or ``.zip`` -files on either PyPI or GitHub. If this is the case, you can still download -and install a Python wheel. For example, ``py-azureml-sdk`` is closed source -and can be downloaded from:: - - https://pypi.io/packages/py3/a/azureml_sdk/azureml_sdk-1.11.0-py3-none-any.whl - + $ spack create -You may see Python-specific or OS-specific URLs. Note that when you add a -``.whl`` URL, you should add ``expand=False`` to ensure that Spack doesn't -try to extract the wheel: -.. code-block:: python - - version('1.11.0', sha256='d8c9d24ea90457214d798b0d922489863dad518adde3638e08ef62de28fb183a', expand=False) +to create a new package template. .. _pypi-vs-github: @@ -226,11 +90,13 @@ try to extract the wheel: PyPI vs. GitHub """"""""""""""" -Many packages are hosted on PyPI, but are developed on GitHub or another -version control systems. The tarball can be downloaded from either -location, but PyPI is preferred for the following reasons: +Many packages are hosted on PyPI, but are developed on GitHub or +another version control system hosting service. The source code can +be downloaded from either location, but PyPI is preferred for the +following reasons: -#. PyPI contains the bare minimum number of files needed to install the package. +#. PyPI contains the bare minimum number of files needed to install + the package. You may notice that the tarball you download from PyPI does not have the same checksum as the tarball you download from GitHub. @@ -267,300 +133,217 @@ location, but PyPI is preferred for the following reasons: PyPI is nice because it makes it physically impossible to re-release the same version of a package with a different checksum. -Use the :ref:`pypi attribute ` to facilitate construction of PyPI package -references. - -^^^^^^^^^^^^^^^^^^^^^^^^^ -Build system dependencies -^^^^^^^^^^^^^^^^^^^^^^^^^ - -There are a few dependencies common to the ``PythonPackage`` build system. +The only reason to use GitHub instead of PyPI is if PyPI only has +wheels or if the PyPI sdist is missing a file needed to build the +package. If this is the case, please add a comment above the ``url`` +explaining this. -"""""" -Python -"""""" +^^^^ +PyPI +^^^^ -Obviously, every ``PythonPackage`` needs Python at build-time to run -``python setup.py build && python setup.py install``. Python is also -needed at run-time if you want to import the module. Due to backwards -incompatible changes between Python 2 and 3, it is very important to -specify which versions of Python are supported. If the documentation -mentions that Python 3 is required, this can be specified as: +Since PyPI is so commonly used to host Python libraries, the +``PythonPackage`` base class has a ``pypi`` attribute that can be +set. Once set, ``pypi`` will be used to define the ``homepage``, +``url``, and ``list_url``. For example, the following: .. code-block:: python - depends_on('python@3:', type=('build', 'run')) + homepage = 'https://pypi.org/project/setuptools/' + url = 'https://pypi.org/packages/source/s/setuptools/setuptools-49.2.0.zip' + list_url = 'https://pypi.org/simple/setuptools/' -If Python 2 is required, this would look like: +is equivalent to: .. code-block:: python - depends_on('python@:2', type=('build', 'run')) - - -If Python 2.7 is the only version that works, you can use: - -.. code-block:: python + pypi = 'setuptools/setuptools-49.2.0.zip' - depends_on('python@2.7:2.8', type=('build', 'run')) +If a package has a different homepage listed on PyPI, you can +override it by setting your own ``homepage``. -The documentation may not always specify supported Python versions. -Another place to check is in the ``setup.py`` or ``setup.cfg`` file. -Look for a line containing ``python_requires``. An example from -`py-numpy `_ -looks like: +^^^^^^^^^^^ +Description +^^^^^^^^^^^ -.. code-block:: python +The top of the PyPI project page contains a short description of the +package. The "Project description" tab may also contain a longer +description of the package. Either of these can be used to populate +the package docstring. - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*' +^^^^^^^^^^^^^ +Build backend +^^^^^^^^^^^^^ +Once you've determined the basic metadata for a package, the next +step is to determine the build backend. ``PythonPackage`` uses +`pip `_ to install the package, but pip +requires a backend to actually build the package. -You may also find a version check at the top of the ``setup.py``: +To determine the build backend, look for a ``pyproject.toml`` file. +If there is no ``pyproject.toml`` file and only a ``setup.py`` or +``setup.cfg`` file, you can assume that the project uses +:ref:`setuptools`. If there is a ``pyproject.toml`` file, see if it +contains a ``[build-system]`` section. For example: -.. code-block:: python +.. code-block:: toml - if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 4): - raise RuntimeError("Python version 2.7 or >= 3.4 required.") + [build-system] + requires = [ + "setuptools>=42", + "wheel", + ] + build-backend = "setuptools.build_meta" -This can be converted to Spack's spec notation like so: +This section does two things: the ``requires`` key lists build +dependencies of the project, and the ``build-backend`` key defines +the build backend. All of these build dependencies should be added as +dependencies to your package: .. code-block:: python - depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) + depends_on('py-setuptools@42:', type='build') -If you are writing a recipe for a package that only distributes -wheels, look for a section in the ``METADATA`` file that looks like:: - - Requires-Python: >=3.5,<4 +Note that ``py-wheel`` is already listed as a build dependency in the +``PythonPackage`` base class, so you don't need to add it unless you +need to specify a specific version requirement or change the +dependency type. +See `PEP 517 `_ and +`PEP 518 `_ for more +information on the design of ``pyproject.toml``. -This would be translated to: +Depending on which build backend a project uses, there are various +places that run-time dependencies can be listed. -.. code-block:: python +""""""""" +distutils +""""""""" - extends('python') - depends_on('python@3.5:3', type=('build', 'run')) +Before the introduction of setuptools and other build backends, +Python packages had to rely on the built-in distutils library. +Distutils is missing many of the features that setuptools and other +build backends offer, and users are encouraged to use setuptools +instead. In fact, distutils was deprecated in Python 3.10 and will be +removed in Python 3.12. Because of this, pip actually replaces all +imports of distutils with setuptools. If a package uses distutils, +you should instead add a build dependency on setuptools. Check for a +``requirements.txt`` file that may list dependencies of the project. - -Many ``setup.py`` or ``setup.cfg`` files also contain information like:: - - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - - -This is a list of versions of Python that the developer likely tests. -However, you should not use this to restrict the versions of Python -the package uses unless one of the two former methods (``python_requires`` -or ``sys.version_info``) is used. There is no logic in setuptools -that prevents the package from building for Python versions not in -this list, and often new releases like Python 3.7 or 3.8 work just fine. +.. _setuptools: """""""""" setuptools """""""""" -Originally, the Python language had a single build system called -distutils, which is built into Python. Distutils provided a common -framework for package authors to describe their project and how it -should be built. However, distutils was not without limitations. -Most notably, there was no way to list a project's dependencies -with distutils. Along came setuptools, a non-builtin build system -designed to overcome the limitations of distutils. Both projects -use a similar API, making the transition easy while adding much -needed functionality. Today, setuptools is used in around 90% of -the Python packages in Spack. - -Since setuptools isn't built-in to Python, you need to add it as a -dependency. To determine whether or not a package uses setuptools, -search the file for an import statement like: +If the ``pyproject.toml`` lists ``setuptools.build_meta`` as a +``build-backend``, or if the package has a ``setup.py`` that imports +``setuptools``, or if the package has a ``setup.cfg`` file, then it +uses setuptools to build. Setuptools is a replacement for the +distutils library, and has almost the exact same API. Dependencies +can be listed in the ``setup.py`` or ``setup.cfg`` file. Look for the +following arguments: -.. code-block:: python - - import setuptools +* ``python_requires`` + This specifies the version of Python that is required. -or: +* ``setup_requires`` -.. code-block:: python + These packages are usually only needed at build-time, so you can + add them with ``type='build'``. - from setuptools import setup +* ``install_requires`` + These packages are required for building and installation. You can + add them with ``type=('build', 'run')``. -Some packages are designed to work with both setuptools and distutils, -so you may find something like: +* ``extras_require`` -.. code-block:: python + These packages are optional dependencies that enable additional + functionality. You should add a variant that optionally adds these + dependencies. This variant should be False by default. - try: - from setuptools import setup - except ImportError: - from distutils.core import setup +* ``tests_require`` + These are packages that are required to run the unit tests for the + package. These dependencies can be specified using the + ``type='test'`` dependency type. However, the PyPI tarballs rarely + contain unit tests, so there is usually no reason to add these. -This uses setuptools if available, and falls back to distutils if not. -In this case, you would still want to add a setuptools dependency, as -it offers us more control over the installation. +See https://setuptools.pypa.io/en/latest/userguide/dependency_management.html +for more information on how setuptools handles dependency management. +See `PEP 440 `_ +for documentation on version specifiers in setuptools. -Unless specified otherwise, setuptools is usually a build-only dependency. -That is, it is needed to install the software, but is not needed at -run-time. This can be specified as: +"""" +flit +"""" -.. code-block:: python +There are actually two possible ``build-backend`` for flit, ``flit`` +and ``flit_core``. If you see these in the ``pyproject.toml``, add a +build dependency to your package. With flit, all dependencies are +listed directly in the ``pyproject.toml`` file. Older versions of +flit used to store this info in a ``flit.ini`` file, so check for +this too. - depends_on('py-setuptools', type='build') +Either of these files may contain keys like: +* ``requires-python`` -""" -pip -""" + This specifies the version of Python that is required -Packages distributed as Python wheels will require an extra dependency -on pip: +* ``dependencies`` or ``requires`` -.. code-block:: python + These packages are required for building and installation. You can + add them with ``type=('build', 'run')``. - depends_on('py-pip', type='build') +* ``project.optional-dependencies`` or ``requires-extra`` + This section includes keys with lists of optional dependencies + needed to enable those features. You should add a variant that + optionally adds these dependencies. This variant should be False + by default. -We will use pip to install the actual wheel. +See https://flit.readthedocs.io/en/latest/pyproject_toml.html for +more information. """""" -cython +poetry """""" -Compared to compiled languages, interpreted languages like Python can -be quite a bit slower. To work around this, some Python developers -rewrite computationally demanding sections of code in C, a process -referred to as "cythonizing". In order to build these package, you -need to add a build dependency on cython: - -.. code-block:: python - - depends_on('py-cython', type='build') - - -Look for references to "cython" in the ``setup.py`` to determine -whether or not this is necessary. Cython may be optional, but -even then you should list it as a required dependency. Spack is -designed to compile software, and is meant for HPC facilities -where speed is crucial. There is no reason why someone would not -want an optimized version of a library instead of the pure-Python -version. - -Note that some release tarballs come pre-cythonized, and cython is -not needed as a dependency. However, this is becoming less common -as Python continues to evolve and developers discover that cythonized -sources are no longer compatible with newer versions of Python and -need to be re-cythonized. - -^^^^^^^^^^^^^^^^^^^ -Python dependencies -^^^^^^^^^^^^^^^^^^^ - -When you install a package with ``pip``, it reads the ``setup.py`` -file in order to determine the dependencies of the package. -If the dependencies are not yet installed, ``pip`` downloads them -and installs them for you. This may sound convenient, but Spack -cannot rely on this behavior for two reasons: - -#. Spack needs to be able to install packages on air-gapped networks. - - If there is no internet connection, ``pip`` can't download the - package dependencies. By explicitly listing every dependency in - the ``package.py``, Spack knows what to download ahead of time. - -#. Duplicate installations of the same dependency may occur. - - Spack supports *activation* of Python extensions, which involves - symlinking the package installation prefix to the Python installation - prefix. If your package is missing a dependency, that dependency - will be installed to the installation directory of the same package. - If you try to activate the package + dependency, it may cause a - problem if that package has already been activated. - -For these reasons, you must always explicitly list all dependencies. -Although the documentation may list the package's dependencies, -often the developers assume people will use ``pip`` and won't have to -worry about it. Always check the ``setup.py`` to find the true -dependencies. - -If the package relies on ``distutils``, it may not explicitly list its -dependencies. Check for statements like: - -.. code-block:: python - - try: - import numpy - except ImportError: - raise ImportError("numpy must be installed prior to installation") - - -Obviously, this means that ``py-numpy`` is a dependency. - -If the package uses ``setuptools``, check for the following clues: - -* ``python_requires`` - - As mentioned above, this specifies which versions of Python are - required. - -* ``setup_requires`` - - These packages are usually only needed at build-time, so you can - add them with ``type='build'``. - -* ``install_requires`` - - These packages are required for building and installation. You can - add them with ``type=('build', 'run')``. - -* ``extra_requires`` - - These packages are optional dependencies that enable additional - functionality. You should add a variant that optionally adds these - dependencies. This variant should be False by default. - -* ``test_requires`` +Like flit, poetry also has two possible ``build-backend``, ``poetry`` +and ``poetry_core``. If you see these in the ``pyproject.toml``, add +a build dependency to your package. With poetry, all dependencies are +listed directly in the ``pyproject.toml`` file. Dependencies are +listed in a ``[tool.poetry.dependencies]`` section, and use a +`custom syntax `_ +for specifying the version requirements. Note that ``~=`` works +differently in poetry than in setuptools and flit for versions that +start with a zero. - These are packages that are required to run the unit tests for the - package. These dependencies can be specified using the - ``type='test'`` dependency type. However, the PyPI tarballs rarely - contain unit tests, so there is usually no reason to add these. +"""""" +wheels +"""""" -In the root directory of the package, you may notice a -``requirements.txt`` file. It may look like this file contains a list -of all of the package's dependencies. Don't be fooled. This file is -used by tools like Travis to install the pre-requisites for the -package... and a whole bunch of other things. It often contains -dependencies only needed for unit tests, like: +Some Python packages are closed-source and are distributed as Python +wheels. For example, ``py-azureml-sdk`` downloads a ``.whl`` file. This +file is simply a zip file, and can be extracted using: -* mock -* nose -* pytest +.. code-block:: console -It can also contain dependencies for building the documentation, like -sphinx. If you can't find any information about the package's -dependencies, you can take a look in ``requirements.txt``, but be sure -not to add test or documentation dependencies. + $ unzip *.whl -Newer PEPs have added alternative ways to specify a package's dependencies. -If you don't see any dependencies listed in the ``setup.py``, look for a -``setup.cfg`` or ``pyproject.toml``. These files can be used to store the -same ``install_requires`` information that ``setup.py`` used to use. -If you are write a recipe for a package that only distributes wheels, -check the ``METADATA`` file for lines like:: +The zip file will not contain a ``setup.py``, but it will contain a +``METADATA`` file which contains all the information you need to +write a ``package.py`` build recipe. Check for lines like:: + Requires-Python: >=3.5,<4 Requires-Dist: azureml-core (~=1.11.0) Requires-Dist: azureml-dataset-runtime[fuse] (~=1.11.0) Requires-Dist: azureml-train (~=1.11.0) @@ -572,62 +355,58 @@ check the ``METADATA`` file for lines like:: Requires-Dist: azureml-train-automl (~=1.11.0); extra == 'automl' -Lines that use ``Requires-Dist`` are similar to ``install_requires``. -Lines that use ``Provides-Extra`` are similar to ``extra_requires``, -and you can add a variant for those dependencies. The ``~=1.11.0`` -syntax is equivalent to ``1.11.0:1.11``. - -"""""""""" -setuptools -"""""""""" - -Setuptools is a bit of a special case. If a package requires setuptools -at run-time, how do they express this? They could add it to -``install_requires``, but setuptools is imported long before this and is -needed to read this line. And since you can't install the package -without setuptools, the developers assume that setuptools will already -be there, so they never mention when it is required. We don't want to -add run-time dependencies if they aren't needed, so you need to -determine whether or not setuptools is needed. Grep the installation -directory for any files containing a reference to ``setuptools`` or -``pkg_resources``. Both modules come from ``py-setuptools``. -``pkg_resources`` is particularly common in scripts found in -``prefix/bin``. +``Requires-Python`` is equivalent to ``python_requires`` and +``Requires-Dist`` is equivalent to ``install_requires``. +``Provides-Extra`` is used to name optional features (variants) and +a ``Requires-Dist`` with ``extra == 'foo'`` will list any +dependencies needed for that feature. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Passing arguments to setup.py ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The default build and install phases should be sufficient to install -most packages. However, you may want to pass additional flags to -either phase. +The default install phase should be sufficient to install most +packages. However, the installation instructions for a package may +suggest passing certain flags to the ``setup.py`` call. The +``PythonPackage`` class has two techniques for doing this. -You can view the available options for a particular phase with: +"""""""""""""" +Global options +"""""""""""""" -.. code-block:: console +These flags are added directly after ``setup.py`` when pip runs +``python setup.py install``. For example, the ``py-pyyaml`` package +has an optional dependency on ``libyaml`` that can be enabled like so: - $ python setup.py --help +.. code-block:: python + def global_options(self, spec, prefix): + options = [] + if '+libyaml' in spec: + options.append('--with-libyaml') + else: + options.append('--without-libyaml') + return options -Each phase provides a ```` function that can be used to -pass arguments to that phase. For example, -`py-numpy `_ -adds: -.. code-block:: python +""""""""""""""" +Install options +""""""""""""""" - def build_args(self, spec, prefix): - args = [] +These flags are added directly after ``install`` when pip runs +``python setup.py install``. For example, the ``py-pyyaml`` package +allows you to specify the directories to search for ``libyaml``: - # From NumPy 1.10.0 on it's possible to do a parallel build. - if self.version >= Version('1.10.0'): - # But Parallel build in Python 3.5+ is broken. See: - # https://github.com/spack/spack/issues/7927 - # https://github.com/scipy/scipy/issues/7112 - if spec['python'].version < Version('3.5'): - args = ['-j', str(make_jobs)] +.. code-block:: python - return args + def install_options(self, spec, prefix): + options = [] + if '+libyaml' in spec: + options.extend([ + spec['libyaml'].libs.search_flags, + spec['libyaml'].headers.include_flags, + ]) + return options ^^^^^^^ @@ -669,9 +448,9 @@ a "package" is a directory containing files like: whereas a "module" is a single Python file. -The ``PythonPackage`` base class automatically detects these module -names for you. If, for whatever reason, the module names detected -are wrong, you can provide the names yourself by overriding +The ``PythonPackage`` base class automatically detects these package +and module names for you. If, for whatever reason, the module names +detected are wrong, you can provide the names yourself by overriding ``import_modules`` like so: .. code-block:: python @@ -692,10 +471,8 @@ This can be expressed like so: @property def import_modules(self): modules = ['yaml'] - if '+libyaml' in self.spec: modules.append('yaml.cyaml') - return modules @@ -713,8 +490,8 @@ Unit tests """""""""" The package may have its own unit or regression tests. Spack can -run these tests during the installation by adding phase-appropriate -test methods. +run these tests during the installation by adding test methods after +installation. For example, ``py-numpy`` adds the following as a check to run after the ``install`` phase: @@ -740,34 +517,14 @@ when testing is enabled during the installation (i.e., ``spack install Setup file in a sub-directory ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In order to be compatible with package managers like ``pip``, the package -is required to place its ``setup.py`` in the root of the tarball. However, -not every Python package cares about ``pip`` or PyPI. If you are installing -a package that is not hosted on PyPI, you may find that it places its -``setup.py`` in a sub-directory. To handle this, add the directory containing -``setup.py`` to the package like so: - -.. code-block:: python - - build_directory = 'source' - - -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Alternate names for setup.py -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -As previously mentioned, packages need to call their setup script ``setup.py`` -in order to be compatible with package managers like ``pip``. However, some -packages like -`py-meep `_ and -`py-adios `_ -come with multiple setup scripts, one for a serial build and another for a -parallel build. You can override the default name to use like so: +Many C/C++ libraries provide optional Python bindings in a +subdirectory. To tell pip which directory to build from, you can +override the ``build_directory`` attribute. For example, if a package +provides Python bindings in a ``python`` directory, you can use: .. code-block:: python - def setup_file(self): - return 'setup-mpi.py' if '+mpi' in self.spec else 'setup.py' + build_directory = 'python' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -781,10 +538,14 @@ on Python are not necessarily ``PythonPackage``'s. Choosing a build system """"""""""""""""""""""" -First of all, you need to select a build system. ``spack create`` usually -does this for you, but if for whatever reason you need to do this manually, -choose ``PythonPackage`` if and only if the package contains a ``setup.py`` -file. +First of all, you need to select a build system. ``spack create`` +usually does this for you, but if for whatever reason you need to do +this manually, choose ``PythonPackage`` if and only if the package +contains one of the following files: + +* ``pyproject.toml`` +* ``setup.py`` +* ``setup.cfg`` """"""""""""""""""""""" Choosing a package name @@ -857,10 +618,9 @@ having to add that module to ``PYTHONPATH``. When deciding between ``extends`` and ``depends_on``, the best rule of thumb is to check the installation prefix. If Python libraries are -installed to ``prefix/lib/python2.7/site-packages`` (where 2.7 is the -MAJOR.MINOR version of Python you used to install the package), then -you should use ``extends``. If Python libraries are installed elsewhere -or the only files that get installed reside in ``prefix/bin``, then +installed to ``/lib/pythonX.Y/site-packages``, then you +should use ``extends``. If Python libraries are installed elsewhere +or the only files that get installed reside in ``/bin``, then don't use ``extends``, as symlinking the package wouldn't be useful. ^^^^^^^^^^^^^^^^^^^^^ @@ -893,4 +653,17 @@ External documentation ^^^^^^^^^^^^^^^^^^^^^^ For more information on Python packaging, see: -https://packaging.python.org/ + +* https://packaging.python.org/ + +For more information on build and installation frontend tools, see: + +* pip: https://pip.pypa.io/ +* build: https://pypa-build.readthedocs.io/ +* installer: https://installer.readthedocs.io/ + +For more information on build backend tools, see: + +* setuptools: https://setuptools.pypa.io/ +* flit: https://flit.readthedocs.io/ +* poetry: https://python-poetry.org/ diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index ac98b972a7..326e140290 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -177,6 +177,7 @@ def clean_environment(): env.unset('OBJC_INCLUDE_PATH') env.unset('CMAKE_PREFIX_PATH') + env.unset('PYTHONPATH') # Affects GNU make, can e.g. indirectly inhibit enabling parallel build env.unset('MAKEFLAGS') @@ -525,9 +526,10 @@ def _set_variables_for_single_module(pkg, module): m.cmake = Executable('cmake') m.ctest = MakeExecutable('ctest', jobs) - # Standard CMake arguments + # Standard build system arguments m.std_cmake_args = spack.build_systems.cmake.CMakePackage._std_args(pkg) m.std_meson_args = spack.build_systems.meson.MesonPackage._std_args(pkg) + m.std_pip_args = spack.build_systems.python.PythonPackage._std_args(pkg) # Put spack compiler paths in module scope. link_dir = spack.paths.build_env_path diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py index 59fd057c6a..036ef52e4e 100644 --- a/lib/spack/spack/build_systems/python.py +++ b/lib/spack/spack/build_systems/python.py @@ -18,65 +18,19 @@ from llnl.util.filesystem import ( ) from llnl.util.lang import match_predicate -from spack.directives import extends +from spack.directives import depends_on, extends from spack.package import PackageBase, run_after class PythonPackage(PackageBase): - """Specialized class for packages that are built using Python - setup.py files - - This class provides the following phases that can be overridden: - - * build - * build_py - * build_ext - * build_clib - * build_scripts - * install - * install_lib - * install_headers - * install_scripts - * install_data - - These are all standard setup.py commands and can be found by running: - - .. code-block:: console - - $ python setup.py --help-commands - - By default, only the 'build' and 'install' phases are run, but if you - need to run more phases, simply modify your ``phases`` list like so: - - .. code-block:: python - - phases = ['build_ext', 'install', 'bdist'] - - Each phase provides a function that runs: - - .. code-block:: console - - $ python -s setup.py --no-user-cfg - - Each phase also has a function that can pass arguments to - this call. All of these functions are empty except for the ``install_args`` - function, which passes ``--prefix=/path/to/installation/directory``. - - If you need to run a phase which is not a standard setup.py command, - you'll need to define a function for it like so: - - .. code-block:: python - - def configure(self, spec, prefix): - self.setup_py('configure') - """ + """Specialized class for packages that are built using pip.""" #: Package name, version, and extension on PyPI pypi = None maintainers = ['adamjstewart'] # Default phases - phases = ['build', 'install'] + phases = ['install'] # To be used in UI queries that require to know which # build-system class we are using @@ -86,9 +40,39 @@ class PythonPackage(PackageBase): install_time_test_callbacks = ['test'] extends('python') + depends_on('py-pip', type='build') + # FIXME: technically wheel is only needed when building from source, not when + # installing a downloaded wheel, but I don't want to add wheel as a dep to every + # package manually + depends_on('py-wheel', type='build') py_namespace = None + @staticmethod + def _std_args(cls): + return [ + # Verbose + '-vvv', + # Disable prompting for input + '--no-input', + # Disable the cache + '--no-cache-dir', + # Don't check to see if pip is up-to-date + '--disable-pip-version-check', + # Install packages + 'install', + # Don't install package dependencies + '--no-deps', + # Overwrite existing packages + '--ignore-installed', + # Use env vars like PYTHONPATH + '--no-build-isolation', + # Don't warn that prefix.bin is not in PATH + '--no-warn-script-location', + # Ignore the PyPI package index + '--no-index', + ] + @property def homepage(self): if self.pypi: @@ -153,163 +137,45 @@ class PythonPackage(PackageBase): return modules - def setup_file(self): - """Returns the name of the setup file to use.""" - return 'setup.py' - @property def build_directory(self): - """The directory containing the ``setup.py`` file.""" - return self.stage.source_path - - def python(self, *args, **kwargs): - inspect.getmodule(self).python(*args, **kwargs) - - def setup_py(self, *args, **kwargs): - setup = self.setup_file() - - with working_dir(self.build_directory): - self.python('-s', setup, '--no-user-cfg', *args, **kwargs) - - # The following phases and their descriptions come from: - # $ python setup.py --help-commands - - # Standard commands - - def build(self, spec, prefix): - """Build everything needed to install.""" - args = self.build_args(spec, prefix) + """The root directory of the Python package. - self.setup_py('build', *args) + This is usually the directory containing one of the following files: - def build_args(self, spec, prefix): - """Arguments to pass to build.""" - return [] - - def build_py(self, spec, prefix): - '''"Build" pure Python modules (copy to build directory).''' - args = self.build_py_args(spec, prefix) - - self.setup_py('build_py', *args) - - def build_py_args(self, spec, prefix): - """Arguments to pass to build_py.""" - return [] - - def build_ext(self, spec, prefix): - """Build C/C++ extensions (compile/link to build directory).""" - args = self.build_ext_args(spec, prefix) - - self.setup_py('build_ext', *args) + * ``pyproject.toml`` + * ``setup.cfg`` + * ``setup.py`` + """ + return self.stage.source_path - def build_ext_args(self, spec, prefix): - """Arguments to pass to build_ext.""" + def install_options(self, spec, prefix): + """Extra arguments to be supplied to the setup.py install command.""" return [] - def build_clib(self, spec, prefix): - """Build C/C++ libraries used by Python extensions.""" - args = self.build_clib_args(spec, prefix) - - self.setup_py('build_clib', *args) - - def build_clib_args(self, spec, prefix): - """Arguments to pass to build_clib.""" - return [] - - def build_scripts(self, spec, prefix): - '''"Build" scripts (copy and fixup #! line).''' - args = self.build_scripts_args(spec, prefix) - - self.setup_py('build_scripts', *args) - - def build_scripts_args(self, spec, prefix): - """Arguments to pass to build_scripts.""" + def global_options(self, spec, prefix): + """Extra global options to be supplied to the setup.py call before the install + or bdist_wheel command.""" return [] def install(self, spec, prefix): """Install everything from build directory.""" - args = self.install_args(spec, prefix) - - self.setup_py('install', *args) - - def install_args(self, spec, prefix): - """Arguments to pass to install.""" - args = ['--prefix={0}'.format(prefix)] - - # This option causes python packages (including setuptools) NOT - # to create eggs or easy-install.pth files. Instead, they - # install naturally into $prefix/pythonX.Y/site-packages. - # - # Eggs add an extra level of indirection to sys.path, slowing - # down large HPC runs. They are also deprecated in favor of - # wheels, which use a normal layout when installed. - # - # Spack manages the package directory on its own by symlinking - # extensions into the site-packages directory, so we don't really - # need the .pth files or egg directories, anyway. - # - # We need to make sure this is only for build dependencies. A package - # such as py-basemap will not build properly with this flag since - # it does not use setuptools to build and those does not recognize - # the --single-version-externally-managed flag - if ('py-setuptools' == spec.name or # this is setuptools, or - 'py-setuptools' in spec._dependencies and # it's an immediate dep - 'build' in spec._dependencies['py-setuptools'].deptypes): - args += ['--single-version-externally-managed'] - - # Get all relative paths since we set the root to `prefix` - # We query the python with which these will be used for the lib and inc - # directories. This ensures we use `lib`/`lib64` as expected by python. - pkg = spec['python'].package - args += ['--root=%s' % prefix, - '--install-purelib=%s' % pkg.purelib, - '--install-platlib=%s' % pkg.platlib, - '--install-scripts=bin', - '--install-data=', - '--install-headers=%s' % pkg.include, - ] - - return args - - def install_lib(self, spec, prefix): - """Install all Python modules (extensions and pure Python).""" - args = self.install_lib_args(spec, prefix) - - self.setup_py('install_lib', *args) - - def install_lib_args(self, spec, prefix): - """Arguments to pass to install_lib.""" - return [] - - def install_headers(self, spec, prefix): - """Install C/C++ header files.""" - args = self.install_headers_args(spec, prefix) - - self.setup_py('install_headers', *args) - - def install_headers_args(self, spec, prefix): - """Arguments to pass to install_headers.""" - return [] - - def install_scripts(self, spec, prefix): - """Install scripts (Python or otherwise).""" - args = self.install_scripts_args(spec, prefix) - - self.setup_py('install_scripts', *args) - def install_scripts_args(self, spec, prefix): - """Arguments to pass to install_scripts.""" - return [] + args = PythonPackage._std_args(self) + ['--prefix=' + prefix] - def install_data(self, spec, prefix): - """Install data files.""" - args = self.install_data_args(spec, prefix) + for option in self.install_options(spec, prefix): + args.append('--install-option=' + option) + for option in self.global_options(spec, prefix): + args.append('--global-option=' + option) - self.setup_py('install_data', *args) + if self.stage.archive_file and self.stage.archive_file.endswith('.whl'): + args.append(self.stage.archive_file) + else: + args.append('.') - def install_data_args(self, spec, prefix): - """Arguments to pass to install_data.""" - return [] + pip = inspect.getmodule(self).pip + with working_dir(self.build_directory): + pip(*args) # Testing diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index baeccc513e..cc9fffa0c2 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -263,19 +263,34 @@ class PythonPackageTemplate(PackageTemplate): base_class_name = 'PythonPackage' dependencies = """\ - # FIXME: Add dependencies if required. Only add the python dependency - # if you need specific versions. A generic python dependency is - # added implicity by the PythonPackage class. + # FIXME: Only add the python/pip/wheel dependencies if you need specific versions + # or need to change the dependency type. Generic python/pip/wheel dependencies are + # added implicity by the PythonPackage base class. # depends_on('python@2.X:2.Y,3.Z:', type=('build', 'run')) + # depends_on('py-pip@X.Y:', type='build') + # depends_on('py-wheel@X.Y:', type='build') + + # FIXME: Add a build backend, usually defined in pyproject.toml. If no such file + # exists, use setuptools. # depends_on('py-setuptools', type='build') - # depends_on('py-foo', type=('build', 'run'))""" + # depends_on('py-flit-core', type='build') + # depends_on('py-poetry-core', type='build') + + # FIXME: Add additional dependencies if required. + # depends_on('py-foo', type=('build', 'run'))""" body_def = """\ - def build_args(self, spec, prefix): - # FIXME: Add arguments other than --prefix - # FIXME: If not needed delete this function - args = [] - return args""" + def global_options(self, spec, prefix): + # FIXME: Add options to pass to setup.py + # FIXME: If not needed, delete this function + options = [] + return options + + def install_options(self, spec, prefix): + # FIXME: Add options to pass to setup.py install + # FIXME: If not needed, delete this function + options = [] + return options""" def __init__(self, name, url, *args, **kwargs): # If the user provided `--name py-numpy`, don't rename it py-py-numpy @@ -298,24 +313,32 @@ class PythonPackageTemplate(PackageTemplate): # e.g. https://files.pythonhosted.org/packages/c5/63/a48648ebc57711348420670bb074998f79828291f68aebfff1642be212ec/numpy-1.19.4.zip # e.g. https://files.pythonhosted.org/packages/c5/63/a48648ebc57711348420670bb074998f79828291f68aebfff1642be212ec/numpy-1.19.4.zip#sha256=141ec3a3300ab89c7f2b0775289954d193cc8edb621ea05f99db9cb181530512 - # PyPI URLs for wheels are too complicated, ignore them for now + # PyPI URLs for wheels: + # https://pypi.io/packages/py3/a/azureml_core/azureml_core-1.11.0-py3-none-any.whl + # https://pypi.io/packages/py3/d/dotnetcore2/dotnetcore2-2.1.14-py3-none-macosx_10_9_x86_64.whl + # https://pypi.io/packages/py3/d/dotnetcore2/dotnetcore2-2.1.14-py3-none-manylinux1_x86_64.whl + # https://files.pythonhosted.org/packages/cp35.cp36.cp37.cp38.cp39/s/shiboken2/shiboken2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl + # https://files.pythonhosted.org/packages/f4/99/ad2ef1aeeb395ee2319bb981ea08dbbae878d30dd28ebf27e401430ae77a/azureml_core-1.36.0.post2-py3-none-any.whl#sha256=60bcad10b4380d78a8280deb7365de2c2cd66527aacdcb4a173f613876cbe739 match = re.search( r'(?:pypi|pythonhosted)[^/]+/packages' + '/([^/#]+)' * 4, url ) if match: - if len(match.group(2)) == 1: - # Simple PyPI URL - url = '/'.join(match.group(3, 4)) - else: - # PyPI URL containing hash - # Project name doesn't necessarily match download name, but it - # usually does, so this is the best we can do - project = parse_name(url) - url = '/'.join([project, match.group(4)]) - - self.url_line = ' pypi = "{url}"' + # PyPI URLs for wheels are too complicated, ignore them for now + # https://www.python.org/dev/peps/pep-0427/#file-name-convention + if not match.group(4).endswith('.whl'): + if len(match.group(2)) == 1: + # Simple PyPI URL + url = '/'.join(match.group(3, 4)) + else: + # PyPI URL containing hash + # Project name doesn't necessarily match download name, but it + # usually does, so this is the best we can do + project = parse_name(url) + url = '/'.join([project, match.group(4)]) + + self.url_line = ' pypi = "{url}"' else: # Add a reminder about spack preferring PyPI URLs self.url_line = ''' @@ -581,6 +604,9 @@ class BuildSystemGuesser: if url.endswith('.gem'): self.build_system = 'ruby' return + if url.endswith('.whl') or '.whl#' in url: + self.build_system = 'python' + return # A list of clues that give us an idea of the build system a package # uses. If the regular expression matches a file contained in the @@ -596,7 +622,8 @@ class BuildSystemGuesser: (r'/pom\.xml$', 'maven'), (r'/SConstruct$', 'scons'), (r'/waf$', 'waf'), - (r'/setup\.py$', 'python'), + (r'/pyproject.toml', 'python'), + (r'/setup\.(py|cfg)$', 'python'), (r'/WORKSPACE$', 'bazel'), (r'/Build\.PL$', 'perlbuild'), (r'/Makefile\.PL$', 'perlmake'), diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index b447867727..3e01c56374 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -897,6 +897,10 @@ def get_checksums_for_versions(url_dict, name, **kwargs): i = 0 errors = [] for url, version in zip(urls, versions): + # Wheels should not be expanded during staging + expand_arg = '' + if url.endswith('.whl') or '.whl#' in url: + expand_arg = ', expand=False' try: if fetch_options: url_or_fs = fs.URLFetchStrategy( @@ -931,8 +935,8 @@ def get_checksums_for_versions(url_dict, name, **kwargs): # Generate the version directives to put in a package.py version_lines = "\n".join([ - " version('{0}', {1}sha256='{2}')".format( - v, ' ' * (max_len - len(str(v))), h) for v, h in version_hashes + " version('{0}', {1}sha256='{2}'{3})".format( + v, ' ' * (max_len - len(str(v))), h, expand_arg) for v, h in version_hashes ]) num_hash = len(version_hashes) diff --git a/lib/spack/spack/test/cmd/create.py b/lib/spack/spack/test/cmd/create.py index 896d8e1fe1..08854bda3b 100644 --- a/lib/spack/spack/test/cmd/create.py +++ b/lib/spack/spack/test/cmd/create.py @@ -63,7 +63,7 @@ def parser(): r'def configure_args(self']), (['-t', 'python', 'test-python'], 'py-test-python', [r'PyTestPython(PythonPackage)', r"depends_on('py-", - r'def build_args(self']), + r'def global_options(self', r'def install_options(self']), (['-t', 'qmake', 'test-qmake'], 'test-qmake', [r'TestQmake(QMakePackage)', r'def qmake_args(self']), (['-t', 'r', 'test-r'], 'r-test-r', diff --git a/var/spack/repos/builtin.mock/packages/py-pip/package.py b/var/spack/repos/builtin.mock/packages/py-pip/package.py new file mode 100644 index 0000000000..7cd2416d22 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/py-pip/package.py @@ -0,0 +1,15 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPip(Package): + """Only needed because other mock packages use PythonPackage""" + + homepage = "http://www.example.com" + url = "http://www.example.com/pip-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') diff --git a/var/spack/repos/builtin.mock/packages/py-wheel/package.py b/var/spack/repos/builtin.mock/packages/py-wheel/package.py new file mode 100644 index 0000000000..75c8b87734 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/py-wheel/package.py @@ -0,0 +1,15 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyWheel(Package): + """Only needed because other mock packages use PythonPackage""" + + homepage = "http://www.example.com" + url = "http://www.example.com/wheel-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') diff --git a/var/spack/repos/builtin/packages/aws-parallelcluster/package.py b/var/spack/repos/builtin/packages/aws-parallelcluster/package.py index 76cb3aa0e0..0af127b3d7 100644 --- a/var/spack/repos/builtin/packages/aws-parallelcluster/package.py +++ b/var/spack/repos/builtin/packages/aws-parallelcluster/package.py @@ -66,7 +66,7 @@ class AwsParallelcluster(PythonPackage): depends_on('py-boto3@1.14.3:', when='@2.8:2.9', type=('build', 'run')) depends_on('py-boto3@1.10.15:', when='@:2.7', type=('build', 'run')) - depends_on('py-setuptools', when='@2.6:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) depends_on('py-enum34@1.1.6:', when='^python@:3.3', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/busco/package.py b/var/spack/repos/builtin/packages/busco/package.py index e4124072d3..81605a37da 100644 --- a/var/spack/repos/builtin/packages/busco/package.py +++ b/var/spack/repos/builtin/packages/busco/package.py @@ -24,31 +24,27 @@ class Busco(PythonPackage): version('3.0.1', commit='078252e00399550d7b0e8941cd4d986c8e868a83') version('2.0.1', sha256='bd72a79b880370e9b61b8c722e171818c7c85d46cc1e2f80595df2738a7e220c') - depends_on('python', type=('build', 'run')) + # https://busco.ezlab.org/busco_userguide.html#manual-installation + depends_on('python@3.3:', when='@4:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', when='@3:', type='build') depends_on('blast-plus') depends_on('hmmer') depends_on('augustus') - depends_on('py-biopython', when='@4.1.3', type=('build', 'run')) - def build(self, spec, prefix): - if self.spec.satisfies('@2.0.1'): - pass - def install(self, spec, prefix): if self.spec.satisfies('@4.1.3'): install_tree('bin', prefix.bin) install_tree('config', prefix.config) - args = self.install_args(spec, prefix) - self.setup_py('install', *args) + super(self, PythonPackage).install(spec, prefix) if self.spec.satisfies('@3.0.1'): with working_dir('scripts'): mkdirp(prefix.bin) install('generate_plot.py', prefix.bin) install('run_BUSCO.py', prefix.bin) install_tree('config', prefix.config) - args = self.install_args(spec, prefix) - self.setup_py('install', *args) + super(self, PythonPackage).install(spec, prefix) if self.spec.satisfies('@2.0.1'): mkdirp(prefix.bin) install('BUSCO.py', prefix.bin) diff --git a/var/spack/repos/builtin/packages/cmor/package.py b/var/spack/repos/builtin/packages/cmor/package.py index d375adc6c5..48cf99afb9 100644 --- a/var/spack/repos/builtin/packages/cmor/package.py +++ b/var/spack/repos/builtin/packages/cmor/package.py @@ -37,7 +37,9 @@ class Cmor(AutotoolsPackage): depends_on('udunits') extends('python', when='+python') - depends_on('python@:2', when='@:3.3 +python') + depends_on('python@:2', when='@:3.3 +python', type=('build', 'run')) + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') depends_on('py-numpy', type=('build', 'run'), when='+python') @run_before('configure') @@ -67,4 +69,5 @@ class Cmor(AutotoolsPackage): make('install') if '+python' in spec: - setup_py('install', '--prefix=' + prefix) + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) diff --git a/var/spack/repos/builtin/packages/codar-cheetah/package.py b/var/spack/repos/builtin/packages/codar-cheetah/package.py index ce7c475993..24323f3626 100644 --- a/var/spack/repos/builtin/packages/codar-cheetah/package.py +++ b/var/spack/repos/builtin/packages/codar-cheetah/package.py @@ -23,3 +23,4 @@ class CodarCheetah(PythonPackage): version('0.5', sha256='f37a554741eff4bb8407a68f799dd042dfc4df525e84896cad70fccbd6aca6ee') depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/easybuild/package.py b/var/spack/repos/builtin/packages/easybuild/package.py index 87eca0acfa..f5ecf52513 100644 --- a/var/spack/repos/builtin/packages/easybuild/package.py +++ b/var/spack/repos/builtin/packages/easybuild/package.py @@ -20,6 +20,8 @@ class Easybuild(PythonPackage): depends_on('python@2.6:2.8', when='@:3', type=('build', 'run')) depends_on('python@2.6:2.8,3.5:', when='@4:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') for v in ['@4.0.0', '@3.1.2']: depends_on('py-easybuild-framework' + v, when=v, type='run') diff --git a/var/spack/repos/builtin/packages/faiss/package.py b/var/spack/repos/builtin/packages/faiss/package.py index 662fe1677f..0c45b97416 100644 --- a/var/spack/repos/builtin/packages/faiss/package.py +++ b/var/spack/repos/builtin/packages/faiss/package.py @@ -33,6 +33,8 @@ class Faiss(AutotoolsPackage, CudaPackage): conflicts('+tests', when='~python', msg='+tests must be accompanied by +python') depends_on('python@3.7:', when='+python', type=('build', 'run')) + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') depends_on('py-numpy', when='+python', type=('build', 'run')) depends_on('py-scipy', when='+tests', type=('build', 'run')) @@ -85,8 +87,8 @@ class Faiss(AutotoolsPackage, CudaPackage): if '+python' in self.spec: with working_dir('python'): - setup_py('install', '--prefix=' + prefix, - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) if '+tests' not in self.spec: return diff --git a/var/spack/repos/builtin/packages/fenics/package.py b/var/spack/repos/builtin/packages/fenics/package.py index a58350b653..ce3fb731e0 100644 --- a/var/spack/repos/builtin/packages/fenics/package.py +++ b/var/spack/repos/builtin/packages/fenics/package.py @@ -117,6 +117,8 @@ class Fenics(CMakePackage): depends_on('py-pybind11@2.2.4', type=('build', 'run')) depends_on('cmake@3.17.3:', type='build') + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') depends_on('py-setuptools', type='build', when='+python') depends_on('py-pkgconfig', type=('build', 'run'), when='+python') depends_on('py-sphinx@1.0.1:', when='+doc', type='build') @@ -164,5 +166,5 @@ class Fenics(CMakePackage): def install_python_interface(self): if '+python' in self.spec: with working_dir('python'): - setup_py('install', '--single-version-externally-managed', - '--root=/', '--prefix={0}'.format(self.prefix)) + args = std_pip_args + ['--prefix=' + self.prefix, '.'] + pip(*args) diff --git a/var/spack/repos/builtin/packages/flatbuffers/package.py b/var/spack/repos/builtin/packages/flatbuffers/package.py index 3c4e464727..641e8ce0a1 100644 --- a/var/spack/repos/builtin/packages/flatbuffers/package.py +++ b/var/spack/repos/builtin/packages/flatbuffers/package.py @@ -24,9 +24,11 @@ class Flatbuffers(CMakePackage): variant('python', default=False, description='Build with python support') - depends_on('py-setuptools', when='+python', type='build') - depends_on('python@3.6:', when='+python', type=('build', 'run')) extends('python', when='+python') + depends_on('python@3.6:', when='+python', type=('build', 'run')) + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') + depends_on('py-setuptools', when='+python', type='build') # Fixes "Class-memaccess" compilation error in test # https://github.com/google/flatbuffers/issues/5930 @@ -49,8 +51,8 @@ class Flatbuffers(CMakePackage): if '+python' in self.spec: pydir = join_path(self.stage.source_path, 'python') with working_dir(pydir): - setup_py('install', '--prefix=' + prefix, - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + self.prefix, '.'] + pip(*args) def cmake_args(self): args = [] diff --git a/var/spack/repos/builtin/packages/flux-core/package.py b/var/spack/repos/builtin/packages/flux-core/package.py index 5423bc0d2f..1af75cba3d 100644 --- a/var/spack/repos/builtin/packages/flux-core/package.py +++ b/var/spack/repos/builtin/packages/flux-core/package.py @@ -57,11 +57,12 @@ class FluxCore(AutotoolsPackage): depends_on("lua@5.1:5.3", when="@0.18.0:,master") depends_on("lua-luaposix") # `link` dependency on python due to Flux's `pymod` module - depends_on("python@3.6:", type=('build', 'run', 'link')) - depends_on("py-cffi", type=('build', 'run')) - depends_on("py-six", type=('build', 'run')) - depends_on("py-pyyaml") - depends_on("py-jsonschema") + depends_on("python@3.6:", when='@0.17:', type=('build', 'link', 'run')) + depends_on("python@2.7:", type=('build', 'link', 'run')) + depends_on("py-cffi@1.1:", type=('build', 'run')) + depends_on("py-six@1.9:", when='@:0.24', type=('build', 'run')) + depends_on("py-pyyaml@3.10:", type=('build', 'run')) + depends_on("py-jsonschema@2.3:", type=('build', 'run')) depends_on("jansson") depends_on("jansson@2.10:", when="@0.21.0:") depends_on("pkgconfig") diff --git a/var/spack/repos/builtin/packages/flux-sched/package.py b/var/spack/repos/builtin/packages/flux-sched/package.py index de1b370258..9af703ac80 100644 --- a/var/spack/repos/builtin/packages/flux-sched/package.py +++ b/var/spack/repos/builtin/packages/flux-sched/package.py @@ -40,7 +40,8 @@ class FluxSched(AutotoolsPackage): variant('cuda', default=False, description='Build dependencies with support for CUDA') depends_on("boost+graph@1.53.0,1.59.0:") - depends_on("py-pyyaml") + depends_on("py-pyyaml@3.10:", type=('build', 'run')) + depends_on("py-jsonschema@2.3:", type=('build', 'run')) depends_on("libedit") depends_on("libxml2@2.9.1:") # pin yaml-cpp to 0.6.3 due to issue #886 diff --git a/var/spack/repos/builtin/packages/gatetools/package.py b/var/spack/repos/builtin/packages/gatetools/package.py index 5d85d37a28..84456dea13 100644 --- a/var/spack/repos/builtin/packages/gatetools/package.py +++ b/var/spack/repos/builtin/packages/gatetools/package.py @@ -31,6 +31,6 @@ class Gatetools(PythonPackage): depends_on('gate+rtk', type='run') # The readme.md file is not in the distribution, so fake it. - @run_before('build') + @run_before('install') def readme(self): touch('readme.md') diff --git a/var/spack/repos/builtin/packages/gurobi/package.py b/var/spack/repos/builtin/packages/gurobi/package.py index 132b9b4ed8..f4ab16e5ea 100644 --- a/var/spack/repos/builtin/packages/gurobi/package.py +++ b/var/spack/repos/builtin/packages/gurobi/package.py @@ -35,7 +35,9 @@ class Gurobi(Package): license_url = 'http://www.gurobi.com/downloads/download-center' extends('python') - depends_on('python@2.7,3.6:') + depends_on('python@2.7,3.6:', type=('build', 'run')) + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') def url_for_version(self, version): return "file://{0}/gurobi{1}_linux64.tar.gz".format(os.getcwd(), version) @@ -56,5 +58,5 @@ class Gurobi(Package): @run_after('install') def gurobipy(self): with working_dir('linux64'): - python = which('python') - python('setup.py', 'install', '--prefix={0}'.format(self.prefix)) + args = std_pip_args + ['--prefix=' + self.prefix, '.'] + pip(*args) diff --git a/var/spack/repos/builtin/packages/kitty/package.py b/var/spack/repos/builtin/packages/kitty/package.py index 7086f8cd47..c0f8ca7328 100644 --- a/var/spack/repos/builtin/packages/kitty/package.py +++ b/var/spack/repos/builtin/packages/kitty/package.py @@ -8,7 +8,9 @@ import sys from spack import * -class Kitty(PythonPackage): +# NOTE: This package uses a setup.py file, but does not use distutils/setuptools or any +# other known build system, so this is a custom package +class Kitty(Package): """ fast, featureful, cross-platform, GPU-based terminal emulator """ @@ -48,11 +50,7 @@ class Kitty(PythonPackage): depends_on('dbus', when=sys.platform != 'darwin') depends_on('xkeyboard-config', when=sys.platform != 'darwin') - phases = ['install'] - def install(self, spec, prefix): - # kitty's setup.py does not recognize the '--no-user-cfg' flag that is - # used by default in the setup_py method, overriding that behavior here with working_dir(self.build_directory): self.python('-s', 'setup.py', 'linux-package', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/memsurfer/package.py b/var/spack/repos/builtin/packages/memsurfer/package.py index c204f3a168..e389ac548a 100644 --- a/var/spack/repos/builtin/packages/memsurfer/package.py +++ b/var/spack/repos/builtin/packages/memsurfer/package.py @@ -24,6 +24,7 @@ class Memsurfer(PythonPackage): extends('python') depends_on('python@3.7:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('cmake@3.14:', type='build') depends_on('swig@3.0.12', type='build') diff --git a/var/spack/repos/builtin/packages/mercurial/package.py b/var/spack/repos/builtin/packages/mercurial/package.py index 90f0b979b0..4dbf57faf4 100644 --- a/var/spack/repos/builtin/packages/mercurial/package.py +++ b/var/spack/repos/builtin/packages/mercurial/package.py @@ -33,7 +33,7 @@ class Mercurial(PythonPackage): depends_on('python+bz2+ssl+zlib@2.6:2.8', when='@:4.2', type=('build', 'run')) depends_on('python+bz2+ssl+zlib@2.7:2.8,3.5.3:3.5,3.6.2:', when='@4.3:', type=('build', 'run')) - depends_on('py-setuptools', when='@3.6:', type='build') + depends_on('py-setuptools', type='build') depends_on('py-docutils', type='build') depends_on('py-pygments', type=('build', 'run')) depends_on('py-certifi', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/minimap2/package.py b/var/spack/repos/builtin/packages/minimap2/package.py index 388371d17d..4583fa75d2 100644 --- a/var/spack/repos/builtin/packages/minimap2/package.py +++ b/var/spack/repos/builtin/packages/minimap2/package.py @@ -20,6 +20,7 @@ class Minimap2(PythonPackage): conflicts('target=aarch64:', when='@:2.10') depends_on('zlib', type='link') + depends_on('py-setuptools', type='build') depends_on('py-cython', type='build') @run_after('install') diff --git a/var/spack/repos/builtin/packages/mxnet/package.py b/var/spack/repos/builtin/packages/mxnet/package.py index 9bb880ba02..bbff276328 100644 --- a/var/spack/repos/builtin/packages/mxnet/package.py +++ b/var/spack/repos/builtin/packages/mxnet/package.py @@ -71,6 +71,8 @@ class Mxnet(CMakePackage, CudaPackage): extends('python', when='+python') depends_on('python@2.7:2.8,3.4:', when='@:1.8.0+python', type=('build', 'run')) depends_on('python@3.6:', when='@2.0.0:+python', type=('build', 'run')) + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') depends_on('py-contextvars', when='@2.0.0:+python ^python@3.6.0:3.6', type=('build', 'run')) depends_on('py-setuptools', when='+python', type='build') depends_on('py-cython', when='+python', type='build') @@ -128,18 +130,12 @@ class Mxnet(CMakePackage, CudaPackage): return args - @run_after('build') - def build_python(self): - if '+python' in self.spec: - with working_dir('python'): - setup_py('build') - @run_after('install') def install_python(self): if '+python' in self.spec: with working_dir('python'): - setup_py('install', '--prefix={0}'.format(self.prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) def test(self): """Attempts to import modules of the installed package.""" diff --git a/var/spack/repos/builtin/packages/nnpack/package.py b/var/spack/repos/builtin/packages/nnpack/package.py index 75e2b53379..7848cf51dd 100644 --- a/var/spack/repos/builtin/packages/nnpack/package.py +++ b/var/spack/repos/builtin/packages/nnpack/package.py @@ -95,7 +95,7 @@ class Nnpack(CMakePackage): def generate_peachpy(self): # https://github.com/Maratyszcza/NNPACK/issues/203 with working_dir(join_path(self.stage.source_path, 'deps', 'peachpy')): - setup_py('generate') + python('setup.py', 'generate') def cmake_args(self): return [ diff --git a/var/spack/repos/builtin/packages/ont-albacore/package.py b/var/spack/repos/builtin/packages/ont-albacore/package.py index 494a103b18..e144485b63 100644 --- a/var/spack/repos/builtin/packages/ont-albacore/package.py +++ b/var/spack/repos/builtin/packages/ont-albacore/package.py @@ -6,7 +6,7 @@ from spack import * -class OntAlbacore(Package): +class OntAlbacore(PythonPackage): """Albacore is a software project that provides an entry point to the Oxford Nanopore basecalling algorithms. It can be run from the command line on Windows and multiple Linux platforms. A selection of configuration files @@ -18,16 +18,9 @@ class OntAlbacore(Package): version('2.3.1', sha256='dc1af11b0f38b26d071e5389c2b4595c496319c987401754e1853de42467a7d1', expand=False, deprecated=True) - extends('python') - depends_on('python@3.5.0:3.5', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run')) depends_on('py-numpy@1.13.0', type=('build', 'run')) depends_on('py-python-dateutil', type=('build', 'run')) depends_on('py-h5py', type=('build', 'run')) depends_on('py-ont-fast5-api', type=('build', 'run')) - depends_on('py-pip', type=('build')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/phyluce/package.py b/var/spack/repos/builtin/packages/phyluce/package.py index cd23147bf8..3caec30e12 100644 --- a/var/spack/repos/builtin/packages/phyluce/package.py +++ b/var/spack/repos/builtin/packages/phyluce/package.py @@ -38,7 +38,3 @@ class Phyluce(PythonPackage): depends_on('trimal', type='run') depends_on('trinity', type='run') depends_on('velvet', type='run') - - def install(self, spec, prefix): - python = which('python') - python('setup.py', 'install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-3to2/package.py b/var/spack/repos/builtin/packages/py-3to2/package.py index 4ac91215fd..3fd6f7c3de 100644 --- a/var/spack/repos/builtin/packages/py-3to2/package.py +++ b/var/spack/repos/builtin/packages/py-3to2/package.py @@ -13,3 +13,6 @@ class Py3to2(PythonPackage): pypi = "3to2/3to2-1.1.1.zip" version('1.1.1', sha256='fef50b2b881ef743f269946e1090b77567b71bb9a9ce64b7f8e699b562ff685c') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-4suite-xml/package.py b/var/spack/repos/builtin/packages/py-4suite-xml/package.py index 60ce3b0fba..d9e7c40fce 100644 --- a/var/spack/repos/builtin/packages/py-4suite-xml/package.py +++ b/var/spack/repos/builtin/packages/py-4suite-xml/package.py @@ -15,4 +15,6 @@ class Py4suiteXml(PythonPackage): version('1.0.2', sha256='f0c24132eb2567e64b33568abff29a780a2f0236154074d0b8f5262ce89d8c03') - depends_on('python@2.2.1:') + depends_on('python@2.2.1:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-abipy/package.py b/var/spack/repos/builtin/packages/py-abipy/package.py index f9b1d517c3..b3c9162b29 100644 --- a/var/spack/repos/builtin/packages/py-abipy/package.py +++ b/var/spack/repos/builtin/packages/py-abipy/package.py @@ -49,7 +49,7 @@ class PyAbipy(PythonPackage): depends_on('py-jupyter', type=('build', 'run'), when='+ipython') depends_on('py-nbformat', type=('build', 'run'), when='+ipython') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] if '+ipython' in spec: diff --git a/var/spack/repos/builtin/packages/py-accimage/package.py b/var/spack/repos/builtin/packages/py-accimage/package.py index 1006c946f9..b39e328a20 100644 --- a/var/spack/repos/builtin/packages/py-accimage/package.py +++ b/var/spack/repos/builtin/packages/py-accimage/package.py @@ -16,13 +16,15 @@ class PyAccimage(PythonPackage): version('0.1.1', sha256='573c56866a42683c7cf25185620fe82ec2ce78468e0621c29fac8f4134a785f5') depends_on('python', type=('build', 'link', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('jpeg') depends_on('ipp') depends_on('py-pytest', type='test') depends_on('py-numpy', type='test') depends_on('py-imageio', type='test') - @run_after('build') + @run_after('install') @on_package_attributes(run_tests=True) def build_test(self): pytest = which('pytest') diff --git a/var/spack/repos/builtin/packages/py-adios/package.py b/var/spack/repos/builtin/packages/py-adios/package.py index ef60055d09..36858de959 100644 --- a/var/spack/repos/builtin/packages/py-adios/package.py +++ b/var/spack/repos/builtin/packages/py-adios/package.py @@ -44,22 +44,22 @@ class PyAdios(PythonPackage): when='@{0} +mpi'.format(v), type=['build', 'link', 'run']) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=['build', 'run']) depends_on('mpi', when='+mpi') depends_on('py-mpi4py', type=['run'], when='+mpi') depends_on('py-cython', type=['build']) - phases = ['build_clib', 'install'] build_directory = 'wrappers/numpy' - def setup_file(self): - """Returns the name of the setup file to use.""" + def patch(self): if '+mpi' in self.spec: - return 'setup_mpi.py' - else: - return 'setup.py' + with working_dir(self.build_directory): + copy('setup_mpi.py', 'setup.py') - def build_clib(self, spec, prefix): + @run_before('install') + def build_clib(self): # calls: make CYTHON=y [MPI=y] python args = ['CYTHON=y'] if '+mpi' in self.spec: diff --git a/var/spack/repos/builtin/packages/py-aioitertools/package.py b/var/spack/repos/builtin/packages/py-aioitertools/package.py index 39484caaef..fd740d640e 100644 --- a/var/spack/repos/builtin/packages/py-aioitertools/package.py +++ b/var/spack/repos/builtin/packages/py-aioitertools/package.py @@ -17,4 +17,5 @@ class PyAioitertools(PythonPackage): version('0.7.1', sha256='54a56c7cf3b5290d1cb5e8974353c9f52c677612b5d69a859369a020c53414a3') depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-flit-core@2:3', type='build') depends_on('py-typing-extensions@3.7:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-appnope/package.py b/var/spack/repos/builtin/packages/py-appnope/package.py index 977942a7ba..eaccfd58e5 100644 --- a/var/spack/repos/builtin/packages/py-appnope/package.py +++ b/var/spack/repos/builtin/packages/py-appnope/package.py @@ -13,3 +13,6 @@ class PyAppnope(PythonPackage): pypi = "appnope/appnope-0.1.0.tar.gz" version('0.1.0', sha256='8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-arcgis/package.py b/var/spack/repos/builtin/packages/py-arcgis/package.py index fbe3a26680..d7fa03474f 100644 --- a/var/spack/repos/builtin/packages/py-arcgis/package.py +++ b/var/spack/repos/builtin/packages/py-arcgis/package.py @@ -32,5 +32,5 @@ class PyArcgis(PythonPackage): depends_on('py-requests-toolbelt', type=('build', 'run')) depends_on('py-requests-ntlm', type=('build', 'run')) - def setup_py(self, *args, **kwargs): - super(PyArcgis, self).setup_py('--conda-install-mode', *args, **kwargs) + def global_options(self, spec, prefix): + return ['--conda-install-mode'] diff --git a/var/spack/repos/builtin/packages/py-astropy/package.py b/var/spack/repos/builtin/packages/py-astropy/package.py index adbc56cada..987dfedef0 100644 --- a/var/spack/repos/builtin/packages/py-astropy/package.py +++ b/var/spack/repos/builtin/packages/py-astropy/package.py @@ -72,7 +72,7 @@ class PyAstropy(PythonPackage): # cython-ized files os.remove('astropy/cython_version.py') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [ '--use-system-libraries', '--use-system-erfa', diff --git a/var/spack/repos/builtin/packages/py-azureml-automl-core/package.py b/var/spack/repos/builtin/packages/py-azureml-automl-core/package.py index f139559c96..27a2dcd955 100644 --- a/var/spack/repos/builtin/packages/py-azureml-automl-core/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-automl-core/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlAutomlCore(Package): +class PyAzuremlAutomlCore(PythonPackage): """The azureml-automl-core package is a package containing functionality used by the azureml-train-automl package.""" @@ -15,9 +15,7 @@ class PyAzuremlAutomlCore(Package): version('1.11.0', sha256='da1b9cef9aabbfaee69a19d5e15f5a911eefbd126546738343a78c032860b5a5', expand=False) version('1.8.0', sha256='58ce54b01570996cda860c0c80693b8db19324785a356573f105afeaa31cae6c', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-dataset-runtime@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-telemetry@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) @@ -27,7 +25,3 @@ class PyAzuremlAutomlCore(Package): depends_on('py-azureml-dataprep@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-telemetry@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-core/package.py b/var/spack/repos/builtin/packages/py-azureml-core/package.py index e990b4848f..4de57a9d64 100644 --- a/var/spack/repos/builtin/packages/py-azureml-core/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-core/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlCore(Package): +class PyAzuremlCore(PythonPackage): """The azureml-core contains functionality for creating and managing: * Azure Machine Learning workspaces, experiments and runs; * Machine learning compute respources; @@ -18,9 +18,7 @@ class PyAzuremlCore(Package): version('1.11.0', sha256='df8a01b04bb156852480de0bdd78434ed84f386e1891752bdf887faeaa2ca417', expand=False) version('1.8.0', sha256='a0f2b0977f18fb7dcb88c314594a4a85c636a36be3d582be1cae25655fea6105', expand=False) - extends('python') depends_on('python@3.5:3.8', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-pytz', type=('build', 'run')) depends_on('py-backports-tempfile', type=('build', 'run')) depends_on('py-pathspec', type=('build', 'run')) @@ -48,7 +46,3 @@ class PyAzuremlCore(Package): depends_on('py-adal@1.2.0:', type=('build', 'run')) depends_on('py-pyopenssl@:20', type=('build', 'run')) depends_on('py-jmespath', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-dataprep-native/package.py b/var/spack/repos/builtin/packages/py-azureml-dataprep-native/package.py index 081b3183ab..282c81aad8 100644 --- a/var/spack/repos/builtin/packages/py-azureml-dataprep-native/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-dataprep-native/package.py @@ -6,7 +6,7 @@ import sys -class PyAzuremlDataprepNative(Package): +class PyAzuremlDataprepNative(PythonPackage): """Python Package for AzureML DataPrep specific native extensions.""" homepage = "https://docs.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py" @@ -40,17 +40,9 @@ class PyAzuremlDataprepNative(Package): version('14.2.1-py3.7', sha256='0817ec5c378a9bcd1af8edda511ca9d02bdc7087e6f8802c459c9b8f3fde4ade', expand=False, url='https://pypi.io/packages/cp37/a/azureml_dataprep_native/azureml_dataprep_native-14.2.1-cp37-cp37m-manylinux1_x86_64.whl') - extends('python') - depends_on('py-pip', type='build') - depends_on('python@3.9.0:3.9', when='@30.0.0-py3.9', type=('build', 'run')) depends_on('python@3.8.0:3.8', when='@30.0.0-py3.8', type=('build', 'run')) depends_on('python@3.7.0:3.7', when='@30.0.0-py3.7', type=('build', 'run')) depends_on('python@3.6.0:3.6', when='@30.0.0-py3.6', type=('build', 'run')) depends_on('python@3.5.0:3.5', when='@30.0.0-py3.5', type=('build', 'run')) - depends_on('python@3.7.0:3.7', when='@14.2.1-py3.7', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-dataprep-rslex/package.py b/var/spack/repos/builtin/packages/py-azureml-dataprep-rslex/package.py index b98bba9ed1..c5a9ce9b22 100644 --- a/var/spack/repos/builtin/packages/py-azureml-dataprep-rslex/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-dataprep-rslex/package.py @@ -10,7 +10,7 @@ import archspec from spack import * -class PyAzuremlDataprepRslex(Package): +class PyAzuremlDataprepRslex(PythonPackage): """Azure Machine Learning Data Prep RsLex is a Rust implementation of Data Prep's capabilities to load, transform, and write data for machine learning workflows.""" @@ -61,9 +61,6 @@ class PyAzuremlDataprepRslex(Package): version('1.8.0-py3.5', sha256='9dfbd1065030dee3aa45b6796c087acffb06cfcbe97cc877e255e21e320362be', expand=False, deprecated=True, url='https://pypi.io/packages/cp35/a/azureml_dataprep_rslex/azureml_dataprep_rslex-1.8.0-cp35-cp35m-manylinux1_x86_64.whl') - extends('python') - depends_on('py-pip', type='build') - depends_on('python@3.9.0:3.9', when='@1.9.0-py3.9,1.8.0-py3.9', type=('build', 'run')) depends_on('python@3.8.0:3.8', when='@1.9.0-py3.8,1.8.0-py3.8', type=('build', 'run')) depends_on('python@3.7.0:3.7', when='@1.9.0-py3.7,1.8.0-py3.7', type=('build', 'run')) @@ -73,7 +70,3 @@ class PyAzuremlDataprepRslex(Package): for t in set([str(x.family) for x in archspec.cpu.TARGETS.values() if str(x.family) != 'x86_64']): conflicts('target={0}:'.format(t), msg='py-azureml-dataprep-rslex is available x86_64 only') - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-dataprep/package.py b/var/spack/repos/builtin/packages/py-azureml-dataprep/package.py index d1fbcefd90..094922a395 100644 --- a/var/spack/repos/builtin/packages/py-azureml-dataprep/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-dataprep/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlDataprep(Package): +class PyAzuremlDataprep(PythonPackage): """Azure ML Data Preparation SDK.""" homepage = "https://docs.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py" @@ -17,10 +17,7 @@ class PyAzuremlDataprep(Package): variant('fuse', default=False, description='Build with FUSE support') - extends('python') depends_on('python@3:', type=('build', 'run')) - depends_on('py-pip', type='build') - depends_on('py-dotnetcore2@2.1.14:2', type=('build', 'run')) depends_on('py-azureml-dataprep-native@30.0.0:30', when='@2.10.0:', type=('build', 'run')) depends_on('py-azureml-dataprep-native@14.2.1:14', when='@:2.0.2', type=('build', 'run')) @@ -30,7 +27,3 @@ class PyAzuremlDataprep(Package): depends_on('py-azure-identity@1.2.0:1.4', when='@2.10.0:', type=('build', 'run')) depends_on('py-azure-identity@1.2.0:1.2', when='@:2.0.2', type=('build', 'run')) depends_on('py-fusepy@3.0.1:3', when='+fuse', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-dataset-runtime/package.py b/var/spack/repos/builtin/packages/py-azureml-dataset-runtime/package.py index 261bf8f483..fbed253fab 100644 --- a/var/spack/repos/builtin/packages/py-azureml-dataset-runtime/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-dataset-runtime/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlDatasetRuntime(Package): +class PyAzuremlDatasetRuntime(PythonPackage): """The purpose of this package is to coordinate dependencies within AzureML packages. It is not intended for public use.""" @@ -16,16 +16,10 @@ class PyAzuremlDatasetRuntime(Package): variant('fuse', default=False, description='Build with FUSE support') - extends('python') depends_on('python@3.0:3', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-dataprep@2.10.0:2.10', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-dataprep@2.0.1:2.0', when='@1.11.0.post1', type=('build', 'run')) depends_on('py-pyarrow@0.17.0:1', when='@1.23.0', type=('build', 'run')) depends_on('py-pyarrow@0.17.0:0', when='@1.11.0.post1', type=('build', 'run')) depends_on('py-numpy@:1.19.2,1.19.4:', when='@1.23.0:', type=('build', 'run')) depends_on('py-fusepy@3.0.1:3', when='+fuse', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-pipeline-core/package.py b/var/spack/repos/builtin/packages/py-azureml-pipeline-core/package.py index 2e4fe801ec..932beadf74 100644 --- a/var/spack/repos/builtin/packages/py-azureml-pipeline-core/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-pipeline-core/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlPipelineCore(Package): +class PyAzuremlPipelineCore(PythonPackage): """Core functionality to enable azureml-pipeline feature.""" homepage = "https://docs.microsoft.com/en-us/azure/machine-learning/service/" @@ -14,16 +14,7 @@ class PyAzuremlPipelineCore(Package): version('1.11.0', sha256='98012195e3bba12bf42ac69179549038b3563b39e3dadab4f1d06407a00ad8b3', expand=False) version('1.8.0', sha256='24e1c57a57e75f9d74ea6f45fa4e93c1ee3114c8ed9029d538f9cc8e4f8945b2', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') - depends_on('py-azureml-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) - depends_on('py-azureml-core@1.11.0:1.11', when='@1.11.0', type=('build', 'run')) - depends_on('py-azureml-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-pipeline-steps/package.py b/var/spack/repos/builtin/packages/py-azureml-pipeline-steps/package.py index dd6d2acc4a..8f91c3e21d 100644 --- a/var/spack/repos/builtin/packages/py-azureml-pipeline-steps/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-pipeline-steps/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlPipelineSteps(Package): +class PyAzuremlPipelineSteps(PythonPackage): """Represents a unit of computation in azureml-pipeline.""" homepage = "https://docs.microsoft.com/en-us/azure/machine-learning/service/" @@ -14,9 +14,7 @@ class PyAzuremlPipelineSteps(Package): version('1.11.0', sha256='674317d9c74ec4cb05e443f50de1732e14dc4519cbe2743a44f8db0bc5e71214', expand=False) version('1.8.0', sha256='3310674207ed457a26fb978e7168e400306c695f7f854f354dee9d5c7c81304c', expand=False) - extends('python') depends_on('python@3:', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-train-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-train-automl-client@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) @@ -29,7 +27,3 @@ class PyAzuremlPipelineSteps(Package): depends_on('py-azureml-train-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-train-automl-client@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-pipeline-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-pipeline/package.py b/var/spack/repos/builtin/packages/py-azureml-pipeline/package.py index 6c526fc3a5..9d6c69bb53 100644 --- a/var/spack/repos/builtin/packages/py-azureml-pipeline/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-pipeline/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlPipeline(Package): +class PyAzuremlPipeline(PythonPackage): """The Azure Machine Learning SDK for Python can be used to create ML pipelines as well as to submit and track individual pipeline runs.""" @@ -15,9 +15,7 @@ class PyAzuremlPipeline(Package): version('1.11.0', sha256='8233c66b4120e86b9a9346608ca53bf48d5b9f0558300314034426dd0d7897d6', expand=False) version('1.8.0', sha256='43ce39789d9a255f147311e40274b5f2571c7ef3b52e218f248724ccb377a02c', expand=False) - extends('python') depends_on('python@3:', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-pipeline-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-pipeline-steps@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) @@ -27,7 +25,3 @@ class PyAzuremlPipeline(Package): depends_on('py-azureml-pipeline-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-pipeline-steps@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-sdk/package.py b/var/spack/repos/builtin/packages/py-azureml-sdk/package.py index 13dd9985c2..012069c24b 100644 --- a/var/spack/repos/builtin/packages/py-azureml-sdk/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-sdk/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlSdk(Package): +class PyAzuremlSdk(PythonPackage): """Microsoft Azure Machine Learning Python SDK.""" homepage = "https://docs.microsoft.com/en-us/azure/machine-learning/service/" @@ -16,10 +16,8 @@ class PyAzuremlSdk(Package): version('1.11.0', sha256='d8c9d24ea90457214d798b0d922489863dad518adde3638e08ef62de28fb183a', expand=False) version('1.8.0', sha256='61107db1403ce2c1a12064eb0fa31a1d075debbf32dd17cb93b7639b615b7839', expand=False) - extends('python') # https://github.com/Azure/MachineLearningNotebooks/issues/1285 depends_on('python@3.5:3.8', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-dataset-runtime@1.23.0:1.23 +fuse', when='@1.23.0', type=('build', 'run')) @@ -38,7 +36,3 @@ class PyAzuremlSdk(Package): depends_on('py-azureml-train-automl-client@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-pipeline@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-dataprep@1.8.0:1.8 +fuse', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-telemetry/package.py b/var/spack/repos/builtin/packages/py-azureml-telemetry/package.py index 2d0c6388eb..9128184b10 100644 --- a/var/spack/repos/builtin/packages/py-azureml-telemetry/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-telemetry/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlTelemetry(Package): +class PyAzuremlTelemetry(PythonPackage): """Machine learning (ML) telemetry package is used to collect telemetry data.""" @@ -15,17 +15,8 @@ class PyAzuremlTelemetry(Package): version('1.11.0', sha256='0d46c4a7bb8c0b188f1503504a6029384bc2237d82a131e7d1e9e89c3491b1fc', expand=False) version('1.8.0', sha256='de657efe9773bea0de76c432cbab34501ac28606fe1b380d6883562ebda3d804', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-applicationinsights', type=('build', 'run')) - depends_on('py-azureml-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) - depends_on('py-azureml-core@1.11.0:1.11', when='@1.11.0', type=('build', 'run')) - depends_on('py-azureml-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-train-automl-client/package.py b/var/spack/repos/builtin/packages/py-azureml-train-automl-client/package.py index 3b770292dd..7a86f52f5d 100644 --- a/var/spack/repos/builtin/packages/py-azureml-train-automl-client/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-train-automl-client/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlTrainAutomlClient(Package): +class PyAzuremlTrainAutomlClient(PythonPackage): """The azureml-train-automl-client package contains functionality for automatically finding the best machine learning model and its parameters, given training and test data.""" @@ -16,9 +16,7 @@ class PyAzuremlTrainAutomlClient(Package): version('1.11.0', sha256='3184df60a46917e92140a299aecb54591b19df490a3f4f571ff1f92c5e70a715', expand=False) version('1.8.0', sha256='562300095db6c4dea7b052e255c53dd95c4c3d0589a828b545497fe1ca7e9677', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-automl-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) @@ -34,7 +32,3 @@ class PyAzuremlTrainAutomlClient(Package): depends_on('py-azureml-automl-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-telemetry@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-train-core/package.py b/var/spack/repos/builtin/packages/py-azureml-train-core/package.py index 6333f988f0..f52ace1e4c 100644 --- a/var/spack/repos/builtin/packages/py-azureml-train-core/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-train-core/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlTrainCore(Package): +class PyAzuremlTrainCore(PythonPackage): """The azureml-train-core contains functionality used by azureml-train metapackage.""" @@ -15,9 +15,7 @@ class PyAzuremlTrainCore(Package): version('1.11.0', sha256='1b5fd813d21e75cd522d3a078eba779333980a309bcff6fc72b74ddc8e7a26f1', expand=False) version('1.8.0', sha256='5a8d90a08d4477527049d793feb40d07dc32fafc0e4e57b4f0729d3c50b408a2', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-azureml-train-restclients-hyperdrive@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) depends_on('py-azureml-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) @@ -31,7 +29,3 @@ class PyAzuremlTrainCore(Package): depends_on('py-azureml-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-azureml-telemetry@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) depends_on('py-flake8@3.1.0:3.7.9', when='@1.8.0 ^python@3.6:', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-train-restclients-hyperdrive/package.py b/var/spack/repos/builtin/packages/py-azureml-train-restclients-hyperdrive/package.py index 50a866cd37..4fe6a4ffa6 100644 --- a/var/spack/repos/builtin/packages/py-azureml-train-restclients-hyperdrive/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-train-restclients-hyperdrive/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlTrainRestclientsHyperdrive(Package): +class PyAzuremlTrainRestclientsHyperdrive(PythonPackage): """The azureml-train-restclients-hyperdrive contains functionality for azureml-train metapackage.""" @@ -15,13 +15,7 @@ class PyAzuremlTrainRestclientsHyperdrive(Package): version('1.11.0', sha256='8bc6f9676a9f75e6ee06d201c418ea904c24e854f26cf799b08c259c3ac92d13', expand=False) version('1.8.0', sha256='1633c7eb0fd96714f54f72072ccf1c5ee1ef0a8ba52680793f20d27e0fd43c87', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-requests@2.19.1:', type=('build', 'run')) depends_on('py-msrest@0.5.1:', type=('build', 'run')) depends_on('py-msrestazure@0.4.33:', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-azureml-train/package.py b/var/spack/repos/builtin/packages/py-azureml-train/package.py index 1702bdfd24..3369f4e3e3 100644 --- a/var/spack/repos/builtin/packages/py-azureml-train/package.py +++ b/var/spack/repos/builtin/packages/py-azureml-train/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyAzuremlTrain(Package): +class PyAzuremlTrain(PythonPackage): """The azureml-train package provides estimators for training models using different deep learning frameworks and functionality for hyperparameter tuning using Azure cloud.""" @@ -16,16 +16,7 @@ class PyAzuremlTrain(Package): version('1.11.0', sha256='7800a3067979972b976c81082dc509e23c04405129cc1fdef0f9cd7895bcafc7', expand=False) version('1.8.0', sha256='124e5b7d8d64bac61db022f305bd31c25e57fdcb4be93eefd4244a04a13deab3', expand=False) - extends('python') depends_on('python@3.5:3', type=('build', 'run')) - depends_on('py-pip', type='build') - depends_on('py-azureml-train-core@1.23.0:1.23', when='@1.23.0', type=('build', 'run')) - depends_on('py-azureml-train-core@1.11.0:1.11', when='@1.11.0', type=('build', 'run')) - depends_on('py-azureml-train-core@1.8.0:1.8', when='@1.8.0', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-backcall/package.py b/var/spack/repos/builtin/packages/py-backcall/package.py index 4b241c3d3c..06e47fb0bb 100644 --- a/var/spack/repos/builtin/packages/py-backcall/package.py +++ b/var/spack/repos/builtin/packages/py-backcall/package.py @@ -14,3 +14,5 @@ class PyBackcall(PythonPackage): version('0.2.0', sha256='5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e') version('0.1.0', sha256='38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4') + + depends_on('py-flit-core@2:3', type='build') diff --git a/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py b/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py index 977fea79c0..547b31acb7 100644 --- a/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py +++ b/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py @@ -14,3 +14,6 @@ class PyBackportsSslMatchHostname(PythonPackage): py_namespace = 'backports' version('3.5.0.1', sha256='502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-bandit/package.py b/var/spack/repos/builtin/packages/py-bandit/package.py index f7408ec280..bd2b80de18 100644 --- a/var/spack/repos/builtin/packages/py-bandit/package.py +++ b/var/spack/repos/builtin/packages/py-bandit/package.py @@ -15,6 +15,7 @@ class PyBandit(PythonPackage): version('1.7.0', sha256='8a4c7415254d75df8ff3c3b15cfe9042ecee628a1e40b44c15a98890fbfc2608') depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-pbr@2.0.0:', type='build') depends_on('py-gitpython@1.0.1:', type=('build', 'run')) depends_on('py-pyyaml@5.3.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-basemap/package.py b/var/spack/repos/builtin/packages/py-basemap/package.py index 84df9e3221..92996ea8a8 100644 --- a/var/spack/repos/builtin/packages/py-basemap/package.py +++ b/var/spack/repos/builtin/packages/py-basemap/package.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os - from spack import * @@ -43,18 +41,3 @@ class PyBasemap(PythonPackage): def setup_build_environment(self, env): env.set('GEOS_DIR', self.spec['geos'].prefix) - - def install(self, spec, prefix): - """Install everything from build directory.""" - args = self.install_args(spec, prefix) - - self.setup_py('install', *args) - - # namespace packages should not create an __init__.py file. This has - # been reported to the basemap project in - # https://github.com/matplotlib/basemap/issues/456 - for root, dirs, files in os.walk(spec.prefix.lib): - for filename in files: - if (filename == '__init__.py' and - os.path.basename(root) == 'mpl_toolkits'): - os.remove(os.path.join(root, filename)) diff --git a/var/spack/repos/builtin/packages/py-bash-kernel/package.py b/var/spack/repos/builtin/packages/py-bash-kernel/package.py index 8d2b28af6b..bd5f6c8de1 100644 --- a/var/spack/repos/builtin/packages/py-bash-kernel/package.py +++ b/var/spack/repos/builtin/packages/py-bash-kernel/package.py @@ -15,4 +15,5 @@ class PyBashKernel(PythonPackage): version('0.7.2', sha256='a08c84eddd8179de5234105821fd5cc210015671a0bd3cd0bc4f631c475e1670') + depends_on('py-flit', type='build') depends_on('py-pexpect@4.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-biomine/package.py b/var/spack/repos/builtin/packages/py-biomine/package.py index 8275ab3c48..a1361bcaf6 100644 --- a/var/spack/repos/builtin/packages/py-biomine/package.py +++ b/var/spack/repos/builtin/packages/py-biomine/package.py @@ -14,6 +14,8 @@ class PyBiomine(PythonPackage): version('0.9.5', sha256='1b2a72cd2cb6e99d9b79fcc9ea94fa0e1892b02465620ba6bba59473dc7ff3ac') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-advancedhtmlparser', type=('build', 'run')) depends_on('py-pysam', type=('build', 'run')) depends_on('py-pyvcf', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-biopandas/package.py b/var/spack/repos/builtin/packages/py-biopandas/package.py index 8dfdeb5bab..4b31415535 100644 --- a/var/spack/repos/builtin/packages/py-biopandas/package.py +++ b/var/spack/repos/builtin/packages/py-biopandas/package.py @@ -20,5 +20,6 @@ class PyBiopandas(PythonPackage): version('0.2.5', branch="v0.2.5") depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-pandas@0.24.2:', type=('build', 'run')) depends_on('py-numpy@1.16.2:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-bitstring/package.py b/var/spack/repos/builtin/packages/py-bitstring/package.py index e1e7f55fce..70c57302ca 100644 --- a/var/spack/repos/builtin/packages/py-bitstring/package.py +++ b/var/spack/repos/builtin/packages/py-bitstring/package.py @@ -13,3 +13,6 @@ class PyBitstring(PythonPackage): pypi = "bitstring/bitstring-3.1.5.zip" version('3.1.5', sha256='c163a86fcef377c314690051885d86b47419e3e1770990c212e16723c1c08faa') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-blosc/package.py b/var/spack/repos/builtin/packages/py-blosc/package.py index 841e3ad5a3..445e0bbb87 100644 --- a/var/spack/repos/builtin/packages/py-blosc/package.py +++ b/var/spack/repos/builtin/packages/py-blosc/package.py @@ -15,7 +15,9 @@ class PyBlosc(PythonPackage): version('1.9.1', sha256='ffc884439a12409aa4e8945e21dc920d6bc21807357c51d24c7f0a27ae4f79b9') - depends_on('cmake@3.11.0:', type='build') depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-scikit-build', type='build') + depends_on('py-cmake@3.11:', type='build') + depends_on('py-ninja', type='build') # depends_on('c-blosc') # shipped internally diff --git a/var/spack/repos/builtin/packages/py-brian/package.py b/var/spack/repos/builtin/packages/py-brian/package.py index d7d6a4c991..31ab7dc96b 100644 --- a/var/spack/repos/builtin/packages/py-brian/package.py +++ b/var/spack/repos/builtin/packages/py-brian/package.py @@ -14,6 +14,8 @@ class PyBrian(PythonPackage): version('1.4.3', sha256='c881dcfcd1a21990f9cb3cca76cdd868111cfd9e227ef5c1b13bb372d2efeaa4') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-matplotlib@0.90.1:', type=('build', 'run')) depends_on('py-numpy@1.4.1:', type=('build', 'run')) depends_on('py-scipy@0.7.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-brian2/package.py b/var/spack/repos/builtin/packages/py-brian2/package.py index b9d88fd072..7e5bf01981 100644 --- a/var/spack/repos/builtin/packages/py-brian2/package.py +++ b/var/spack/repos/builtin/packages/py-brian2/package.py @@ -32,5 +32,5 @@ class PyBrian2(PythonPackage): depends_on('py-setuptools@21:', type=('build', 'run')) depends_on('py-setuptools@24.2:', type=('build', 'run'), when='@2.4:') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): return ['--with-cython'] diff --git a/var/spack/repos/builtin/packages/py-bz2file/package.py b/var/spack/repos/builtin/packages/py-bz2file/package.py index f883842822..5decd559f2 100644 --- a/var/spack/repos/builtin/packages/py-bz2file/package.py +++ b/var/spack/repos/builtin/packages/py-bz2file/package.py @@ -13,3 +13,6 @@ class PyBz2file(PythonPackage): pypi = "bz2file/bz2file-0.98.tar.gz" version('0.98', sha256='64c1f811e31556ba9931953c8ec7b397488726c63e09a4c67004f43bdd28da88') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-cachecontrol/package.py b/var/spack/repos/builtin/packages/py-cachecontrol/package.py new file mode 100644 index 0000000000..12fbc54102 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-cachecontrol/package.py @@ -0,0 +1,24 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyCachecontrol(PythonPackage): + """CacheControl is a port of the caching algorithms in httplib2 + for use with requests session object.""" + + homepage = "https://github.com/ionrock/cachecontrol" + pypi = "CacheControl/CacheControl-0.12.10.tar.gz" + + version('0.12.10', sha256='d8aca75b82eec92d84b5d6eb8c8f66ea16f09d2adb09dbca27fe2d5fc8d3732d') + + variant('filecache', default=False, description='Add lockfile dependency') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-requests', type=('build', 'run')) + depends_on('py-msgpack@0.5.2:', type=('build', 'run')) + depends_on('py-lockfile@0.9:', when='+filecache', type='run') diff --git a/var/spack/repos/builtin/packages/py-cachy/package.py b/var/spack/repos/builtin/packages/py-cachy/package.py new file mode 100644 index 0000000000..618f679387 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-cachy/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyCachy(PythonPackage): + """Cachy provides a simple yet effective caching library.""" + + homepage = "https://github.com/sdispater/cachy" + pypi = "cachy/cachy-0.3.0.tar.gz" + + version('0.3.0', sha256='186581f4ceb42a0bbe040c407da73c14092379b1e4c0e327fdb72ae4a9b269b1') + + depends_on('python@2.7,3.4:4', type=('build', 'run')) + # https://github.com/sdispater/cachy/issues/20 + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-cartopy/package.py b/var/spack/repos/builtin/packages/py-cartopy/package.py index ba7a6d3da6..e61944ed59 100644 --- a/var/spack/repos/builtin/packages/py-cartopy/package.py +++ b/var/spack/repos/builtin/packages/py-cartopy/package.py @@ -52,8 +52,6 @@ class PyCartopy(PythonPackage): patch('proj6.patch', when='@0.17.0') - phases = ['build_ext', 'install'] - def setup_build_environment(self, env): # Needed for `spack install --test=root py-cartopy` library_dirs = [] @@ -75,24 +73,3 @@ class PyCartopy(PythonPackage): # Needed for `spack test run py-foo` where `py-foo` depends on `py-cartopy` def setup_dependent_run_environment(self, env, dependent_spec): self.setup_build_environment(env) - - def build_ext_args(self, spec, prefix): - args = [ - spec['geos'].headers.include_flags, - spec['geos'].libs.search_flags, - spec['proj'].headers.include_flags, - spec['proj'].libs.search_flags, - ] - - if '+plotting' in spec: - args.extend([ - spec['gdal'].headers.include_flags, - spec['gdal'].libs.search_flags, - ]) - - return args - - # Tests need to be re-added since `phases` was overridden - run_after('install')( - PythonPackage._run_default_install_time_test_callbacks) - run_after('install')(PythonPackage.sanity_check_prefix) diff --git a/var/spack/repos/builtin/packages/py-cclib/package.py b/var/spack/repos/builtin/packages/py-cclib/package.py index 2f5fea76e2..0c7901bb1e 100644 --- a/var/spack/repos/builtin/packages/py-cclib/package.py +++ b/var/spack/repos/builtin/packages/py-cclib/package.py @@ -15,4 +15,6 @@ class PyCclib(PythonPackage): version('1.5.post1', sha256='c2bf043432ab8df461d61b4289d0eb869fe134eee545ea5a78f8dea14b392f47', url="https://github.com/cclib/cclib/releases/download/v1.5/cclib-1.5.post1.tar.gz") + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy@1.5:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-cdat-lite/package.py b/var/spack/repos/builtin/packages/py-cdat-lite/package.py index 478a5effa4..92ebf0a705 100644 --- a/var/spack/repos/builtin/packages/py-cdat-lite/package.py +++ b/var/spack/repos/builtin/packages/py-cdat-lite/package.py @@ -21,14 +21,3 @@ class PyCdatLite(PythonPackage): depends_on("python@2.5:2.8", type=('build', 'run')) depends_on("py-numpy", type=('build', 'run')) depends_on('py-setuptools', type='build') - - phases = ['install'] - - def install(self, spec, prefix): - """Install everything from build directory.""" - install_args = self.install_args(spec, prefix) - # Combine all phases into a single setup.py command, - # otherwise extensions are rebuilt without rpath by install phase: - self.setup_py('build_ext', '--rpath=%s' % ":".join(self.rpath), - 'build_py', 'build_scripts', - 'install', *install_args) diff --git a/var/spack/repos/builtin/packages/py-charm4py/package.py b/var/spack/repos/builtin/packages/py-charm4py/package.py index e2f93215be..cf6c61a46b 100644 --- a/var/spack/repos/builtin/packages/py-charm4py/package.py +++ b/var/spack/repos/builtin/packages/py-charm4py/package.py @@ -23,9 +23,6 @@ class PyCharm4py(PythonPackage): # notify when the package is updated. maintainers = ['payerle'] - # Get errors passing --mpi to build* phases of setup.py - phases = ['install'] - version('1.0', sha256='8ddb9f021b7379fde94b28c31f4ab6a60ced2c2a207a2d75ce57cb91b6be92bc') variant('mpi', default=True, @@ -64,9 +61,8 @@ class PyCharm4py(PythonPackage): env.set('SPACK_CHARM4PY_EXTRALIBS', self.spec['cuda'].libs.ld_flags) - def install_args(self, spec, prefix): - # Have the parent class version set prefix - args = super(PythonPackage, self).install_args(spec, prefix) + def install_options(self, spec, prefix): + args = [] if '+mpi' in spec: args.append('--mpi') return args diff --git a/var/spack/repos/builtin/packages/py-checkm-genome/package.py b/var/spack/repos/builtin/packages/py-checkm-genome/package.py index 18b3dee2f9..5fdb7191dd 100644 --- a/var/spack/repos/builtin/packages/py-checkm-genome/package.py +++ b/var/spack/repos/builtin/packages/py-checkm-genome/package.py @@ -16,6 +16,8 @@ class PyCheckmGenome(PythonPackage): version('1.0.13', sha256='ffb7e4966c0fac07c7e6e7db6f6eb5b48587fa83987f8a68efbaff2afb7da82e', deprecated=True) version('1.0.11', sha256='e475d9817d12fa771dbccc80f47758b742fc67c25261dc8ca0c0dc898c2a5190', deprecated=True) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('hmmer@3.1b1:', type=('build', 'run')) depends_on('pplacer', type=('build', 'run')) depends_on('prodigal@2.6.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-cleo/package.py b/var/spack/repos/builtin/packages/py-cleo/package.py new file mode 100644 index 0000000000..bf856363e8 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-cleo/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyCleo(PythonPackage): + """Cleo allows you to create beautiful and testable command-line interfaces.""" + + homepage = "https://github.com/sdispater/cleo" + pypi = "cleo/cleo-0.8.1.tar.gz" + + version('0.8.1', sha256='3d0e22d30117851b45970b6c14aca4ab0b18b1b53c8af57bed13208147e4069f') + + depends_on('python@2.7,3.4:3', type=('build', 'run')) + depends_on('py-poetry-core@1:', type='build') + depends_on('py-clikit@0.6.0:0.6', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-clikit/package.py b/var/spack/repos/builtin/packages/py-clikit/package.py new file mode 100644 index 0000000000..2ff9dbf72b --- /dev/null +++ b/var/spack/repos/builtin/packages/py-clikit/package.py @@ -0,0 +1,25 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyClikit(PythonPackage): + """CliKit is a group of utilities to build beautiful and testable + command line interfaces.""" + + homepage = "https://github.com/sdispater/clikit" + pypi = "clikit/clikit-0.6.2.tar.gz" + + version('0.6.2', sha256='442ee5db9a14120635c5990bcdbfe7c03ada5898291f0c802f77be71569ded59') + + depends_on('python@2.7,3.4:3', type=('build', 'run')) + depends_on('py-poetry-core@1:', type='build') + depends_on('py-pastel@0.2.0:0.2', type=('build', 'run')) + depends_on('py-pylev@1.3:1', type=('build', 'run')) + depends_on('py-crashtest@0.3.0:0.3', when='^python@3.6:3', type=('build', 'run')) + depends_on('py-typing@3.6:3', when='^python@2.7,3.4', type=('build', 'run')) + depends_on('py-typing-extensions@3.6:3', when='^python@3.5.0:3.5.3', type=('build', 'run')) + depends_on('py-enum34@1.1:1', when='^python@2.7', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-climate/package.py b/var/spack/repos/builtin/packages/py-climate/package.py index f207537f94..8c22289895 100644 --- a/var/spack/repos/builtin/packages/py-climate/package.py +++ b/var/spack/repos/builtin/packages/py-climate/package.py @@ -15,13 +15,3 @@ class PyClimate(PythonPackage): version('0.1.0', sha256='01026c764b34d8204b8f527a730ef667fa5827fca765993ff1ed3e9dab2c11ae', expand=False) depends_on('python@3.7:3', type=('build', 'run')) - depends_on('py-wheel', type='build') - depends_on('py-pip', type='build') - - phases = ['install'] - - # copied from py-azureml-core - def install(self, spec, prefix): - pip = which('pip') - pip('install', '--no-deps', self.stage.archive_file, - '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-cmake/package.py b/var/spack/repos/builtin/packages/py-cmake/package.py index 7425eb116a..df205269b3 100644 --- a/var/spack/repos/builtin/packages/py-cmake/package.py +++ b/var/spack/repos/builtin/packages/py-cmake/package.py @@ -17,11 +17,10 @@ class PyCmake(PythonPackage): version('3.21.4', sha256='30fa5ed8a5ad66dcd263adb87f3ce3dc2d0ec0ac3958f5becff577e4b62cd065') version('3.18.0', sha256='52b98c5ee70b5fa30a8623e96482227e065292f78794eb085fdf0fecb204b79b') + depends_on('py-scikit-build@0.12:', type='build') + depends_on('py-setuptools@42:', type='build') depends_on('cmake@3.21.4', type=('build', 'link', 'run'), when='@3.21.4') depends_on('cmake@3.18.0', type=('build', 'link', 'run'), when='@3.18.0') - depends_on('py-scikit-build', type='build') - def build_args(self, spec, prefix): - args = [] - args.append('-DBUILD_CMAKE_FROM_SOURCE=OFF') - return args + def install_options(self, spec, prefix): + return ['-DBUILD_CMAKE_FROM_SOURCE=OFF'] diff --git a/var/spack/repos/builtin/packages/py-coapthon3/package.py b/var/spack/repos/builtin/packages/py-coapthon3/package.py index 22173535eb..84e295646b 100644 --- a/var/spack/repos/builtin/packages/py-coapthon3/package.py +++ b/var/spack/repos/builtin/packages/py-coapthon3/package.py @@ -17,5 +17,7 @@ class PyCoapthon3(PythonPackage): version('1.0.1', sha256='331150a581708d47b208cee3b067ced80a00f0cc1278e913ec546e6c6b28bffd') version('1.0', sha256='63eb083269c2a286aedd206d3df17ab67fa978dc43caf34eaab9498da15c497a') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-sphinx', type=('build', 'run')) depends_on('py-cachetools', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-colorpy/package.py b/var/spack/repos/builtin/packages/py-colorpy/package.py index 2aee0a5c97..1f95e97ffb 100644 --- a/var/spack/repos/builtin/packages/py-colorpy/package.py +++ b/var/spack/repos/builtin/packages/py-colorpy/package.py @@ -19,5 +19,7 @@ class PyColorpy(PythonPackage): version('0.1.1', sha256='e400a7e879adc83c6098dde13cdd093723f3936778c245b1caf88f5f1411170d') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type='run') depends_on('py-matplotlib', type='run') diff --git a/var/spack/repos/builtin/packages/py-configargparse/package.py b/var/spack/repos/builtin/packages/py-configargparse/package.py index 49d716823b..9252e288c2 100644 --- a/var/spack/repos/builtin/packages/py-configargparse/package.py +++ b/var/spack/repos/builtin/packages/py-configargparse/package.py @@ -23,3 +23,4 @@ class PyConfigargparse(PythonPackage): version('1.2.3', sha256='0f1144a204e3b896d6ac900e151c1d13bde3103d6b7d541e3bb57514a94083bf') depends_on('python@2.2:2,3.5:', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-configobj/package.py b/var/spack/repos/builtin/packages/py-configobj/package.py index 262fe83b05..acd9cde699 100644 --- a/var/spack/repos/builtin/packages/py-configobj/package.py +++ b/var/spack/repos/builtin/packages/py-configobj/package.py @@ -16,5 +16,7 @@ class PyConfigobj(PythonPackage): version('5.0.6', sha256='a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902') version('4.7.2', sha256='515ff923462592e8321df8b48c47e3428f8d406ee22b8de77bef969d1af11171') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-six', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-configspace/package.py b/var/spack/repos/builtin/packages/py-configspace/package.py index 7e24fe0a89..724ea1754a 100644 --- a/var/spack/repos/builtin/packages/py-configspace/package.py +++ b/var/spack/repos/builtin/packages/py-configspace/package.py @@ -18,6 +18,7 @@ class PyConfigspace(PythonPackage): version('0.4.20', sha256='2e4ca06f5a6a61e5322a73dd7545468c79f2a3e8385cab92fdada317af41d9e9') depends_on('python@3.7:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-cython', type='build') depends_on('py-pyparsing', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-crashtest/package.py b/var/spack/repos/builtin/packages/py-crashtest/package.py new file mode 100644 index 0000000000..4b9eca987b --- /dev/null +++ b/var/spack/repos/builtin/packages/py-crashtest/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyCrashtest(PythonPackage): + """Crashtest is a Python library that makes exceptions handling + and inspection easier.""" + + homepage = "https://github.com/sdispater/crashtest" + pypi = "crashtest/crashtest-0.3.1.tar.gz" + + version('0.3.1', sha256='42ca7b6ce88b6c7433e2ce47ea884e91ec93104a4b754998be498a8e6c3d37dd') + + depends_on('python@3.6:3', type=('build', 'run')) + depends_on('py-poetry-core@1:', type='build') diff --git a/var/spack/repos/builtin/packages/py-crcmod/package.py b/var/spack/repos/builtin/packages/py-crcmod/package.py index bd5b86470c..4c3df6701d 100644 --- a/var/spack/repos/builtin/packages/py-crcmod/package.py +++ b/var/spack/repos/builtin/packages/py-crcmod/package.py @@ -18,8 +18,3 @@ class PyCrcmod(PythonPackage): depends_on('python@2.4:2.7,3.1:', type=('build', 'run')) depends_on('py-setuptools@40.0.0:', type='build') - - def install(self, spec, prefix): - # Override install to avoid - # error: option --single-version-externally-managed not recognized - setup_py('install', '--root=/', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-cssselect/package.py b/var/spack/repos/builtin/packages/py-cssselect/package.py index 5cf408f223..dd423c0b5c 100644 --- a/var/spack/repos/builtin/packages/py-cssselect/package.py +++ b/var/spack/repos/builtin/packages/py-cssselect/package.py @@ -19,3 +19,5 @@ class PyCssselect(PythonPackage): version('1.0.2', sha256='ee16bbb99b0a1f593ed4cd822f20bffefa4a4676d19d7dd1f231b4c1cc1cc1e2') version('1.0.1', sha256='cdfa17ab5dc8818209f310a930b18d3035a4585ddd2c179e833036e2dde511c6') version('1.0.0', sha256='2f757203e03aedcc1b31a452cf2752728b843351b7819ea2d4cd9ef38df7b324') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-cudf/package.py b/var/spack/repos/builtin/packages/py-cudf/package.py index a660fa9b7a..36f223167a 100644 --- a/var/spack/repos/builtin/packages/py-cudf/package.py +++ b/var/spack/repos/builtin/packages/py-cudf/package.py @@ -36,9 +36,8 @@ class PyCudf(PythonPackage): for v in ('@0.15.0',): depends_on('libcudf' + v, when=v) - phases = ['cmake', 'build_ext', 'install'] - - def cmake(self, spec, prefix): + @run_before('install') + def cmake(self): cmake = which('cmake') build_dir = os.path.join(self.stage.source_path, 'cpp', 'build') diff --git a/var/spack/repos/builtin/packages/py-cuml/package.py b/var/spack/repos/builtin/packages/py-cuml/package.py index 1becd4d192..7905bc3577 100644 --- a/var/spack/repos/builtin/packages/py-cuml/package.py +++ b/var/spack/repos/builtin/packages/py-cuml/package.py @@ -37,6 +37,4 @@ class PyCuml(PythonPackage): for v in ('@0.15.0',): depends_on('libcuml{0}'.format(v), when=v) - phases = ['build_ext', 'install'] - build_directory = 'python' diff --git a/var/spack/repos/builtin/packages/py-cyordereddict/package.py b/var/spack/repos/builtin/packages/py-cyordereddict/package.py index a0385c0019..db8563f34c 100644 --- a/var/spack/repos/builtin/packages/py-cyordereddict/package.py +++ b/var/spack/repos/builtin/packages/py-cyordereddict/package.py @@ -15,3 +15,5 @@ class PyCyordereddict(PythonPackage): version('1.0.0', sha256='d9b2c31796999770801a9a49403b8cb49510ecb64e5d1e9d4763ed44f2d5a76e') version('0.2.2', sha256='f8387caaffba695d704311842291ede696080a5ed306f07f1825de126fb7f1ec') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-cython/package.py b/var/spack/repos/builtin/packages/py-cython/package.py index e8eda918e3..5f36480a45 100644 --- a/var/spack/repos/builtin/packages/py-cython/package.py +++ b/var/spack/repos/builtin/packages/py-cython/package.py @@ -45,7 +45,7 @@ class PyCython(PythonPackage): """Returns the Cython command""" return Executable(self.prefix.bin.cython) - @run_after('build') + @run_after('install') @on_package_attributes(run_tests=True) def build_test(self): # Warning: full suite of unit tests takes a very long time diff --git a/var/spack/repos/builtin/packages/py-damask/package.py b/var/spack/repos/builtin/packages/py-damask/package.py index 20fcb9b840..0e09deaf1b 100644 --- a/var/spack/repos/builtin/packages/py-damask/package.py +++ b/var/spack/repos/builtin/packages/py-damask/package.py @@ -16,11 +16,12 @@ class PyDamask(PythonPackage): version('3.0.0-alpha5', sha256='2d2b10901959c26a5bb5c52327cdafc7943bc1b36b77b515b0371221703249ae') depends_on('python@3.7:', type=('build', 'run')) - depends_on('vtk+python') - depends_on('py-pandas') - depends_on('py-scipy') - depends_on('py-h5py') - depends_on('py-matplotlib') - depends_on('py-pyyaml') + depends_on('py-setuptools@40.6:', type='build') + depends_on('vtk+python', type=('build', 'run')) + depends_on('py-pandas', type=('build', 'run')) + depends_on('py-scipy', type=('build', 'run')) + depends_on('py-h5py', type=('build', 'run')) + depends_on('py-matplotlib', type=('build', 'run')) + depends_on('py-pyyaml', type=('build', 'run')) build_directory = 'python' diff --git a/var/spack/repos/builtin/packages/py-datalad/package.py b/var/spack/repos/builtin/packages/py-datalad/package.py index c6f475f991..e0d7e597fb 100644 --- a/var/spack/repos/builtin/packages/py-datalad/package.py +++ b/var/spack/repos/builtin/packages/py-datalad/package.py @@ -113,7 +113,6 @@ class PyDatalad(PythonPackage): # duecredit depends_on('py-duecredit', type=('build', 'run')) - depends_on('py-nose', type=('test')) install_time_test_callbacks = ['test', 'installtest'] def installtest(self): diff --git a/var/spack/repos/builtin/packages/py-dbf/package.py b/var/spack/repos/builtin/packages/py-dbf/package.py index c729c652b1..7e7830d5a2 100644 --- a/var/spack/repos/builtin/packages/py-dbf/package.py +++ b/var/spack/repos/builtin/packages/py-dbf/package.py @@ -14,3 +14,6 @@ class PyDbf(PythonPackage): version('0.96.005', sha256='d6e03f1dca40488c37cf38be9cb28b694c46cec747a064dcb0591987de58ed02') version('0.94.003', sha256='c95b688d2f28944004368799cc6e2999d78af930a69bb2643ae098c721294444') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-dgl/package.py b/var/spack/repos/builtin/packages/py-dgl/package.py index e2fd91ff98..b2a4c50f3f 100644 --- a/var/spack/repos/builtin/packages/py-dgl/package.py +++ b/var/spack/repos/builtin/packages/py-dgl/package.py @@ -35,6 +35,8 @@ class PyDgl(CMakePackage): # See python/setup.py extends('python') depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools', type='build') depends_on('py-cython', type='build') depends_on('py-numpy@1.14.0:', type=('build', 'run')) @@ -91,8 +93,8 @@ class PyDgl(CMakePackage): def install(self, spec, prefix): with working_dir('python'): - setup_py('install', '--prefix=' + prefix, - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) # Work around installation bug: https://github.com/dmlc/dgl/issues/1379 install_tree(prefix.dgl, prefix.lib) diff --git a/var/spack/repos/builtin/packages/py-dipy/package.py b/var/spack/repos/builtin/packages/py-dipy/package.py index 6f66af3ce8..6609ca76c0 100644 --- a/var/spack/repos/builtin/packages/py-dipy/package.py +++ b/var/spack/repos/builtin/packages/py-dipy/package.py @@ -30,9 +30,3 @@ class PyDipy(PythonPackage): depends_on('py-h5py@2.5.0:', type=('build', 'run')) depends_on('py-packaging@19.0:', type=('build', 'run')) depends_on('py-tqdm@4.30.0:', type=('build', 'run')) - - # Prevent passing --single-version-externally-managed to - # setup.py, to avoid - # error: option --single-version-externally-managed not recognized - def install_args(self, spec, prefix): - return ['--prefix={0}'.format(prefix), '--root=/'] diff --git a/var/spack/repos/builtin/packages/py-discover/package.py b/var/spack/repos/builtin/packages/py-discover/package.py index d0618e8783..aa8c735fed 100644 --- a/var/spack/repos/builtin/packages/py-discover/package.py +++ b/var/spack/repos/builtin/packages/py-discover/package.py @@ -12,3 +12,6 @@ class PyDiscover(PythonPackage): pypi = "discover/discover-0.4.0.tar.gz" version('0.4.0', sha256='05c3fa9199e57d4b16fb653e02d65713adc1f89ef55324fb0c252b1cf9070d79') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-distlib/package.py b/var/spack/repos/builtin/packages/py-distlib/package.py index dc5ce6fd34..f795aaf9ec 100644 --- a/var/spack/repos/builtin/packages/py-distlib/package.py +++ b/var/spack/repos/builtin/packages/py-distlib/package.py @@ -13,3 +13,6 @@ class PyDistlib(PythonPackage): pypi = "distlib/distlib-0.3.3.zip" version('0.3.3', sha256='d982d0751ff6eaaab5e2ec8e691d949ee80eddf01a62eaa96ddb11531fe16b05') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-dlcpar/package.py b/var/spack/repos/builtin/packages/py-dlcpar/package.py index fa3b9b571a..30a8af1d13 100644 --- a/var/spack/repos/builtin/packages/py-dlcpar/package.py +++ b/var/spack/repos/builtin/packages/py-dlcpar/package.py @@ -15,4 +15,6 @@ class PyDlcpar(PythonPackage): version('1.0', sha256='774319caba0f10d1230b8f85b8a147eda5871f9a316d7b3381b91c1bde97aa0a') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-dotnetcore2/package.py b/var/spack/repos/builtin/packages/py-dotnetcore2/package.py index ee671dc5d4..224b9af372 100644 --- a/var/spack/repos/builtin/packages/py-dotnetcore2/package.py +++ b/var/spack/repos/builtin/packages/py-dotnetcore2/package.py @@ -6,7 +6,7 @@ import sys -class PyDotnetcore2(Package): +class PyDotnetcore2(PythonPackage): """.Net Core 2.1 runtime.""" homepage = "https://github.com/dotnet/core" @@ -22,11 +22,5 @@ class PyDotnetcore2(Package): conflicts('target=ppc64le:', msg='py-dotnetcore2 is only available for x86_64') conflicts('target=aarch64:', msg='py-dotnetcore2 is only available for x86_64') - extends('python') depends_on('python@3:', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-distro@1.2.0:', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-doxypy/package.py b/var/spack/repos/builtin/packages/py-doxypy/package.py index 6f6dd1fdd2..4f6f1540e9 100644 --- a/var/spack/repos/builtin/packages/py-doxypy/package.py +++ b/var/spack/repos/builtin/packages/py-doxypy/package.py @@ -13,4 +13,6 @@ class PyDoxypy(PythonPackage): version('0.3', sha256='55d621b0edebd9e2a58a266c0a1d086fc9892de8e07e04dfbb93880a7ae91f00', deprecated=True) - depends_on('python@:2.8') + depends_on('python@:2.8', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-dp-gp-cluster/package.py b/var/spack/repos/builtin/packages/py-dp-gp-cluster/package.py index e308b3d40c..095108d7ee 100644 --- a/var/spack/repos/builtin/packages/py-dp-gp-cluster/package.py +++ b/var/spack/repos/builtin/packages/py-dp-gp-cluster/package.py @@ -20,6 +20,8 @@ class PyDpGpCluster(PythonPackage): depends_on('python@2.7:2.8', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-cython', type='build') depends_on('py-gpy@0.8.8:0.9.9', type=('build', 'run')) depends_on('py-pandas', type=('build', 'run')) @@ -28,7 +30,7 @@ class PyDpGpCluster(PythonPackage): depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-scikit-learn', type=('build', 'run')) - @run_before('build') + @run_before('install') def remove_cython_output(self): for f in glob('DP_GP/*.c'): unlink(f) diff --git a/var/spack/repos/builtin/packages/py-dpath/package.py b/var/spack/repos/builtin/packages/py-dpath/package.py index ceab57e57b..11f31f8599 100644 --- a/var/spack/repos/builtin/packages/py-dpath/package.py +++ b/var/spack/repos/builtin/packages/py-dpath/package.py @@ -17,3 +17,5 @@ class PyDpath(PythonPackage): version('2.0.1', sha256='bea06b5f4ff620a28dfc9848cf4d6b2bfeed34238edeb8ebe815c433b54eb1fa') depends_on('python@2.7:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-dryscrape/package.py b/var/spack/repos/builtin/packages/py-dryscrape/package.py index 683266b624..0de8014b04 100644 --- a/var/spack/repos/builtin/packages/py-dryscrape/package.py +++ b/var/spack/repos/builtin/packages/py-dryscrape/package.py @@ -17,6 +17,8 @@ class PyDryscrape(PythonPackage): version('develop', branch='master') version('1.0', sha256='a99858786434947266cb81d5634cb1722de48aaf6b9cdffda15b7cd4a8e07340') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-lxml', type=('build', 'run')) depends_on('py-webkit-server@1.0:', type=('build', 'run')) depends_on('py-xvfbwrapper', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-easybuild-easyblocks/package.py b/var/spack/repos/builtin/packages/py-easybuild-easyblocks/package.py index 4360a8623d..64f2e3a11a 100644 --- a/var/spack/repos/builtin/packages/py-easybuild-easyblocks/package.py +++ b/var/spack/repos/builtin/packages/py-easybuild-easyblocks/package.py @@ -20,6 +20,8 @@ class PyEasybuildEasyblocks(PythonPackage): depends_on('python@2.6:2.8', when='@:3', type=('build', 'run')) depends_on('python@2.6:2.8,3.5:', when='@4:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') for v in ['@3.1.2', '@4.0.0']: depends_on('py-easybuild-framework' + v, when=v, type='run') diff --git a/var/spack/repos/builtin/packages/py-easybuild-easyconfigs/package.py b/var/spack/repos/builtin/packages/py-easybuild-easyconfigs/package.py index 78a77c4bb6..3395e3e8b1 100644 --- a/var/spack/repos/builtin/packages/py-easybuild-easyconfigs/package.py +++ b/var/spack/repos/builtin/packages/py-easybuild-easyconfigs/package.py @@ -20,6 +20,8 @@ class PyEasybuildEasyconfigs(PythonPackage): depends_on('python@2.6:2.8', when='@:3', type=('build', 'run')) depends_on('python@2.6:2.8,3.5:', when='@4:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') for v in ['@3.1.2', '@4.0.0']: depends_on('py-easybuild-framework{0}:'.format(v), when=v + ':', type='run') diff --git a/var/spack/repos/builtin/packages/py-easybuild-framework/package.py b/var/spack/repos/builtin/packages/py-easybuild-framework/package.py index 782ac1f431..0b3325813f 100644 --- a/var/spack/repos/builtin/packages/py-easybuild-framework/package.py +++ b/var/spack/repos/builtin/packages/py-easybuild-framework/package.py @@ -20,5 +20,5 @@ class PyEasybuildFramework(PythonPackage): depends_on('python@2.6:2.8', when='@:3', type=('build', 'run')) depends_on('python@2.6:2.8,3.5:', when='@4:', type=('build', 'run')) - depends_on('py-setuptools', when='@:3', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) depends_on('py-vsc-base@2.5.4:', when='@2.9:3', type='run') diff --git a/var/spack/repos/builtin/packages/py-empy/package.py b/var/spack/repos/builtin/packages/py-empy/package.py index 557ddb48ef..e209854def 100644 --- a/var/spack/repos/builtin/packages/py-empy/package.py +++ b/var/spack/repos/builtin/packages/py-empy/package.py @@ -14,3 +14,6 @@ class PyEmpy(PythonPackage): pypi = "empy/empy-3.3.4.tar.gz" version('3.3.4', sha256='73ac49785b601479df4ea18a7c79bc1304a8a7c34c02b9472cf1206ae88f01b3') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-entrypoints/package.py b/var/spack/repos/builtin/packages/py-entrypoints/package.py index a86adfd36b..28fa4a05a0 100644 --- a/var/spack/repos/builtin/packages/py-entrypoints/package.py +++ b/var/spack/repos/builtin/packages/py-entrypoints/package.py @@ -15,4 +15,5 @@ class PyEntrypoints(PythonPackage): version('0.2.3', sha256='d2d587dde06f99545fb13a383d2cd336a8ff1f359c5839ce3a64c917d10c029f') depends_on('python@2.7:', type=('build', 'run')) - depends_on('py-configparser', when='^python@:2.8', type=('build', 'run')) + depends_on('py-flit', type='build') + depends_on('py-configparser@3.5:', when='^python@2.7', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-ephem/package.py b/var/spack/repos/builtin/packages/py-ephem/package.py index fdbcb4cb8c..3bd0c50fb4 100644 --- a/var/spack/repos/builtin/packages/py-ephem/package.py +++ b/var/spack/repos/builtin/packages/py-ephem/package.py @@ -14,3 +14,6 @@ class PyEphem(PythonPackage): url = "https://github.com/brandon-rhodes/pyephem/archive/v3.7.7.1.tar.gz" version('3.7.7.1', sha256='d9d05d85c0d38a79169acaef25964ac9df2d808f0d833354545b9ef681ff584d') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-epydoc/package.py b/var/spack/repos/builtin/packages/py-epydoc/package.py index da62e048aa..63c912b48a 100644 --- a/var/spack/repos/builtin/packages/py-epydoc/package.py +++ b/var/spack/repos/builtin/packages/py-epydoc/package.py @@ -12,3 +12,6 @@ class PyEpydoc(PythonPackage): pypi = "epydoc/epydoc-3.0.1.tar.gz" version('3.0.1', sha256='c81469b853fab06ec42b39e35dd7cccbe9938dfddef324683d89c1e5176e48f2') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-fallocate/package.py b/var/spack/repos/builtin/packages/py-fallocate/package.py index aee4656d7d..8d3b53aa98 100644 --- a/var/spack/repos/builtin/packages/py-fallocate/package.py +++ b/var/spack/repos/builtin/packages/py-fallocate/package.py @@ -14,3 +14,6 @@ class PyFallocate(PythonPackage): pypi = "fallocate/fallocate-1.6.4.tar.gz" version('1.6.4', sha256='85ebeb2786761fbe80d88c52590a610bd3425fc89e188c208a3f261a5bd6acb3') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-fastrlock/package.py b/var/spack/repos/builtin/packages/py-fastrlock/package.py index c27e5c54a3..1d33f66877 100644 --- a/var/spack/repos/builtin/packages/py-fastrlock/package.py +++ b/var/spack/repos/builtin/packages/py-fastrlock/package.py @@ -18,7 +18,5 @@ class PyFastrlock(PythonPackage): depends_on('py-setuptools', type='build') depends_on('py-cython', type='build') - def build_args(self, spec, prefix): - args = [] - args.append('--with-cython') - return args + def install_options(self, spec, prefix): + return ['--with-cython'] diff --git a/var/spack/repos/builtin/packages/py-faststructure/package.py b/var/spack/repos/builtin/packages/py-faststructure/package.py index 07160c8e8c..3e9b88eab9 100644 --- a/var/spack/repos/builtin/packages/py-faststructure/package.py +++ b/var/spack/repos/builtin/packages/py-faststructure/package.py @@ -15,6 +15,8 @@ class PyFaststructure(PythonPackage): version('1.0', sha256='f1bfb24bb5ecd108bc3a90145fad232012165c1e60608003f1c87d200f867b81') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-cython', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('gsl') diff --git a/var/spack/repos/builtin/packages/py-fenics-basix/package.py b/var/spack/repos/builtin/packages/py-fenics-basix/package.py index d42b5fd8d3..37f18a1bb4 100644 --- a/var/spack/repos/builtin/packages/py-fenics-basix/package.py +++ b/var/spack/repos/builtin/packages/py-fenics-basix/package.py @@ -32,6 +32,4 @@ class PyFenicsBasix(PythonPackage): depends_on("xtensor@0.23.10:", type="build") depends_on("py-pybind11@2.6.2:", type="build") - phases = ['build_ext', 'build', 'install'] - build_directory = 'python' diff --git a/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py b/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py index a57a1ae2d7..6fdbc73457 100644 --- a/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py +++ b/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py @@ -49,6 +49,4 @@ class PyFenicsDolfinx(PythonPackage): depends_on("py-cffi", type="run") depends_on("py-numpy", type="run") - phases = ['build_ext', 'build', 'install'] - build_directory = 'python' diff --git a/var/spack/repos/builtin/packages/py-flit-core/package.py b/var/spack/repos/builtin/packages/py-flit-core/package.py index a4463b95c1..f83c908a77 100644 --- a/var/spack/repos/builtin/packages/py-flit-core/package.py +++ b/var/spack/repos/builtin/packages/py-flit-core/package.py @@ -3,10 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import glob -import os -import zipfile - from spack import * @@ -14,19 +10,22 @@ class PyFlitCore(PythonPackage): """Distribution-building parts of Flit.""" homepage = "https://github.com/takluyver/flit" - url = "https://github.com/takluyver/flit/archive/refs/tags/3.3.0.tar.gz" + pypi = "flit-core/flit_core-3.3.0.tar.gz" maintainers = ['takluyver'] - version('3.3.0', sha256='f5340b268563dd408bf8e2df6dbc8d4d08bc76cdff0d8c7f8a4be94e5f01f22f') - - depends_on('python@3.4:', type=('build', 'run')) - depends_on('py-toml', type=('build', 'run')) - - def build(self, spec, prefix): - with working_dir('flit_core'): - python('build_dists.py') - - def install(self, spec, prefix): - wheel = glob.glob(os.path.join('flit_core', 'dist', '*.whl'))[0] - with zipfile.ZipFile(wheel) as f: - f.extractall(python_purelib) + version('3.5.1', sha256='3083720351a6cb00e0634a1ec0e26eae7b273174c3c6c03d5b597a14203b282e') + version('3.5.0', sha256='2db800d33ff41e4c6e7c1b594666cb2a11553024106655272c7245933b1d75bd') + version('3.4.0', sha256='29468fa2330969167d1f5c23eb9c0661cb6dacfcd46f361a274609a7f4197530') + version('3.3.0', sha256='b1404accffd6504b5f24eeca9ec5d3c877f828d16825348ba81515fa084bd5f0') + version('3.2.0', sha256='ff87f25c5dbc24ef30ea334074e35030e4885e4c5de3bf4e21f15746f6d99431') + version('3.1.0', sha256='22ff73be39a2b3c9e0692dfbbea3ad4a9d127e5733736a87dbb8ddcbf7309b1e') + version('3.0.0', sha256='a465052057e2d6d957e6850e9915245adedfc4fd0dd5737d0791bf3132417c2d') + version('2.3.0', sha256='a50bcd8bf5785e3a7d95434244f30ba693e794c5204ac1ee908fc07c4acdbf80') + + # Dependencies listed in flit_core/build_thyself.py + depends_on('python@3.6:', when='@3.4:', type=('build', 'run')) + depends_on('python@3.4:', when='@3:', type=('build', 'run')) + depends_on('python@2.7,3.4:', type=('build', 'run')) + depends_on('py-tomli', when='@3.4:', type='run') + depends_on('py-toml', when='@3.1:3.3', type='run') + depends_on('py-pytoml', when='@:3.0', type='run') diff --git a/var/spack/repos/builtin/packages/py-flit/package.py b/var/spack/repos/builtin/packages/py-flit/package.py index dd1d296ae3..1fd88037b0 100644 --- a/var/spack/repos/builtin/packages/py-flit/package.py +++ b/var/spack/repos/builtin/packages/py-flit/package.py @@ -14,6 +14,7 @@ class PyFlit(PythonPackage): version('3.3.0', sha256='65fbe22aaa7f880b776b20814bd80b0afbf91d1f95b17235b608aa256325ce57') + depends_on('python@3.6:', type=('build', 'run')) depends_on('py-flit-core@3.3.0:', type=('build', 'run')) depends_on('py-requests', type=('build', 'run')) depends_on('py-docutils', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-flye/package.py b/var/spack/repos/builtin/packages/py-flye/package.py index 0e3bcdb0b3..d64b996938 100644 --- a/var/spack/repos/builtin/packages/py-flye/package.py +++ b/var/spack/repos/builtin/packages/py-flye/package.py @@ -19,7 +19,7 @@ class PyFlye(PythonPackage): # https://github.com/fenderglass/Flye/blob/flye/docs/INSTALL.md depends_on('python@2.7:2.8,3.5:', when='@2.6:', type=('build', 'run')) depends_on('python@2.7:2.8', when='@:2.5', type=('build', 'run')) - depends_on('py-setuptools', when='@2.6:', type='build') + depends_on('py-setuptools', type='build') depends_on('gmake', type='build') depends_on('zlib') diff --git a/var/spack/repos/builtin/packages/py-fortranformat/package.py b/var/spack/repos/builtin/packages/py-fortranformat/package.py index 7170833816..dfef39949d 100644 --- a/var/spack/repos/builtin/packages/py-fortranformat/package.py +++ b/var/spack/repos/builtin/packages/py-fortranformat/package.py @@ -13,3 +13,6 @@ class PyFortranformat(PythonPackage): pypi = "fortranformat/fortranformat-0.2.5.tar.gz" version('0.2.5', sha256='6b5fbc1f129c7a70543c3a81f334fb4d57f07df2834b22ce69f6d7e8539cd3f9') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-functools32/package.py b/var/spack/repos/builtin/packages/py-functools32/package.py index 6dd79b73fd..ac4e20b0aa 100644 --- a/var/spack/repos/builtin/packages/py-functools32/package.py +++ b/var/spack/repos/builtin/packages/py-functools32/package.py @@ -14,3 +14,6 @@ class PyFunctools32(PythonPackage): pypi = "functools32/functools32-3.2.3-2.tar.gz" version('3.2.3-2', sha256='f6253dfbe0538ad2e387bd8fdfd9293c925d63553f5813c4e587745416501e6d') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-geeup/package.py b/var/spack/repos/builtin/packages/py-geeup/package.py index a1128d4b4d..2f48f37d05 100644 --- a/var/spack/repos/builtin/packages/py-geeup/package.py +++ b/var/spack/repos/builtin/packages/py-geeup/package.py @@ -22,7 +22,7 @@ class PyGeeup(PythonPackage): depends_on('py-pandas@0.23.0:', type=('build', 'run')) depends_on('py-psutil@5.4.5:', type=('build', 'run')) depends_on('py-requests-toolbelt@0.7.0:', type=('build', 'run')) - depends_on('py-pytest@3.0.0:', type=('build', 'test')) + depends_on('py-pytest@3.0.0:', type=('build', 'run')) depends_on('py-future@0.16.0:', type=('build', 'run')) depends_on('py-google-cloud-storage@1.1.1:', type=('build', 'run')) depends_on('py-selenium@3.13.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-genders/package.py b/var/spack/repos/builtin/packages/py-genders/package.py index f6f34137c0..633a0f97f7 100644 --- a/var/spack/repos/builtin/packages/py-genders/package.py +++ b/var/spack/repos/builtin/packages/py-genders/package.py @@ -19,6 +19,7 @@ class PyGenders(Package): # FIXME: Missing a dependency on genders # #include + depends_on('bison', type='build') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/repos/builtin/packages/py-glob2/package.py b/var/spack/repos/builtin/packages/py-glob2/package.py new file mode 100644 index 0000000000..135802d71e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-glob2/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyGlob2(PythonPackage): + """Version of the glob module that can capture patterns + and supports recursive wildcards.""" + + homepage = "http://github.com/miracle2k/python-glob2/" + pypi = "glob2/glob2-0.7.tar.gz" + + version('0.7', sha256='85c3dbd07c8aa26d63d7aacee34fa86e9a91a3873bc30bf62ec46e531f92ab8c') + version('0.6', sha256='f5b0a686ff21f820c4d3f0c4edd216704cea59d79d00fa337e244a2f2ff83ed6') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-globus-sdk/package.py b/var/spack/repos/builtin/packages/py-globus-sdk/package.py index 4d1bb6dace..607e4a40c5 100644 --- a/var/spack/repos/builtin/packages/py-globus-sdk/package.py +++ b/var/spack/repos/builtin/packages/py-globus-sdk/package.py @@ -16,7 +16,8 @@ class PyGlobusSdk(PythonPackage): version('3.0.2', sha256='765b577b37edac70c513179607f1c09de7b287baa855165c9dd68de076d67f16') - depends_on('python@3.4:', type=('build', 'run')) - depends_on('py-requests@2.19.1:2', type=('run', 'test')) - depends_on('py-cryptography@2.0:3.3,3.4.1:3.6', type=('run', 'test')) - depends_on('py-pyjwt@2.0.0:2+crypto', type=('run', 'test')) + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-requests@2.19.1:2', type=('build', 'run')) + depends_on('py-pyjwt@2.0.0:2+crypto', type=('build', 'run')) + depends_on('py-cryptography@2.0:3.3,3.4.1:3.6', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-gluoncv/package.py b/var/spack/repos/builtin/packages/py-gluoncv/package.py index daf315726f..6c6656a097 100644 --- a/var/spack/repos/builtin/packages/py-gluoncv/package.py +++ b/var/spack/repos/builtin/packages/py-gluoncv/package.py @@ -30,7 +30,5 @@ class PyGluoncv(PythonPackage): patch('no-unicode-readme.patch') - def build_args(self, spec, prefix): - args = [] - args.append('--with-cython') - return args + def install_options(self, spec, prefix): + return ['--with-cython'] diff --git a/var/spack/repos/builtin/packages/py-gnuplot/package.py b/var/spack/repos/builtin/packages/py-gnuplot/package.py index 6889ce41ab..451b0e1781 100644 --- a/var/spack/repos/builtin/packages/py-gnuplot/package.py +++ b/var/spack/repos/builtin/packages/py-gnuplot/package.py @@ -14,4 +14,6 @@ class PyGnuplot(PythonPackage): version('1.8', sha256='ab339be7847d30a8acfd616f27b5021bfde0999b7bf2d68400fbe62c53106e21') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-goatools/package.py b/var/spack/repos/builtin/packages/py-goatools/package.py index 2b6c27343e..8b7d638a5c 100644 --- a/var/spack/repos/builtin/packages/py-goatools/package.py +++ b/var/spack/repos/builtin/packages/py-goatools/package.py @@ -14,6 +14,7 @@ class PyGoatools(PythonPackage): version('0.7.11', sha256='753c6fb8c901367aa5d64ce5ad487d82903e424cf8ec7bac50ee069b307f6364') + depends_on('py-setuptools', type='build') depends_on('py-nose', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) depends_on('py-pandas', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-gosam/package.py b/var/spack/repos/builtin/packages/py-gosam/package.py index 4ef25dd5e3..d30c3c33cb 100644 --- a/var/spack/repos/builtin/packages/py-gosam/package.py +++ b/var/spack/repos/builtin/packages/py-gosam/package.py @@ -26,6 +26,8 @@ class PyGosam(PythonPackage): depends_on('gosam-contrib', type='link') depends_on('python@2.7.0:2.7', type=('build', 'run'), when='@:2.0.4') depends_on('python@3:', type=('build', 'run'), when='@2.1.1:') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') def setup_run_environment(self, env): gosam_contrib_lib_dir = self.spec['gosam-contrib'].prefix.lib diff --git a/var/spack/repos/builtin/packages/py-gpaw/package.py b/var/spack/repos/builtin/packages/py-gpaw/package.py index 3b0eff0433..906163e46b 100644 --- a/var/spack/repos/builtin/packages/py-gpaw/package.py +++ b/var/spack/repos/builtin/packages/py-gpaw/package.py @@ -30,6 +30,7 @@ class PyGpaw(PythonPackage): depends_on('python@2.6:', type=('build', 'run'), when='@:1.3.0') depends_on('python@3.5:', type=('build', 'run'), when='@19.8.1:') depends_on('python@3.6:', type=('build', 'run'), when='@20.10.0:') + depends_on('py-setuptools', type='build') depends_on('py-ase@3.13.0:', type=('build', 'run'), when='@1.3.0') depends_on('py-ase@3.18.0:', type=('build', 'run'), when='@19.8.1') depends_on('py-ase@3.19.0:', type=('build', 'run'), when='@20.1.0') diff --git a/var/spack/repos/builtin/packages/py-gputil/package.py b/var/spack/repos/builtin/packages/py-gputil/package.py index fd4e3af69b..8a5feb342a 100644 --- a/var/spack/repos/builtin/packages/py-gputil/package.py +++ b/var/spack/repos/builtin/packages/py-gputil/package.py @@ -16,9 +16,3 @@ class PyGputil(PythonPackage): version('1.4.0', sha256='099e52c65e512cdfa8c8763fca67f5a5c2afb63469602d5dcb4d296b3661efb9') depends_on('py-setuptools', type='build') - depends_on('py-wheel', type='build') - - def install(self, spec, prefix): - # Override install to avoid - # error: option --single-version-externally-managed not recognized - setup_py('install', '--root=/', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-gpyopt/package.py b/var/spack/repos/builtin/packages/py-gpyopt/package.py index 8f55126d1e..71bf007d79 100644 --- a/var/spack/repos/builtin/packages/py-gpyopt/package.py +++ b/var/spack/repos/builtin/packages/py-gpyopt/package.py @@ -22,4 +22,3 @@ class PyGpyopt(PythonPackage): depends_on('py-numpy@1.7:', type=('build', 'run')) depends_on('py-scipy@0.16:', type=('build', 'run')) depends_on('py-gpy@1.8:', type=('build', 'run')) - depends_on('py-matplotlib@1.3:', type=('test')) diff --git a/var/spack/repos/builtin/packages/py-greenlet/package.py b/var/spack/repos/builtin/packages/py-greenlet/package.py index eb438510e0..12beec3682 100644 --- a/var/spack/repos/builtin/packages/py-greenlet/package.py +++ b/var/spack/repos/builtin/packages/py-greenlet/package.py @@ -19,4 +19,4 @@ class PyGreenlet(PythonPackage): depends_on('python@2.7:2.8,3.5:', when='@1:', type=('build', 'link', 'run')) depends_on('python', when='@:0.9', type=('build', 'link', 'run')) - depends_on('py-setuptools', when='@1:', type='build') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-h5glance/package.py b/var/spack/repos/builtin/packages/py-h5glance/package.py index 885929a09e..866e1f0f95 100644 --- a/var/spack/repos/builtin/packages/py-h5glance/package.py +++ b/var/spack/repos/builtin/packages/py-h5glance/package.py @@ -20,5 +20,6 @@ class PyH5glance(PythonPackage): version('0.4', sha256='03babaee0d481991062842796126bc9e6b11e2e6e7daba57c26f2b58bf3bbd32') depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-flit', type='build') depends_on('py-h5py', type=('build', 'run')) depends_on('py-htmlgen', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-h5py/package.py b/var/spack/repos/builtin/packages/py-h5py/package.py index 7e99067990..31218fa817 100644 --- a/var/spack/repos/builtin/packages/py-h5py/package.py +++ b/var/spack/repos/builtin/packages/py-h5py/package.py @@ -69,8 +69,6 @@ class PyH5py(PythonPackage): depends_on('py-mpi4py@3.0.2:', when='@3.3.0:+mpi^python@3.0.0:3.7', type=('build', 'run')) depends_on('py-mpi4py@3.0.3:', when='@3.0.0:+mpi^python@3.8.0:', type=('build', 'run')) - phases = ['configure', 'install'] - def setup_build_environment(self, env): env.set('HDF5_DIR', self.spec['hdf5'].prefix) if '+mpi' in self.spec: @@ -80,14 +78,3 @@ class PyH5py(PythonPackage): # Disable build requirements meant for Python build tools, which pin # versions of numpy & mpi4py. env.set('H5PY_SETUP_REQUIRES', '0') - - @when('@3.0.0:') - def configure(self, spec, prefix): - pass - - @when('@:2') - def configure(self, spec, prefix): - self.setup_py('configure', '--hdf5={0}'.format(spec['hdf5'].prefix), - '--hdf5-version={0}'.format(spec['hdf5'].version)) - if '+mpi' in spec: - self.setup_py('configure', '--mpi') diff --git a/var/spack/repos/builtin/packages/py-heapdict/package.py b/var/spack/repos/builtin/packages/py-heapdict/package.py index 3b90b6b4c7..3b478b8f51 100644 --- a/var/spack/repos/builtin/packages/py-heapdict/package.py +++ b/var/spack/repos/builtin/packages/py-heapdict/package.py @@ -17,9 +17,3 @@ class PyHeapdict(PythonPackage): depends_on('python@2.6:', type=('build', 'run')) depends_on('py-setuptools', type='build') - - # Prevent passing --single-version-externally-managed to setup.py, to avoid - # error: option --single-version-externally-managed not recognized - @when('@1.0.0') - def install_args(self, spec, prefix): - return ['--prefix={0}'.format(prefix), '--root=/'] diff --git a/var/spack/repos/builtin/packages/py-humanize/package.py b/var/spack/repos/builtin/packages/py-humanize/package.py index 5ad7992088..98d5d8ba27 100644 --- a/var/spack/repos/builtin/packages/py-humanize/package.py +++ b/var/spack/repos/builtin/packages/py-humanize/package.py @@ -23,7 +23,6 @@ class PyHumanize(PythonPackage): depends_on('python@3.5:', when='@1.1.0:', type=('build', 'run')) depends_on('python@2.7:2,3.5:', when='@1.0.0', type=('build', 'run')) depends_on('py-setuptools@42:', when='@3.2:', type=('build', 'run')) - depends_on('py-setuptools', when='@3:', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-setuptools-scm+toml@3.4:', when='@3.2:', type='build') depends_on('py-setuptools-scm', when='@1:', type='build') diff --git a/var/spack/repos/builtin/packages/py-imageio-ffmpeg/package.py b/var/spack/repos/builtin/packages/py-imageio-ffmpeg/package.py index 421d6feb49..01b4e1a9ce 100644 --- a/var/spack/repos/builtin/packages/py-imageio-ffmpeg/package.py +++ b/var/spack/repos/builtin/packages/py-imageio-ffmpeg/package.py @@ -22,10 +22,7 @@ class PyImageioFfmpeg(PythonPackage): version('0.4.3', sha256='f826260a3207b872f1a4ba87ec0c8e02c00afba4fd03348a59049bdd8215841e') depends_on('python@3.4:', type=('build', 'run')) + depends_on('py-pip@19:', type='build') # Needs setuptools at runtime so that `import pkg_resources` succeeds depends_on('py-setuptools', type=('build', 'run')) depends_on('ffmpeg', type='run') - - def patch(self): - filter_file('setup_requires=["pip>19"]', 'setup_requires=[]', - 'setup.py', string=True) diff --git a/var/spack/repos/builtin/packages/py-importlib/package.py b/var/spack/repos/builtin/packages/py-importlib/package.py index d579632ee4..b4394f9bc6 100644 --- a/var/spack/repos/builtin/packages/py-importlib/package.py +++ b/var/spack/repos/builtin/packages/py-importlib/package.py @@ -13,3 +13,6 @@ class PyImportlib(PythonPackage): pypi = "importlib/importlib-1.0.4.zip" version('1.0.4', sha256='b6ee7066fea66e35f8d0acee24d98006de1a0a8a94a8ce6efe73a9a23c8d9826', deprecated=True) + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-inference-schema/package.py b/var/spack/repos/builtin/packages/py-inference-schema/package.py index b807709689..d82c5f701e 100644 --- a/var/spack/repos/builtin/packages/py-inference-schema/package.py +++ b/var/spack/repos/builtin/packages/py-inference-schema/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyInferenceSchema(Package): +class PyInferenceSchema(PythonPackage): """This package is intended to provide a uniform schema for common machine learning applications, as well as a set of decorators that can be used to aid in web based ML prediction applications.""" @@ -18,16 +18,10 @@ class PyInferenceSchema(Package): variant('pandas', default=False, description='Enable pandas support') variant('pyspark', default=False, description='Enable pyspark support') - extends('python') depends_on('python@3:', type=('build', 'run')) - depends_on('py-pip', type='build') depends_on('py-python-dateutil@2.5.3:', type=('build', 'run')) depends_on('py-pytz@2017.2:', type=('build', 'run')) depends_on('py-wrapt@1.11.1', type=('build', 'run')) depends_on('py-numpy@1.13.0:', when='+numpy', type=('build', 'run')) depends_on('py-pandas@0.20.2:', when='+pandas', type=('build', 'run')) depends_on('py-pyspark@2.3.2', when='+pyspark', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-iniparse/package.py b/var/spack/repos/builtin/packages/py-iniparse/package.py index a98fb889c6..f28c5a5f61 100644 --- a/var/spack/repos/builtin/packages/py-iniparse/package.py +++ b/var/spack/repos/builtin/packages/py-iniparse/package.py @@ -18,3 +18,5 @@ class PyIniparse(PythonPackage): depends_on('python@2.4:2.8', when='@:0.4', type=('build', 'run')) depends_on('python@2.6:2.8,3.3:', when='@master:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-installer/package.py b/var/spack/repos/builtin/packages/py-installer/package.py new file mode 100644 index 0000000000..5e3df1bdde --- /dev/null +++ b/var/spack/repos/builtin/packages/py-installer/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyInstaller(PythonPackage): + """A library for installing Python wheels.""" + + homepage = "https://github.com/pradyunsg/installer" + pypi = "installer/installer-0.4.0.tar.gz" + + version('0.4.0', sha256='17d7ca174039fbd85f268e16042e3132ebb03d91e1bbe0f63b9ec6b40619414a') + + depends_on('python@2.7,3.5:', type=('build', 'run')) + depends_on('py-flit-core@2', type='build') + depends_on('py-configparser@3.5:', when='^python@:2', type=('build', 'run')) + depends_on('py-importlib-resources', when='^python@:3.6', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-intel-openmp/package.py b/var/spack/repos/builtin/packages/py-intel-openmp/package.py index dfa02c55d8..86da24e99d 100644 --- a/var/spack/repos/builtin/packages/py-intel-openmp/package.py +++ b/var/spack/repos/builtin/packages/py-intel-openmp/package.py @@ -8,7 +8,7 @@ import sys from spack import * -class PyIntelOpenmp(Package): +class PyIntelOpenmp(PythonPackage): """Intel OpenMP* Runtime Library x86_64 dynamic libraries for macOS*. Intel OpenMP* Runtime Library provides OpenMP API specification support in Intel C Compiler, Intel C++ @@ -29,9 +29,3 @@ class PyIntelOpenmp(Package): url='https://pypi.io/packages/py2.py3/i/intel-openmp/intel_openmp-2021.1.2-py2.py3-none-macosx_10_15_x86_64.whl', sha256='2af893738b4b06cb0183746f2992169111031340b59c84a0fd4dec1ed66b80f2', expand=False) - - depends_on('py-pip', type='build') - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-ipycanvas/package.py b/var/spack/repos/builtin/packages/py-ipycanvas/package.py index efd6045754..0b38f95e73 100644 --- a/var/spack/repos/builtin/packages/py-ipycanvas/package.py +++ b/var/spack/repos/builtin/packages/py-ipycanvas/package.py @@ -12,11 +12,14 @@ class PyIpycanvas(PythonPackage): homepage = "https://github.com/martinRenou/ipycanvas" pypi = "ipycanvas/ipycanvas-0.9.0.tar.gz" + version('0.10.2', sha256='a02c494834cb3c60509801172e7429beae837b3cb6c61d3becf8b586c5a66004') version('0.9.0', sha256='f29e56b93fe765ceace0676c3e75d44e02a3ff6c806f3b7e5b869279f470cc43') depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools@40.8:', type='build') - depends_on('py-jupyter-packaging@0.7.0:0.7', type='build') + # TODO: replace this after concretizer learns how to concretize separate build deps + depends_on('py-jupyter-packaging7', type='build') + # depends_on('py-jupyter-packaging@0.7.0:0.7', type='build') depends_on('py-jupyterlab@3.0:3', type='build') depends_on('py-ipywidgets@7.6:', type=('build', 'run')) depends_on('pil@6:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-ipyevents/package.py b/var/spack/repos/builtin/packages/py-ipyevents/package.py index bdd4137074..51f0c20943 100644 --- a/var/spack/repos/builtin/packages/py-ipyevents/package.py +++ b/var/spack/repos/builtin/packages/py-ipyevents/package.py @@ -16,6 +16,8 @@ class PyIpyevents(PythonPackage): depends_on('python@3.6:', type=('build', 'run')) depends_on('py-setuptools@40.8:', type='build') - depends_on('py-jupyter-packaging@0.7.0:0.7', type='build') + # TODO: replace this after concretizer learns how to concretize separate build deps + depends_on('py-jupyter-packaging7', type='build') + # depends_on('py-jupyter-packaging@0.7.0:0.7', type='build') depends_on('py-jupyterlab@3.0:3', type='build') depends_on('py-ipywidgets@7.6:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-ipykernel/package.py b/var/spack/repos/builtin/packages/py-ipykernel/package.py index 3d2fbfd5a1..fb8a9978ec 100644 --- a/var/spack/repos/builtin/packages/py-ipykernel/package.py +++ b/var/spack/repos/builtin/packages/py-ipykernel/package.py @@ -55,9 +55,8 @@ class PyIpykernel(PythonPackage): depends_on('py-matplotlib-inline@0.1.0:0.1', when='@6:', type=('build', 'run')) depends_on('py-appnope', when='platform=darwin', type=('build', 'run')) - phases = ['build', 'install', 'install_data'] - - def install_data(self, spec, prefix): + @run_after('install') + def install_data(self): """ install the Jupyter kernel spec """ self.spec['python'].command( - '-m', 'ipykernel', 'install', '--prefix=' + prefix) + '-m', 'ipykernel', 'install', '--prefix=' + self.prefix) diff --git a/var/spack/repos/builtin/packages/py-ipyparallel/package.py b/var/spack/repos/builtin/packages/py-ipyparallel/package.py index 56ae7e7d44..22b2d7821f 100644 --- a/var/spack/repos/builtin/packages/py-ipyparallel/package.py +++ b/var/spack/repos/builtin/packages/py-ipyparallel/package.py @@ -12,28 +12,32 @@ class PyIpyparallel(PythonPackage): homepage = "https://github.com/ipython/ipyparallel" pypi = "ipyparallel/ipyparallel-7.1.0.tar.gz" + version('8.0.0', sha256='95305a886f2c42e9603c034ea684e5c031d9d4222c66ed6d85eb3ae15d631e4b') version('7.1.0', sha256='ea756df0d2485bac19cccb0dbf4cafbc855c922b9b5905b4906e6cfac8b3c648') version('6.3.0', sha256='0a97b276c62db633e9e97a816282bdd166f9df74e28204f0c8fa54b71944cfdc') version('6.2.5', sha256='33416179665f9c2f567011ab1a618232bc32c0845c0a3a5c388f6c71048bc053') version('6.2.4', sha256='76c7b028962b0ba762e4e45b450ee3a4353e7221526a8af812e817d7ef6ac065') - depends_on('python@3.5:', type=('build', 'run')) - depends_on('python@3.6:', type=('build', 'run'), when='@7.1.0:') + depends_on('python@3.6:', type=('build', 'run'), when='@7.1:') + depends_on('python@3.5:', type=('build', 'run'), when='@6.3:') + depends_on('python@2.7,3.4:', type=('build', 'run')) - depends_on('py-setuptools', type='build') - depends_on('py-jupyter-packaging', type='build') + depends_on('py-jupyterlab@3.0:3', type='build', when='@7.1:') + depends_on('py-packaging', type='build', when='@7.1:') + depends_on('py-setuptools@40.8:', type='build', when='@7.1:') + depends_on('py-setuptools', type='build') - depends_on('py-ipython-genutils', type=('build', 'run'), when='@:6.3.0') + depends_on('py-ipython-genutils', type=('build', 'run'), when='@:6.3') + depends_on('py-entrypoints', type=('build', 'run'), when='@7.1:') depends_on('py-decorator', type=('build', 'run')) + depends_on('py-pyzmq@18:', type=('build', 'run'), when='@7.1:') depends_on('py-pyzmq@13:', type=('build', 'run')) - depends_on('py-pyzmq@18:', type=('build', 'run'), when='@7.1.0:') depends_on('py-traitlets@4.3:', type=('build', 'run')) depends_on('py-ipython@4:', type=('build', 'run')) depends_on('py-jupyter-client', type=('build', 'run')) depends_on('py-ipykernel@4.4:', type=('build', 'run')) - depends_on('py-python-dateutil@2.1:', type=('build', 'run')) + depends_on('py-tornado@5.1:', type=('build', 'run'), when='@7.1:') depends_on('py-tornado@4:', type=('build', 'run')) - depends_on('py-tornado@5.1:', type=('build', 'run'), when='@7.1.0:') - depends_on('py-entrypoints', type=('build', 'run'), when='@7.1.0:') - depends_on('py-psutil', type=('build', 'run'), when='@7.1.0:') - depends_on('py-tqdm', type=('build', 'run'), when='@7.1.0:') + depends_on('py-psutil', type=('build', 'run'), when='@7.1:') + depends_on('py-python-dateutil@2.1:', type=('build', 'run')) + depends_on('py-tqdm', type=('build', 'run'), when='@7.1:') diff --git a/var/spack/repos/builtin/packages/py-ipython-genutils/package.py b/var/spack/repos/builtin/packages/py-ipython-genutils/package.py index b91e3fd3e2..2c88bd6152 100644 --- a/var/spack/repos/builtin/packages/py-ipython-genutils/package.py +++ b/var/spack/repos/builtin/packages/py-ipython-genutils/package.py @@ -14,4 +14,5 @@ class PyIpythonGenutils(PythonPackage): version('0.2.0', sha256='eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8') version('0.1.0', sha256='3a0624a251a26463c9dfa0ffa635ec51c4265380980d9a50d65611c3c2bd82a6') - depends_on('python@2.7:2.8,3.3:') + depends_on('python@2.7:2.8,3.3:', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-ipywidgets/package.py b/var/spack/repos/builtin/packages/py-ipywidgets/package.py index 4ea627e41d..e258a6b50b 100644 --- a/var/spack/repos/builtin/packages/py-ipywidgets/package.py +++ b/var/spack/repos/builtin/packages/py-ipywidgets/package.py @@ -19,6 +19,8 @@ class PyIpywidgets(PythonPackage): version('5.2.2', sha256='baf6098f054dd5eacc2934b8ea3bef908b81ca8660d839f1f940255a72c660d2') depends_on('python@2.7:2.8,3.3:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-ipython@4:', type=('build', 'run')) depends_on('py-ipython@4:5', type=('build', 'run'), when='^python@:3.2') depends_on('py-jupyterlab-widgets@1.0.0:', type=('build', 'run'), diff --git a/var/spack/repos/builtin/packages/py-isort/package.py b/var/spack/repos/builtin/packages/py-isort/package.py index 5ed04c3d4e..f641e5ae7b 100644 --- a/var/spack/repos/builtin/packages/py-isort/package.py +++ b/var/spack/repos/builtin/packages/py-isort/package.py @@ -22,7 +22,7 @@ class PyIsort(PythonPackage): depends_on('python@3.6.1:3', type=('build', 'run'), when='@5:') depends_on('python@2.7:2.8,3.4:', type=('build', 'run'), when='@4.3:') depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) - depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-poetry-core@1:', type='build') depends_on('py-futures', type=('build', 'run'), when='@4.3:4 ^python@:3.1') depends_on('py-backports-functools-lru-cache', type=('build', 'run'), when='@4.3.10:4 ^python@:3.1') depends_on('py-colorama@0.4.3:0.4', type=('build', 'run'), when='+colors') diff --git a/var/spack/repos/builtin/packages/py-itk/package.py b/var/spack/repos/builtin/packages/py-itk/package.py index ffb04b752e..5c386c893c 100644 --- a/var/spack/repos/builtin/packages/py-itk/package.py +++ b/var/spack/repos/builtin/packages/py-itk/package.py @@ -10,7 +10,7 @@ import archspec from spack import * -class PyItk(Package): +class PyItk(PythonPackage): """ITK is an open-source toolkit for multidimensional image analysis""" homepage = "https://itk.org/" @@ -86,21 +86,13 @@ class PyItk(Package): sha256='5781b74410b7189a825c89d370411595e5e3d5dbb480201907f751f26698df83', expand=False) - extends('python') - depends_on('py-pip', type='build') - depends_on('python@3.5.0:3.5', when='@5.1.1-cp35', type=('build', 'run')) depends_on('python@3.6.0:3.6', when='@5.1.1-cp36,5.1.2-cp36', type=('build', 'run')) depends_on('python@3.7.0:3.7', when='@5.1.1-cp37,5.1.2-cp37', type=('build', 'run')) depends_on('python@3.8.0:3.8', when='@5.1.1-cp38,5.1.2-cp38', type=('build', 'run')) depends_on('python@3.9.0:3.9', when='@5.1.2-cp39', type=('build', 'run')) - depends_on('py-setuptools', type='run') for t in set([str(x.family) for x in archspec.cpu.TARGETS.values() if str(x.family) != 'x86_64']): conflicts('target={0}:'.format(t), msg='py-itk is available for x86_64 only') - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-jdatetime/package.py b/var/spack/repos/builtin/packages/py-jdatetime/package.py index fff18c8315..9c0c708b3d 100644 --- a/var/spack/repos/builtin/packages/py-jdatetime/package.py +++ b/var/spack/repos/builtin/packages/py-jdatetime/package.py @@ -13,3 +13,6 @@ class PyJdatetime(PythonPackage): pypi = "jdatetime/jdatetime-3.6.2.tar.gz" version('3.6.2', sha256='a589e35f0dab89283c1a3de9d70ed6cf657932aaed8e8ce1b0e5801aaab1da67') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-jeepney/package.py b/var/spack/repos/builtin/packages/py-jeepney/package.py index 356f14b302..4c347f66f5 100644 --- a/var/spack/repos/builtin/packages/py-jeepney/package.py +++ b/var/spack/repos/builtin/packages/py-jeepney/package.py @@ -16,3 +16,4 @@ class PyJeepney(PythonPackage): depends_on('python@3.6:', when='@0.5:', type=('build', 'run')) depends_on('python@3.5:', when='@:0.4', type=('build', 'run')) + depends_on('py-flit-core@2:3', type='build') diff --git a/var/spack/repos/builtin/packages/py-joblib/package.py b/var/spack/repos/builtin/packages/py-joblib/package.py index bab10e2c88..18d1a52d0d 100644 --- a/var/spack/repos/builtin/packages/py-joblib/package.py +++ b/var/spack/repos/builtin/packages/py-joblib/package.py @@ -35,4 +35,4 @@ class PyJoblib(PythonPackage): depends_on('python@3.6:', when='@0.15:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) - depends_on('py-setuptools', when='@0.14:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jplephem/package.py b/var/spack/repos/builtin/packages/py-jplephem/package.py index 08508f7458..92dc09b2c9 100644 --- a/var/spack/repos/builtin/packages/py-jplephem/package.py +++ b/var/spack/repos/builtin/packages/py-jplephem/package.py @@ -15,4 +15,6 @@ class PyJplephem(PythonPackage): version('2.9', sha256='9dffb9f3d3f6d996ade875102431fe385e8ea422da25c8ba17b0508d9ca1282b') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-core/package.py b/var/spack/repos/builtin/packages/py-jupyter-core/package.py index 357c89478e..332e282706 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-core/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-core/package.py @@ -31,6 +31,6 @@ class PyJupyterCore(PythonPackage): depends_on('python@3.6:', when='@4.7:', type=('build', 'run')) depends_on('python@2.7:2.8,3.5:', when='@4.6.2:', type=('build', 'run')) depends_on('python@2.7:2.8,3.3:', type=('build', 'run')) - depends_on('py-setuptools', when='@4.5.0:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) depends_on('py-traitlets', type=('build', 'run')) # additional pywin32>=1.0 dependency for windows diff --git a/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py b/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py index b0a4747950..26bc0d0563 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py @@ -12,15 +12,18 @@ class PyJupyterPackaging(PythonPackage): homepage = "https://github.com/jupyter/jupyter-packaging" pypi = "jupyter_packaging/jupyter_packaging-0.10.4.tar.gz" + version('0.11.1', sha256='6f5c7eeea98f7f3c8fb41d565a94bf59791768a93f93148b3c2dfb7ebade8eec') version('0.10.6', sha256='a8a2c90bf2e0cae83be63ccb0b7035032a1589f268cc08b1d479e37ce50fc940') version('0.10.4', sha256='589db027cb85a92612f9bcfaeecaa8a9072ac8a4bddaf827f648664258e587c4') version('0.7.12', sha256='b140325771881a7df7b7f2d14997b619063fe75ae756b9025852e4346000bbb8', # name has a '-' instead of a '_' url='https://files.pythonhosted.org/packages/source/j/jupyter_packaging/jupyter-packaging-0.7.12.tar.gz') + depends_on('python@3.7:', when='@0.11:', type=('build', 'run')) depends_on('python@3.6:', type=('build', 'run')) - depends_on('py-setuptools@46.4.0:', type=('build', 'run')) depends_on('py-packaging', type=('build', 'run')) - depends_on('py-tomlkit', when='@0.8.0:', type=('build', 'run')) - depends_on('py-wheel', when='@0.8.0:', type=('build', 'run')) - depends_on('py-deprecation', when='@0.8.0:', type=('build', 'run')) + depends_on('py-tomlkit', when='@0.8:', type=('build', 'run')) + depends_on('py-setuptools@46.4:', when='@0.8:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-wheel', when='@0.8:', type=('build', 'run')) + depends_on('py-deprecation', when='@0.8:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-packaging11/package.py b/var/spack/repos/builtin/packages/py-jupyter-packaging11/package.py new file mode 100644 index 0000000000..c6ac41fa08 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-jupyter-packaging11/package.py @@ -0,0 +1,26 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyJupyterPackaging11(PythonPackage): + """Jupyter Packaging Utilities, version 11.""" + + # TODO: This package only exists because different packages in the Jupyter ecosystem + # require different versions of jupyter_packaging. Once the concretizer is capable + # of concretizing build dependencies separately, this package should be removed. + + homepage = "https://github.com/jupyter/jupyter-packaging" + pypi = "jupyter_packaging/jupyter_packaging-0.11.1.tar.gz" + + version('0.11.1', sha256='6f5c7eeea98f7f3c8fb41d565a94bf59791768a93f93148b3c2dfb7ebade8eec') + + depends_on('python@3.7:', type=('build', 'run')) + depends_on('py-packaging', type=('build', 'run')) + depends_on('py-tomlkit', type=('build', 'run')) + depends_on('py-setuptools@46.4:', type=('build', 'run')) + depends_on('py-wheel', type=('build', 'run')) + depends_on('py-deprecation', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-packaging7/package.py b/var/spack/repos/builtin/packages/py-jupyter-packaging7/package.py new file mode 100644 index 0000000000..ddac0bc256 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-jupyter-packaging7/package.py @@ -0,0 +1,23 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyJupyterPackaging7(PythonPackage): + """Jupyter Packaging Utilities, version 7.""" + + # TODO: This package only exists because different packages in the Jupyter ecosystem + # require different versions of jupyter_packaging. Once the concretizer is capable + # of concretizing build dependencies separately, this package should be removed. + + homepage = "https://github.com/jupyter/jupyter-packaging" + pypi = "jupyter_packaging/jupyter-packaging-0.7.12.tar.gz" + + version('0.7.12', sha256='b140325771881a7df7b7f2d14997b619063fe75ae756b9025852e4346000bbb8') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-packaging', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-server/package.py b/var/spack/repos/builtin/packages/py-jupyter-server/package.py index bf4ddb57b5..f68ca26e68 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-server/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-server/package.py @@ -49,8 +49,12 @@ class PyJupyterServer(PythonPackage): version('1.11.0', sha256='8ab4f484a4a2698f757cff0769d27b5d991e0232a666d54f4d6ada4e6a61330b') version('1.10.2', sha256='d3a3b68ebc6d7bfee1097f1712cf7709ee39c92379da2cc08724515bb85e72bf') version('1.9.0', sha256='7d19006380f6217458a9db309b54e3dab87ced6c06329c61823907bef2a6f51b') + version('1.6.1', sha256='242ddd0b644f10e030f917019b47c381e0f2d2b950164af45cbd791d572198ac') depends_on('python@3.6:', type=('build', 'run')) + # TODO: replace this after concretizer learns how to concretize separate build deps + depends_on('py-jupyter-packaging11', when='@1.6.2:', type='build') + # depends_on('py-jupyter-packaging@0.9:0', when='@1.6.2:', type='build') depends_on('py-setuptools', type='build') depends_on('py-jinja2', type=('build', 'run')) depends_on('py-tornado@6.1:', type=('build', 'run')) @@ -68,4 +72,3 @@ class PyJupyterServer(PythonPackage): depends_on('py-anyio@3.1.0:3', type=('build', 'run')) depends_on('py-websocket-client', type=('build', 'run')) depends_on('py-requests-unixsocket', type=('build', 'run'), when='@:1.11.1') - depends_on('py-jupyter-packaging@0.9:1', type=('build', 'run'), when='@1.10.2:') diff --git a/var/spack/repos/builtin/packages/py-jupyter/package.py b/var/spack/repos/builtin/packages/py-jupyter/package.py index b1b15ffdad..0ca71907cc 100644 --- a/var/spack/repos/builtin/packages/py-jupyter/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter/package.py @@ -14,6 +14,8 @@ class PyJupyter(PythonPackage): version('1.0.0', sha256='d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-notebook', type=('build', 'run')) depends_on('py-qtconsole', type=('build', 'run')) depends_on('py-jupyter-console', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py b/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py index f1a0b1e0c9..92465b9631 100644 --- a/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py +++ b/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py @@ -18,6 +18,9 @@ class PyJupyterlabServer(PythonPackage): depends_on('python@3.6:', when='@2.5:', type=('build', 'run')) depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools', type='build') + # TODO: replace this after concretizer learns how to concretize separate build deps + depends_on('py-jupyter-packaging11', type='build') + # depends_on('py-jupyter-packaging@0.9:0', type='build') depends_on('py-requests', type=('build', 'run')) depends_on('py-json5', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyterlab-widgets/package.py b/var/spack/repos/builtin/packages/py-jupyterlab-widgets/package.py index ba0cfc11b2..70e18ca6a3 100644 --- a/var/spack/repos/builtin/packages/py-jupyterlab-widgets/package.py +++ b/var/spack/repos/builtin/packages/py-jupyterlab-widgets/package.py @@ -10,11 +10,15 @@ class PyJupyterlabWidgets(PythonPackage): """A JupyterLab extension.""" homepage = "https://github.com/jupyter-widgets/ipywidgets" - pypi = "jupyterlab_widgets/jupyterlab_widgets-1.0.2.tar.gz" + # Source is also available, but I'm having issues getting it to build: + # https://github.com/jupyter-widgets/ipywidgets/issues/3324 + url = "https://files.pythonhosted.org/packages/py3/j/jupyterlab_widgets/jupyterlab_widgets-1.0.2-py3-none-any.whl" - version('1.0.2', sha256='7885092b2b96bf189c3a705cc3c412a4472ec5e8382d0b47219a66cccae73cfa') + version('1.0.2', sha256='f5d9efface8ec62941173ba1cffb2edd0ecddc801c11ae2931e30b50492eb8f7', expand=False) depends_on('python@3.6:', type=('build', 'run')) depends_on('py-setuptools@40.8.0:', type='build') - depends_on('py-jupyter-packaging@0.7.9:0.7', type='build') + # TODO: replace this after concretizer learns how to concretize separate build deps + depends_on('py-jupyter-packaging7', type='build') + # depends_on('py-jupyter-packaging@0.7.9:0.7', type='build') depends_on('py-jupyterlab@3.0:3', type='build') diff --git a/var/spack/repos/builtin/packages/py-jupyterlab/package.py b/var/spack/repos/builtin/packages/py-jupyterlab/package.py index d1b466a0d7..3161642022 100644 --- a/var/spack/repos/builtin/packages/py-jupyterlab/package.py +++ b/var/spack/repos/builtin/packages/py-jupyterlab/package.py @@ -26,8 +26,12 @@ class PyJupyterlab(PythonPackage): depends_on('python@3.6:', when='@3:', type=('build', 'run')) depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run')) - depends_on('py-jupyter-packaging@0.9:1', when='@3.0.15:', type='build') - depends_on('py-jupyter-packaging@0.7.3:0.7', when='@3.0.0:3.0.14', type=('build', 'run')) + # TODO: replace this after concretizer learns how to concretize separate build deps + depends_on('py-jupyter-packaging11', when='@3.0.15:', type='build') + depends_on('py-jupyter-packaging7', when='@3.0.0:3.0.14', type='build') + # depends_on('py-jupyter-packaging@0.9:0', when='@3.0.15:', type='build') + # depends_on('py-jupyter-packaging@0.7.3:0.7', when='@3.0.0:3.0.14', + # type=('build', 'run')) # dependency on py-jinja2@2.1 seems to be a migration issue from the switch # to setup.cfg in 3.0.15, leave it a 2.10 depends_on('py-jinja2@2.10:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-keyring/package.py b/var/spack/repos/builtin/packages/py-keyring/package.py index 325dde48aa..bf19f4c684 100644 --- a/var/spack/repos/builtin/packages/py-keyring/package.py +++ b/var/spack/repos/builtin/packages/py-keyring/package.py @@ -18,13 +18,25 @@ class PyKeyring(PythonPackage): version('23.2.0', sha256='1e1970dcecde00c59ff6033d69cee3b283cd0d7cbad78b0dc4cdd15c8a28bcf8') version('23.1.0', sha256='b7e0156667f5dcc73c1f63a518005cd18a4eb23fe77321194fefcc03748b21a4') version('23.0.1', sha256='045703609dd3fccfcdb27da201684278823b72af515aedec1a8515719a038cb8') + version('21.7.0', sha256='a144f7e1044c897c3976202af868cb0ac860f4d433d5d0f8e750fa1a2f0f0b50') + version('20.0.1', sha256='963bfa7f090269d30bdc5e25589e5fd9dad2cf2a7c6f176a7f2386910e5d0d8d') + version('18.0.1', sha256='67d6cc0132bd77922725fae9f18366bb314fd8f95ff4d323a4df41890a96a838') - depends_on('python@3.6:', type=('build', 'run')) - depends_on('py-setuptools@42:', type='build') - depends_on('py-setuptools@56:', type='build', when='@23.1.0:') - depends_on('py-setuptools-scm@3.4.1:+toml', type='build') - depends_on('py-importlib-metadata@3.6:', type=('build', 'run')) - depends_on('py-secretstorage@3.2:', type=('build', 'run'), when='platform=linux') - depends_on('py-jeepney@0.4.2:', type=('build', 'run'), when='platform=linux') + depends_on('python@3.6:', when='@21:', type=('build', 'run')) + depends_on('python@3.5:', when='@20:', type=('build', 'run')) + depends_on('python@2.7:', type=('build', 'run')) + depends_on('py-setuptools@56:', when='@23.1:', type='build') + depends_on('py-setuptools@42:', when='@21:', type='build') + depends_on('py-setuptools@34.4:', type='build') + depends_on('py-setuptools-scm@3.4.1:+toml', when='@21:', type='build') + depends_on('py-setuptools-scm@1.15:', type='build') + depends_on('py-entrypoints', when='@18', type=('build', 'run')) + depends_on('py-secretstorage', when='platform=linux', type=('build', 'run')) + depends_on('py-secretstorage@:2', when='@18 ^python@:3.4 platform=linux', type=('build', 'run')) + depends_on('py-secretstorage@3.2:', when='@21: platform=linux', type=('build', 'run')) + depends_on('py-jeepney@0.4.2:', when='@21: platform=linux', type=('build', 'run')) + depends_on('py-importlib-metadata', when='@20:', type=('build', 'run')) + depends_on('py-importlib-metadata@1:', when='@21:', type=('build', 'run')) + depends_on('py-importlib-metadata@3.6:', when='@23:', type=('build', 'run')) # TODO: additional dependency on pywin32-ctypes required for Windows diff --git a/var/spack/repos/builtin/packages/py-kiwisolver/package.py b/var/spack/repos/builtin/packages/py-kiwisolver/package.py index 1c153d41c2..a19f6211c1 100644 --- a/var/spack/repos/builtin/packages/py-kiwisolver/package.py +++ b/var/spack/repos/builtin/packages/py-kiwisolver/package.py @@ -20,8 +20,7 @@ class PyKiwisolver(PythonPackage): version('1.0.1', sha256='ce3be5d520b4d2c3e5eeb4cd2ef62b9b9ab8ac6b6fedbaa0e39cdb6f50644278') depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) - depends_on('python@3.5:', type=('build', 'run'), when='@1.2.0:') - depends_on('python@3.6:', type=('build', 'run'), when='@1.3.0:') + depends_on('python@3.6:', type=('build', 'run'), when='@1.2.0:') depends_on('python@3.7:', type=('build', 'run'), when='@1.3.2:') depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-lazyarray/package.py b/var/spack/repos/builtin/packages/py-lazyarray/package.py index 21e6dc6da2..99a63ced4c 100644 --- a/var/spack/repos/builtin/packages/py-lazyarray/package.py +++ b/var/spack/repos/builtin/packages/py-lazyarray/package.py @@ -20,6 +20,7 @@ class PyLazyarray(PythonPackage): # Required versions come from doc/installation.txt or: # https://lazyarray.readthedocs.io/en/latest/installation.html#dependencies depends_on('python@2.7:', when='@0.3:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-numpy@1.3:', type=('build', 'run')) depends_on('py-numpy@1.8:', type=('build', 'run'), when='@0.3:') depends_on('py-numpy@1.5:', type=('build', 'run'), when='^python@3:') diff --git a/var/spack/repos/builtin/packages/py-lightgbm/package.py b/var/spack/repos/builtin/packages/py-lightgbm/package.py index e5d1fd901d..9710d01e42 100644 --- a/var/spack/repos/builtin/packages/py-lightgbm/package.py +++ b/var/spack/repos/builtin/packages/py-lightgbm/package.py @@ -27,7 +27,7 @@ class PyLightgbm(PythonPackage): depends_on('mpi', when='+mpi') - def install_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] if spec.satisfies('+mpi'): diff --git a/var/spack/repos/builtin/packages/py-line-profiler/package.py b/var/spack/repos/builtin/packages/py-line-profiler/package.py index dd6167db48..7fcc6ac7e0 100644 --- a/var/spack/repos/builtin/packages/py-line-profiler/package.py +++ b/var/spack/repos/builtin/packages/py-line-profiler/package.py @@ -23,7 +23,7 @@ class PyLineProfiler(PythonPackage): depends_on('py-ipython@0.13:', type=('build', 'run')) # See https://github.com/rkern/line_profiler/issues/166 - @run_before('build') + @run_before('install') def fix_cython(self): # TODO: Replace the check with a `@when('^python@3.7:')` decorator once # https://github.com/spack/spack/issues/12736 is resolved diff --git a/var/spack/repos/builtin/packages/py-locket/package.py b/var/spack/repos/builtin/packages/py-locket/package.py index b90423b9c3..60da805031 100644 --- a/var/spack/repos/builtin/packages/py-locket/package.py +++ b/var/spack/repos/builtin/packages/py-locket/package.py @@ -13,3 +13,6 @@ class PyLocket(PythonPackage): pypi = "locket/locket-0.2.0.tar.gz" version('0.2.0', sha256='1fee63c1153db602b50154684f5725564e63a0f6d09366a1cb13dffcec179fb4') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py index 247fd9fc90..2856f90ce3 100644 --- a/var/spack/repos/builtin/packages/py-matplotlib/package.py +++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py @@ -192,7 +192,7 @@ class PyMatplotlib(PythonPackage): env.set('CPATH', ':'.join(include)) env.set('LIBRARY_PATH', ':'.join(library)) - @run_before('build') + @run_before('install') def configure(self): """Set build options with regards to backend GUI libraries.""" @@ -213,7 +213,7 @@ class PyMatplotlib(PythonPackage): if self.spec.satisfies('%clang') or self.spec.satisfies('%oneapi'): config.write('enable_lto = False\n') - @run_after('build') + @run_after('install') @on_package_attributes(run_tests=True) def build_test(self): pytest = which('pytest') diff --git a/var/spack/repos/builtin/packages/py-meshio/package.py b/var/spack/repos/builtin/packages/py-meshio/package.py index 9cf921b8f4..9d15adcdd4 100644 --- a/var/spack/repos/builtin/packages/py-meshio/package.py +++ b/var/spack/repos/builtin/packages/py-meshio/package.py @@ -16,10 +16,6 @@ class PyMeshio(PythonPackage): version('5.0.0', sha256='f6327c06d6171d30e0991d3dcb048751035f9cfac1f19e2444971275fd971188') version('4.4.6', sha256='be352a0924c9eff99768a6f402b7558dbb280bbf1e7bf43f18cef92db418684f') - # MeshIO uses a setup.cfg/pyproject.toml structure, which spack doesn't yet handle. - # This patch adds a small setup.py file that spack can call. - patch('setup.patch') - depends_on('python@3.7:', when='@5.0.0:', type=('build', 'run')) depends_on('python@3.6:', type=('build', 'run')) depends_on('py-setuptools@42:', type='build') diff --git a/var/spack/repos/builtin/packages/py-meshio/setup.patch b/var/spack/repos/builtin/packages/py-meshio/setup.patch deleted file mode 100644 index 77089e871f..0000000000 --- a/var/spack/repos/builtin/packages/py-meshio/setup.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/setup.py b/setup.py -new file mode 100644 -index 0000000..7f1a176 ---- /dev/null -+++ b/setup.py -@@ -0,0 +1,4 @@ -+from setuptools import setup -+ -+if __name__ == "__main__": -+ setup() diff --git a/var/spack/repos/builtin/packages/py-mikado/package.py b/var/spack/repos/builtin/packages/py-mikado/package.py index 83a32b846f..ec8c232d06 100644 --- a/var/spack/repos/builtin/packages/py-mikado/package.py +++ b/var/spack/repos/builtin/packages/py-mikado/package.py @@ -16,6 +16,7 @@ class PyMikado(PythonPackage): version('1.2.4', sha256='c0485dba3b7c285599809e058c83f33b5efa9522d20d9f980423410604207f61') + depends_on('py-setuptools', type='build') depends_on('py-wheel@0.28.0:', type='build') depends_on('py-pyyaml', type=('build', 'run')) depends_on('py-jsonschema', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-mmcv/package.py b/var/spack/repos/builtin/packages/py-mmcv/package.py index f328ec4c50..07650a4513 100644 --- a/var/spack/repos/builtin/packages/py-mmcv/package.py +++ b/var/spack/repos/builtin/packages/py-mmcv/package.py @@ -17,6 +17,7 @@ class PyMmcv(PythonPackage): version('0.5.1', sha256='7c5ad30d9b61e44019e81ef46c406aa85dd08b5d0ba12ddd5cdc9c445835a55e') depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-addict', type=('build', 'run')) depends_on('py-numpy@1.11.1:', type=('build', 'run')) depends_on('py-pyyaml', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-mne/package.py b/var/spack/repos/builtin/packages/py-mne/package.py index 9f6b4522f9..7dfc23727c 100644 --- a/var/spack/repos/builtin/packages/py-mne/package.py +++ b/var/spack/repos/builtin/packages/py-mne/package.py @@ -26,8 +26,6 @@ class PyMne(PythonPackage): depends_on('py-scipy@1.1.0:', when='@0.23:', type=('build', 'run')) depends_on('py-scipy@0.17.1:', type=('build', 'run')) - depends_on('py-tqdm', type='test') - with when('+full'): # requirements.txt with versions specified in README.rst (marked with *) depends_on('py-matplotlib@3.0.3:', type=('build', 'run')) # * diff --git a/var/spack/repos/builtin/packages/py-mo-pack/package.py b/var/spack/repos/builtin/packages/py-mo-pack/package.py index bbbe0ee6c3..40a3cdd59a 100644 --- a/var/spack/repos/builtin/packages/py-mo-pack/package.py +++ b/var/spack/repos/builtin/packages/py-mo-pack/package.py @@ -16,6 +16,7 @@ class PyMoPack(PythonPackage): version('0.2.0', sha256='4aa70e1f846b666670843bc2514435dedf7393203e88abaf74d48f8f2717a726') depends_on('libmo-unpack') + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-cython', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-mpi4py/package.py b/var/spack/repos/builtin/packages/py-mpi4py/package.py index a81ae537f4..0034eccf36 100644 --- a/var/spack/repos/builtin/packages/py-mpi4py/package.py +++ b/var/spack/repos/builtin/packages/py-mpi4py/package.py @@ -32,7 +32,7 @@ class PyMpi4py(PythonPackage): depends_on('py-cython@0.27.0:', when='@master', type='build') depends_on('py-3to2', when='@3.1: ^python@:2', type='build') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): return ['--mpicc=%s -shared' % spec['mpi'].mpicc] @property diff --git a/var/spack/repos/builtin/packages/py-multi-key-dict/package.py b/var/spack/repos/builtin/packages/py-multi-key-dict/package.py index 37ab4f83fe..977eb3c9f5 100644 --- a/var/spack/repos/builtin/packages/py-multi-key-dict/package.py +++ b/var/spack/repos/builtin/packages/py-multi-key-dict/package.py @@ -13,3 +13,6 @@ class PyMultiKeyDict(PythonPackage): pypi = "multi_key_dict/multi_key_dict-2.0.3.tar.gz" version('2.0.3', sha256='deebdec17aa30a1c432cb3f437e81f8621e1c0542a0c0617a74f71e232e9939e') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-mx/package.py b/var/spack/repos/builtin/packages/py-mx/package.py index 71930fffba..0c5c1fe460 100644 --- a/var/spack/repos/builtin/packages/py-mx/package.py +++ b/var/spack/repos/builtin/packages/py-mx/package.py @@ -17,3 +17,6 @@ class PyMx(PythonPackage): url = "https://downloads.egenix.com/python/egenix-mx-base-3.2.8.tar.gz" version('3.2.8', sha256='0da55233e45bc3f88870e62e60a79c2c86bad4098b8128343fd7be877f44a3c0') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-mysql-connector-python/package.py b/var/spack/repos/builtin/packages/py-mysql-connector-python/package.py index 9a51999d80..b586be8f69 100644 --- a/var/spack/repos/builtin/packages/py-mysql-connector-python/package.py +++ b/var/spack/repos/builtin/packages/py-mysql-connector-python/package.py @@ -18,9 +18,5 @@ class PyMysqlConnectorPython(PythonPackage): version('8.0.13', sha256='d4c0834c583cdb90c0aeae90b1917d58355a4bf9b0266c16fd58874a5607f9d4') - # Fix `error: option --single-version-externally-managed not recognized` - # https://github.com/mysql/mysql-connector-python/pull/9 - patch('single-version.patch') - depends_on('py-setuptools', type=('build', 'run')) depends_on('py-protobuf@3.0.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-mysql-connector-python/single-version.patch b/var/spack/repos/builtin/packages/py-mysql-connector-python/single-version.patch deleted file mode 100644 index 27cf5e5d22..0000000000 --- a/var/spack/repos/builtin/packages/py-mysql-connector-python/single-version.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/lib/cpy_distutils.py b/lib/cpy_distutils.py -index a9132e5..3cffee6 100644 ---- a/lib/cpy_distutils.py -+++ b/lib/cpy_distutils.py -@@ -29,9 +29,14 @@ - """Implements the DistUtils command 'build_ext' - """ - --from distutils.command.build_ext import build_ext --from distutils.command.install import install --from distutils.command.install_lib import install_lib -+try: -+ from setuptools.command.build_ext import build_ext -+ from setuptools.command.install import install -+ from setuptools.command.install_lib import install_lib -+except ImportError: -+ from distutils.command.build_ext import build_ext -+ from distutils.command.install import install -+ from distutils.command.install_lib import install_lib - from distutils.errors import DistutilsExecError - from distutils.util import get_platform - from distutils.version import LooseVersion diff --git a/var/spack/repos/builtin/packages/py-nbformat/package.py b/var/spack/repos/builtin/packages/py-nbformat/package.py index d93ed934b1..926e9a8cbe 100644 --- a/var/spack/repos/builtin/packages/py-nbformat/package.py +++ b/var/spack/repos/builtin/packages/py-nbformat/package.py @@ -19,6 +19,8 @@ class PyNbformat(PythonPackage): depends_on('python@3.5:', when='@5:', type=('build', 'run')) depends_on('python@2.7:2.8,3.3:', when='@:4', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-ipython-genutils', type=('build', 'run')) depends_on('py-traitlets@4.1:', type=('build', 'run')) depends_on('py-jsonschema@2.4.0:2.4,2.5.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-nbmake/package.py b/var/spack/repos/builtin/packages/py-nbmake/package.py index 1b2c940a39..39931b7618 100644 --- a/var/spack/repos/builtin/packages/py-nbmake/package.py +++ b/var/spack/repos/builtin/packages/py-nbmake/package.py @@ -16,6 +16,7 @@ class PyNbmake(PythonPackage): depends_on('python@3.6.1:3', type=('build', 'run')) depends_on('py-setuptools', type='build') + depends_on('py-poetry-core@1:', type='build') depends_on('py-pygments@2.7.3:2', type=('build', 'run')) depends_on('py-ipykernel@5.4.0:5', type=('build', 'run')) depends_on('py-nbclient@0.3:0', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-nc-time-axis/package.py b/var/spack/repos/builtin/packages/py-nc-time-axis/package.py index 2e3a81c80a..26b96b9afa 100644 --- a/var/spack/repos/builtin/packages/py-nc-time-axis/package.py +++ b/var/spack/repos/builtin/packages/py-nc-time-axis/package.py @@ -14,6 +14,7 @@ class PyNcTimeAxis(PythonPackage): version('1.1.0', sha256='ea9d4f7f9e9189c96f7d320235ac6c4be7f63dc5aa256b3ee5d5cca5845e6e26') + depends_on('py-setuptools', type='build') depends_on('py-cftime', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-nestle/package.py b/var/spack/repos/builtin/packages/py-nestle/package.py index 7b58ae7d8d..e1145ede75 100644 --- a/var/spack/repos/builtin/packages/py-nestle/package.py +++ b/var/spack/repos/builtin/packages/py-nestle/package.py @@ -14,6 +14,9 @@ class PyNestle(PythonPackage): version('0.1.1', sha256='d236a04f25494af5cda572eecf62729592b3231fbd874b1f72aff54718a3bb08') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') + # Required dependencies depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-netcdf4/package.py b/var/spack/repos/builtin/packages/py-netcdf4/package.py index d849b9d4d8..36275eeeb1 100644 --- a/var/spack/repos/builtin/packages/py-netcdf4/package.py +++ b/var/spack/repos/builtin/packages/py-netcdf4/package.py @@ -44,9 +44,6 @@ class PyNetcdf4(PythonPackage): # the version of HDF5. patch('check_hdf5version.patch', when='@:1.2.9 ^hdf5@1.10:') - # We can skip the 'build' phase to avoid recompilation of the library. - phases = ['install'] - def setup_build_environment(self, env): """Ensure installed netcdf and hdf5 libraries are used""" # Explicitly set these variables so setup.py won't erroneously pick up diff --git a/var/spack/repos/builtin/packages/py-networkit/package.py b/var/spack/repos/builtin/packages/py-networkit/package.py index 375cc0c49c..c03e391d1e 100644 --- a/var/spack/repos/builtin/packages/py-networkit/package.py +++ b/var/spack/repos/builtin/packages/py-networkit/package.py @@ -45,9 +45,6 @@ class PyNetworkit(PythonPackage): depends_on('py-setuptools', type='build') depends_on('python@3:', type=('build', 'run')) - phases = ['build_ext', 'install'] - - # Overwrite build_ext to enable ext. core-library + parallel build - def build_ext_args(self, spec, prefix): - args = ['--networkit-external-core', '-j{0}'.format(make_jobs)] - return args + def install_options(self, spec, prefix): + # Enable ext. core-library + parallel build + return ['--networkit-external-core', '-j{0}'.format(make_jobs)] diff --git a/var/spack/repos/builtin/packages/py-neurolab/package.py b/var/spack/repos/builtin/packages/py-neurolab/package.py index f58bc2116a..ae9bbbdcf3 100644 --- a/var/spack/repos/builtin/packages/py-neurolab/package.py +++ b/var/spack/repos/builtin/packages/py-neurolab/package.py @@ -14,5 +14,5 @@ class PyNeurolab(PythonPackage): version('0.3.5', sha256='96ec311988383c63664f3325668f27c30561cf4349e3bc5420665c042a3b9191') + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) - # depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-ninja/package.py b/var/spack/repos/builtin/packages/py-ninja/package.py index a1b6125f56..865a7f3a4e 100644 --- a/var/spack/repos/builtin/packages/py-ninja/package.py +++ b/var/spack/repos/builtin/packages/py-ninja/package.py @@ -15,6 +15,7 @@ class PyNinja(PythonPackage): version('1.10.2', sha256='bb5e54b9a7343b3a8fc6532ae2c169af387a45b0d4dd5b72c2803e21658c5791') depends_on('cmake@3.6:', type='build') + depends_on('py-setuptools@42:', type='build') depends_on('py-scikit-build', type='build') depends_on('ninja@1.10.2', type=('build', 'run'), when='@1.10.2') diff --git a/var/spack/repos/builtin/packages/py-nipype/package.py b/var/spack/repos/builtin/packages/py-nipype/package.py index 43cd96ce7c..5984d3f0a9 100644 --- a/var/spack/repos/builtin/packages/py-nipype/package.py +++ b/var/spack/repos/builtin/packages/py-nipype/package.py @@ -40,5 +40,3 @@ class PyNipype(PythonPackage): depends_on('py-filelock@3:', type=('build', 'run')) depends_on('py-etelemetry@0.2:', when='@1.5:', type=('build', 'run')) depends_on('py-etelemetry', type=('build', 'run')) - - depends_on('py-sphinxcontrib-napoleon', type='test') diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py index adae05426a..856bf138b8 100644 --- a/var/spack/repos/builtin/packages/py-numpy/package.py +++ b/var/spack/repos/builtin/packages/py-numpy/package.py @@ -164,7 +164,7 @@ class PyNumpy(PythonPackage): return (flags, None, None) - @run_before('build') + @run_before('install') def set_blas_lapack(self): # https://numpy.org/devdocs/user/building.html # https://github.com/numpy/numpy/blob/master/site.cfg.example @@ -341,7 +341,7 @@ class PyNumpy(PythonPackage): env.set('NPY_LAPACK_ORDER', lapack) - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] # From NumPy 1.10.0 on it's possible to do a parallel build. diff --git a/var/spack/repos/builtin/packages/py-nvidia-ml-py/package.py b/var/spack/repos/builtin/packages/py-nvidia-ml-py/package.py index ee2e2890af..1c3013805e 100644 --- a/var/spack/repos/builtin/packages/py-nvidia-ml-py/package.py +++ b/var/spack/repos/builtin/packages/py-nvidia-ml-py/package.py @@ -11,3 +11,6 @@ class PyNvidiaMlPy(PythonPackage): pypi = "nvidia-ml-py/nvidia-ml-py-11.450.51.tar.gz" version('11.450.51', sha256='5aa6dd23a140b1ef2314eee5ca154a45397b03e68fd9ebc4f72005979f511c73') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-nvidia-ml-py3/package.py b/var/spack/repos/builtin/packages/py-nvidia-ml-py3/package.py index 14db622563..f0db935a39 100644 --- a/var/spack/repos/builtin/packages/py-nvidia-ml-py3/package.py +++ b/var/spack/repos/builtin/packages/py-nvidia-ml-py3/package.py @@ -11,3 +11,6 @@ class PyNvidiaMlPy3(PythonPackage): pypi = "nvidia-ml-py3/nvidia-ml-py3-7.352.0.tar.gz" version('7.352.0', sha256='390f02919ee9d73fe63a98c73101061a6b37fa694a793abf56673320f1f51277') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-olefile/package.py b/var/spack/repos/builtin/packages/py-olefile/package.py index 2db8fcad6c..6b484be2df 100644 --- a/var/spack/repos/builtin/packages/py-olefile/package.py +++ b/var/spack/repos/builtin/packages/py-olefile/package.py @@ -15,3 +15,5 @@ class PyOlefile(PythonPackage): version('0.44', sha256='61f2ca0cd0aa77279eb943c07f607438edf374096b66332fae1ee64a6f0f73ad') depends_on('python@2.6:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-opencensus-context/package.py b/var/spack/repos/builtin/packages/py-opencensus-context/package.py index 00ab68d342..98845b4e68 100644 --- a/var/spack/repos/builtin/packages/py-opencensus-context/package.py +++ b/var/spack/repos/builtin/packages/py-opencensus-context/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyOpencensusContext(Package): +class PyOpencensusContext(PythonPackage): """OpenCensus Runtime Context.""" homepage = "https://github.com/census-instrumentation/opencensus-python/tree/master/context/opencensus-context" @@ -12,10 +12,4 @@ class PyOpencensusContext(Package): version('0.1.1', sha256='1a3fdf6bec537031efcc93d51b04f1edee5201f8c9a0c85681d63308b76f5702', expand=False) - extends('python') - depends_on('py-pip', type='build') depends_on('py-contextvars', when='^python@3.6.0:3.6', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-or-tools/package.py b/var/spack/repos/builtin/packages/py-or-tools/package.py index 8f79c14c3d..926e499698 100644 --- a/var/spack/repos/builtin/packages/py-or-tools/package.py +++ b/var/spack/repos/builtin/packages/py-or-tools/package.py @@ -15,6 +15,8 @@ class PyOrTools(CMakePackage): version('7.8', sha256='d93a9502b18af51902abd130ff5f23768fcf47e266e6d1f34b3586387aa2de68') depends_on('cmake@3.14:', type='build') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-protobuf@3.12.2:', type=('build', 'run')) @@ -48,5 +50,5 @@ class PyOrTools(CMakePackage): with working_dir(self.build_directory): make("install") with working_dir(join_path(self.build_directory, 'python')): - setup_py('install', '--prefix=' + prefix, - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) diff --git a/var/spack/repos/builtin/packages/py-ordereddict/package.py b/var/spack/repos/builtin/packages/py-ordereddict/package.py index 490aaf5560..6787563771 100644 --- a/var/spack/repos/builtin/packages/py-ordereddict/package.py +++ b/var/spack/repos/builtin/packages/py-ordereddict/package.py @@ -13,3 +13,6 @@ class PyOrdereddict(PythonPackage): pypi = "ordereddict/ordereddict-1.1.tar.gz" version('1.1', sha256='1c35b4ac206cef2d24816c89f89cf289dd3d38cf7c449bb3fab7bf6d43f01b1f') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pager/package.py b/var/spack/repos/builtin/packages/py-pager/package.py index 6e46b021bc..a9662cb374 100644 --- a/var/spack/repos/builtin/packages/py-pager/package.py +++ b/var/spack/repos/builtin/packages/py-pager/package.py @@ -13,3 +13,6 @@ class PyPager(PythonPackage): pypi = "pager/pager-3.3.tar.gz" version('3.3', sha256='18aa45ec877dca732e599531c7b3b0b22ed6a4445febdf1bdf7da2761cca340d') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pandocfilters/package.py b/var/spack/repos/builtin/packages/py-pandocfilters/package.py index 5f200dfa3f..40e39caa43 100644 --- a/var/spack/repos/builtin/packages/py-pandocfilters/package.py +++ b/var/spack/repos/builtin/packages/py-pandocfilters/package.py @@ -16,6 +16,4 @@ class PyPandocfilters(PythonPackage): version('1.4.2', sha256='b3dd70e169bb5449e6bc6ff96aea89c5eea8c5f6ab5e207fc2f521a2cf4a0da9') depends_on('python@2.7:2,3.4:', type=('build', 'run'), when='@1.5.0:') - # Notice: @:1.4 uses distutils and won't build if py-setuptools are present: - # error: option --single-version-externally-managed not recognized - depends_on('py-setuptools', type='build', when='@1.5.0:') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-parsl/package.py b/var/spack/repos/builtin/packages/py-parsl/package.py index 6e1dbf6c0f..181644885d 100644 --- a/var/spack/repos/builtin/packages/py-parsl/package.py +++ b/var/spack/repos/builtin/packages/py-parsl/package.py @@ -20,28 +20,12 @@ class PyParsl(PythonPackage): depends_on('python@3.6:', type=('build', 'run')) depends_on('py-setuptools', type='build') - depends_on('py-typeguard@2.10:', type=('run', 'test')) - depends_on('py-pyzmq@17.1.2:', type=('run', 'test')) - depends_on('py-typing-extensions', type=('run', 'test')) - depends_on('py-dill', type=('run', 'test')) - depends_on('py-tblib', type=('run', 'test')) - depends_on('py-requests', type=('run', 'test')) - depends_on('py-paramiko', type=('run', 'test')) - depends_on('py-psutil@5.5.1:', type=('run', 'test')) - depends_on('py-globus-sdk', type=('run', 'test')) - depends_on('py-flake8', type='test') - depends_on('py-ipyparallel', type='test') - depends_on('py-pandas', type='test') - depends_on('py-pytest@4.6:4.999', type='test') - depends_on('py-pytest-cov', type='test') - depends_on('py-pytest-xdist', type='test') - depends_on('py-pytest-random-order', type='test') - depends_on('py-coverage@4.5.4', type='test') - depends_on('py-mock@1.0.0:', type='test') - depends_on('py-nbsphinx', type='test') - depends_on('py-sphinx-rtd-theme', type='test') - depends_on('py-mypy@0.790', type='test') - depends_on('py-pytest-xdist', type='test') - depends_on('py-sphinx@3.4.1', type='test') - depends_on('py-twine', type='test') - depends_on('py-wheel', type='test') + depends_on('py-pyzmq@17.1.2:', type=('build', 'run')) + depends_on('py-typeguard@2.10:', type=('build', 'run')) + depends_on('py-typing-extensions', type=('build', 'run')) + depends_on('py-globus-sdk', type=('build', 'run')) + depends_on('py-dill', type=('build', 'run')) + depends_on('py-tblib', type=('build', 'run')) + depends_on('py-requests', type=('build', 'run')) + depends_on('py-paramiko', type=('build', 'run')) + depends_on('py-psutil@5.5.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pastel/package.py b/var/spack/repos/builtin/packages/py-pastel/package.py new file mode 100644 index 0000000000..4a0d9ca7f7 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pastel/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPastel(PythonPackage): + """Bring colors to your terminal.""" + + homepage = "https://github.com/sdispater/pastel" + pypi = "pastel/pastel-0.2.1.tar.gz" + + version('0.2.1', sha256='e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d') + + depends_on('python@2.7,3.4:3', type=('build', 'run')) + depends_on('py-poetry-core@1:', type='build') diff --git a/var/spack/repos/builtin/packages/py-pathlib/package.py b/var/spack/repos/builtin/packages/py-pathlib/package.py index 5c05c4e82c..6bc3715675 100644 --- a/var/spack/repos/builtin/packages/py-pathlib/package.py +++ b/var/spack/repos/builtin/packages/py-pathlib/package.py @@ -18,6 +18,9 @@ class PyPathlib(PythonPackage): version('1.0.1', sha256='6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') + # This is a backport of the pathlib module from Python 3.4. Since pathlib is now # part of the standard library, this module isn't needed in Python 3.4+. Although it # can be installed, differences between this implementation and the standard library diff --git a/var/spack/repos/builtin/packages/py-pauvre/package.py b/var/spack/repos/builtin/packages/py-pauvre/package.py index af1b630c0e..7b54a12389 100644 --- a/var/spack/repos/builtin/packages/py-pauvre/package.py +++ b/var/spack/repos/builtin/packages/py-pauvre/package.py @@ -15,6 +15,7 @@ class PyPauvre(PythonPackage): version('0.1.86', sha256='aa0b3653e7c12fb50a0907ce088d85b8e1b52c97f40e4d2e6e6b7525a681aa1a') depends_on('python@3:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-biopython', type=('build', 'run')) depends_on('py-pandas', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pep517/package.py b/var/spack/repos/builtin/packages/py-pep517/package.py index 8dcd03c1fa..7585b8f118 100644 --- a/var/spack/repos/builtin/packages/py-pep517/package.py +++ b/var/spack/repos/builtin/packages/py-pep517/package.py @@ -14,7 +14,8 @@ class PyPep517(PythonPackage): version('0.12.0', sha256='931378d93d11b298cf511dd634cf5ea4cb249a28ef84160b3247ee9afb4e8ab0') + depends_on('py-flit-core@2:3', type='build') depends_on('py-toml', when='^python@:3.5', type=('build', 'run')) + depends_on('py-tomli@1.1:', when='^python@3.6:', type=('build', 'run')) depends_on('py-importlib-metadata', when='^python@:3.7', type=('build', 'run')) depends_on('py-zipp', when='^python@:3.7', type=('build', 'run')) - depends_on('py-tomli@1.1:', when='^python@3.6:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pexpect/package.py b/var/spack/repos/builtin/packages/py-pexpect/package.py index 36b3ee8d78..e75cf186de 100644 --- a/var/spack/repos/builtin/packages/py-pexpect/package.py +++ b/var/spack/repos/builtin/packages/py-pexpect/package.py @@ -16,5 +16,7 @@ class PyPexpect(PythonPackage): version('4.2.1', sha256='3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92') version('3.3', sha256='dfea618d43e83cfff21504f18f98019ba520f330e4142e5185ef7c73527de5ba') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-ptyprocess', type=('build', 'run')) depends_on('py-ptyprocess@0.5:', type=('build', 'run'), when='@4.7.0:') diff --git a/var/spack/repos/builtin/packages/py-phonopy/package.py b/var/spack/repos/builtin/packages/py-phonopy/package.py index 26bf06f7df..6cab8ddc8c 100644 --- a/var/spack/repos/builtin/packages/py-phonopy/package.py +++ b/var/spack/repos/builtin/packages/py-phonopy/package.py @@ -14,6 +14,8 @@ class PyPhonopy(PythonPackage): version('1.10.0', sha256='6b7c540bbbb033203c45b8472696db02a3a55913a0e5eb23de4dc9a3bee473f7') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pillow/package.py b/var/spack/repos/builtin/packages/py-pillow/package.py index 04355b9665..8f96e2a8f5 100644 --- a/var/spack/repos/builtin/packages/py-pillow/package.py +++ b/var/spack/repos/builtin/packages/py-pillow/package.py @@ -54,8 +54,6 @@ class PyPillowBase(PythonPackage): conflicts('+imagequant', when='@:3.2', msg='imagequant support was added in 3.3') conflicts('+xcb', when='@:7.0', msg='XCB support was added in 7.1') - phases = ['build_ext', 'install'] - def patch(self): """Patch setup.py to provide library and include directories for dependencies.""" @@ -95,11 +93,6 @@ class PyPillowBase(PythonPackage): def setup_build_environment(self, env): env.set('MAX_CONCURRENCY', str(make_jobs)) - # Tests need to be re-added since `phases` was overridden - run_after('install')( - PythonPackage._run_default_install_time_test_callbacks) - run_after('install')(PythonPackage.sanity_check_prefix) - class PyPillow(PyPillowBase): """Pillow is a fork of the Python Imaging Library (PIL). It adds image diff --git a/var/spack/repos/builtin/packages/py-pip/package.py b/var/spack/repos/builtin/packages/py-pip/package.py index 41a8b17351..e4cb9b2bb8 100644 --- a/var/spack/repos/builtin/packages/py-pip/package.py +++ b/var/spack/repos/builtin/packages/py-pip/package.py @@ -3,30 +3,54 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack import * -class PyPip(PythonPackage): +class PyPip(Package): """The PyPA recommended tool for installing Python packages.""" homepage = "https://pip.pypa.io/" - pypi = "pip/pip-20.2.tar.gz" + url = "https://files.pythonhosted.org/packages/py3/p/pip/pip-20.2-py3-none-any.whl" + list_url = "https://pypi.org/simple/pip/" - version('21.1.2', sha256='eb5df6b9ab0af50fe1098a52fd439b04730b6e066887ff7497357b9ebd19f79b') - version('20.2', sha256='912935eb20ea6a3b5ed5810dde9754fde5563f5ca9be44a8a6e5da806ade970b') - version('19.3', sha256='324d234b8f6124846b4e390df255cacbe09ce22791c3b714aa1ea6e44a4f2861') - version('19.1.1', sha256='44d3d7d3d30a1eb65c7e5ff1173cdf8f7467850605ac7cc3707b6064bddd0958') - version('19.0.3', sha256='6e6f197a1abfb45118dbb878b5c859a0edbdd33fd250100bc015b67fded4b9f2') - version('18.1', sha256='c0a292bd977ef590379a3f05d7b7f65135487b67470f6281289a94e015650ea1') - version('10.0.1', sha256='f2bd08e0cd1b06e10218feaf6fef299f473ba706582eb3bd9d52203fdbd7ee68') - version('9.0.1', sha256='09f243e1a7b461f654c26a725fa373211bb7ff17a9300058b205c61658ca940d') + version('21.3.1', sha256='deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d', expand=False) + version('21.1.2', sha256='f8ea1baa693b61c8ad1c1d8715e59ab2b93cd3c4769bacab84afcc4279e7a70e', expand=False) + version('20.2', sha256='d75f1fc98262dabf74656245c509213a5d0f52137e40e8f8ed5cc256ddd02923', expand=False) + version('19.3', sha256='e100a7eccf085f0720b4478d3bb838e1c179b1e128ec01c0403f84e86e0e2dfb', expand=False) + version('19.1.1', sha256='993134f0475471b91452ca029d4390dc8f298ac63a712814f101cd1b6db46676', expand=False) + version('19.0.3', sha256='bd812612bbd8ba84159d9ddc0266b7fbce712fc9bc98c82dee5750546ec8ec64', expand=False) + version('18.1', sha256='7909d0a0932e88ea53a7014dfd14522ffef91a464daaaf5c573343852ef98550', expand=False) + version('10.0.1', sha256='717cdffb2833be8409433a93746744b59505f42146e8d37de6c62b430e25d6d7', expand=False) + version('9.0.1', sha256='690b762c0a8460c303c089d5d0be034fb15a5ea2b75bdf565f40421f542fefb0', expand=False) + extends('python') depends_on('python@3.6:', when='@21:', type=('build', 'run')) depends_on('python@2.7:2.8,3.5:', when='@19.2:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', when='@18:', type=('build', 'run')) depends_on('python@2.7:2.8,3.3:', when='@10:', type=('build', 'run')) depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) - # Most Python packages only require setuptools as a build dependency. - # However, pip requires setuptools during runtime as well. - depends_on('py-setuptools', type=('build', 'run')) + def url_for_version(self, version): + url = "https://files.pythonhosted.org/packages/{0}/p/pip/pip-{1}-{0}-none-any.whl" + if version >= Version('21'): + python_tag = 'py3' + else: + python_tag = 'py2.py3' + return url.format(python_tag, version) + + def install(self, spec, prefix): + # To build and install pip from source, you need setuptools, wheel, and pip + # already installed. We get around this by using a pre-built wheel to install + # itself, see: + # https://discuss.python.org/t/bootstrapping-a-specific-version-of-pip/12306 + whl = self.stage.archive_file + args = [os.path.join(whl, 'pip')] + std_pip_args + ['--prefix=' + prefix, whl] + python(*args) + + def setup_dependent_package(self, module, dependent_spec): + pip = self.spec['python'].command + pip.add_default_arg('-m') + pip.add_default_arg('pip') + setattr(module, 'pip', pip) diff --git a/var/spack/repos/builtin/packages/py-pkgconfig/package.py b/var/spack/repos/builtin/packages/py-pkgconfig/package.py index 7f3270b63a..72300698fc 100644 --- a/var/spack/repos/builtin/packages/py-pkgconfig/package.py +++ b/var/spack/repos/builtin/packages/py-pkgconfig/package.py @@ -17,7 +17,10 @@ class PyPkgconfig(PythonPackage): version('1.4.0', sha256='048c3b457da7b6f686b647ab10bf09e2250e4c50acfe6f215398a8b5e6fcdb52') version('1.2.2', sha256='3685ba02a9b72654a764b728b559f327e1dbd7dc6ebc310a1bd429666ee202aa') - depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) - depends_on('python@2.7:2.8,3.3:', when='@1.5:', type=('build', 'run')) - depends_on('py-setuptools', when='@:1.4,1.5.5:', type=('build', 'run')) + depends_on('python@3.3:', when='@1.5.5:', type=('build', 'run')) + depends_on('python@2.7,3.3:', when='@1.5:', type=('build', 'run')) + depends_on('python@2.6:2.7,3.3:', when='@1.4:', type=('build', 'run')) + depends_on('py-poetry-core@1:', when='@1.5.5:', type='build') + depends_on('py-poetry-core@0.12:', when='@1.5:', type='build') + depends_on('py-setuptools', when='@:1.4', type='build') depends_on('pkgconfig', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-planar/package.py b/var/spack/repos/builtin/packages/py-planar/package.py index ac3cedffd6..d21fe037f2 100644 --- a/var/spack/repos/builtin/packages/py-planar/package.py +++ b/var/spack/repos/builtin/packages/py-planar/package.py @@ -13,3 +13,6 @@ class PyPlanar(PythonPackage): pypi = "planar/planar-0.4.zip" version('0.4', sha256='cbfb9cbae8b0e296e6e7e3552b7d685c7ed5cae295b7a61f2b2b096b231dad76') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pmw/package.py b/var/spack/repos/builtin/packages/py-pmw/package.py index c553196f6c..106614798c 100644 --- a/var/spack/repos/builtin/packages/py-pmw/package.py +++ b/var/spack/repos/builtin/packages/py-pmw/package.py @@ -13,3 +13,6 @@ class PyPmw(PythonPackage): version('2.0.1', sha256='0b9d28f52755a7a081b44591c3dd912054f896e56c9a627db4dd228306ad1120') version('2.0.0', sha256='2babb2855feaabeea1003c6908b61c9d39cff606d418685f0559952714c680bb') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-poetry-core/package.py b/var/spack/repos/builtin/packages/py-poetry-core/package.py new file mode 100644 index 0000000000..fe5fc02816 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-poetry-core/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPoetryCore(PythonPackage): + """Poetry PEP 517 Build Backend.""" + + homepage = "https://github.com/python-poetry/poetry-core" + pypi = "poetry-core/poetry-core-1.0.7.tar.gz" + + version('1.0.7', sha256='98c11c755a16ef6c5673c22ca94a3802a7df4746a0853a70b6fae8b9f5cac206') + + depends_on('python@2.7,3.5:3', type=('build', 'run')) + depends_on('py-importlib-metadata@1.7:1', when='^python@2.7,3.5:3.7', type=('build', 'run')) + depends_on('py-pathlib2@2.3.5:2', when='^python@2.7', type=('build', 'run')) + depends_on('py-typing@3.7.4.1:3', when='^python@2.7', type=('build', 'run')) + depends_on('py-enum34@1.1.10:1', when='^python@2.7', type=('build', 'run')) + depends_on('py-functools32@3.2.3-2:3', when='^python@2.7', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-poetry/package.py b/var/spack/repos/builtin/packages/py-poetry/package.py new file mode 100644 index 0000000000..d90ad00a18 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-poetry/package.py @@ -0,0 +1,43 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPoetry(PythonPackage): + """Python dependency management and packaging made easy.""" + + homepage = "https://python-poetry.org/" + pypi = "poetry/poetry-1.1.12.tar.gz" + + version('1.1.12', sha256='5c66e2357fe37b552462a88b7d31bfa2ed8e84172208becd666933c776252567') + + depends_on('python@2.7,3.5:3', type=('build', 'run')) + depends_on('py-poetry-core@1.0.7:1.0', type=('build', 'run')) + depends_on('py-cleo@0.8.1:0.8', type=('build', 'run')) + depends_on('py-clikit@0.6.2:0.6', type=('build', 'run')) + depends_on('py-crashtest@0.3.0:0.3', when='^python@3.6:3', type=('build', 'run')) + depends_on('py-requests@2.18:2', type=('build', 'run')) + depends_on('py-cachy@0.3.0:0.3', type=('build', 'run')) + depends_on('py-requests-toolbelt@0.9.1:0.9', type=('build', 'run')) + depends_on('py-cachecontrol@0.12.4:0.12+filecache', when='^python@:3.5', type=('build', 'run')) + depends_on('py-cachecontrol@0.12.9:0.12+filecache', when='^python@3.6:3', type=('build', 'run')) + depends_on('py-pkginfo@1.4:1', type=('build', 'run')) + depends_on('py-html5lib@1.0:1', type=('build', 'run')) + depends_on('py-shellingham@1.1:1', type=('build', 'run')) + depends_on('py-tomlkit@0.7:0', type=('build', 'run')) + depends_on('py-pexpect@4.7:4', type=('build', 'run')) + depends_on('py-packaging@20.4:20', type=('build', 'run')) + depends_on('py-virtualenv@20.0.26:20', type=('build', 'run')) + depends_on('py-typing@3.6:3', when='^python@2.7', type=('build', 'run')) + depends_on('py-pathlib2@2.3:2', when='^python@2.7', type=('build', 'run')) + depends_on('py-futures@3.3:3', when='^python@2.7', type=('build', 'run')) + depends_on('py-glob2@0.6.0:0.6', when='^python@2.7', type=('build', 'run')) + depends_on('py-functools32@3.2.3:3', when='^python@2.7', type=('build', 'run')) + depends_on('py-keyring@18.0.1:18', when='^python@2.7', type=('build', 'run')) + depends_on('py-keyring@20.0.1:20', when='^python@3.5', type=('build', 'run')) + depends_on('py-keyring@21.2.0:21', when='^python@3.6:3', type=('build', 'run')) + depends_on('py-subprocess32@3.5:3', when='^python@2.7', type=('build', 'run')) + depends_on('py-importlib-metadata@1.6:1', when='^python@:3.7', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-protobuf/package.py b/var/spack/repos/builtin/packages/py-protobuf/package.py index 83ba3fd69c..da65d131a8 100644 --- a/var/spack/repos/builtin/packages/py-protobuf/package.py +++ b/var/spack/repos/builtin/packages/py-protobuf/package.py @@ -74,14 +74,9 @@ class PyProtobuf(PythonPackage): env.prepend_path('LIBRARY_PATH', protobuf_dir) @when('+cpp') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): return ['--cpp_implementation'] - @when('+cpp') - def install_args(self, spec, prefix): - args = super(PyProtobuf, self).install_args(spec, prefix) - return args + ['--cpp_implementation'] - @run_after('install') def fix_import_error(self): if str(self.spec['python'].version.up_to(1)) == '2': diff --git a/var/spack/repos/builtin/packages/py-ptyprocess/package.py b/var/spack/repos/builtin/packages/py-ptyprocess/package.py index 84c8c50de4..49ae9a91a6 100644 --- a/var/spack/repos/builtin/packages/py-ptyprocess/package.py +++ b/var/spack/repos/builtin/packages/py-ptyprocess/package.py @@ -14,3 +14,5 @@ class PyPtyprocess(PythonPackage): version('0.7.0', sha256='5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220') version('0.6.0', sha256='923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0') version('0.5.1', sha256='0530ce63a9295bfae7bd06edc02b6aa935619f486f0f1dc0972f516265ee81a6') + + depends_on('py-flit-core@2:3', type='build') diff --git a/var/spack/repos/builtin/packages/py-pyarrow/package.py b/var/spack/repos/builtin/packages/py-pyarrow/package.py index 9b362b81f7..640197ec2b 100644 --- a/var/spack/repos/builtin/packages/py-pyarrow/package.py +++ b/var/spack/repos/builtin/packages/py-pyarrow/package.py @@ -46,11 +46,9 @@ class PyPyarrow(PythonPackage, CudaPackage): depends_on('arrow+cuda' + v, when='+cuda' + v) depends_on('arrow+orc' + v, when='+orc' + v) - phases = ['build_ext', 'install'] - patch('for_aarch64.patch', when='target=aarch64:') - def build_ext_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] if spec.satisfies('+parquet'): args.append('--with-parquet') diff --git a/var/spack/repos/builtin/packages/py-pycares/package.py b/var/spack/repos/builtin/packages/py-pycares/package.py index 96f899802d..93d176f71d 100644 --- a/var/spack/repos/builtin/packages/py-pycares/package.py +++ b/var/spack/repos/builtin/packages/py-pycares/package.py @@ -16,5 +16,6 @@ class PyPycares(PythonPackage): version('3.0.0', sha256='28dc2bd59cf20399a6af4383cc8f57970cfca8b808ca05d6493812862ef0ca9c') - depends_on('python@2.6:') - depends_on('py-cffi') + depends_on('python@2.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-cffi', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pychecker/package.py b/var/spack/repos/builtin/packages/py-pychecker/package.py index 6e94a041de..38244d362f 100644 --- a/var/spack/repos/builtin/packages/py-pychecker/package.py +++ b/var/spack/repos/builtin/packages/py-pychecker/package.py @@ -12,3 +12,6 @@ class PyPychecker(PythonPackage): url = "http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz" version('0.8.19', sha256='44fb26668f74aca3738f02d072813762a37ce1242f50dbff573720fa2e953279') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pycosat/package.py b/var/spack/repos/builtin/packages/py-pycosat/package.py index 94bb571b2f..60272cf0c2 100644 --- a/var/spack/repos/builtin/packages/py-pycosat/package.py +++ b/var/spack/repos/builtin/packages/py-pycosat/package.py @@ -18,3 +18,6 @@ class PyPycosat(PythonPackage): pypi = "pycosat/pycosat-0.6.3.zip" version('0.6.3', sha256='4c99874946a7e939bb941bbb019dd2c20e6068e3107c91366e7779c69d70e0ed') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pycuda/package.py b/var/spack/repos/builtin/packages/py-pycuda/package.py index c26e6afb20..3c092217a8 100644 --- a/var/spack/repos/builtin/packages/py-pycuda/package.py +++ b/var/spack/repos/builtin/packages/py-pycuda/package.py @@ -19,7 +19,7 @@ class PyPycuda(PythonPackage): version('2019.1.2', sha256='ada56ce98a41f9f95fe18809f38afbae473a5c62d346cfa126a2d5477f24cc8a') version('2016.1.2', sha256='a7dbdac7e2f0c0d2ad98f5f281d5a9d29d6673b3c20210e261b96e9a2d0b6e37') - @run_before('build') + @run_before('install') def configure(self): pyver = self.spec['python'].version.up_to(2).joined boostlib = 'boost_python{0}'.format(pyver) diff --git a/var/spack/repos/builtin/packages/py-pycurl/package.py b/var/spack/repos/builtin/packages/py-pycurl/package.py index 7471808456..8b304cf83b 100644 --- a/var/spack/repos/builtin/packages/py-pycurl/package.py +++ b/var/spack/repos/builtin/packages/py-pycurl/package.py @@ -16,7 +16,7 @@ class PyPycurl(PythonPackage): version('7.44.1', sha256='5bcef4d988b74b99653602101e17d8401338d596b9234d263c728a0c3df003e8') version('7.43.0', sha256='aa975c19b79b6aa6c0518c0cc2ae33528900478f0b500531dbcdbf05beec584c') - depends_on('python@2.6:') - depends_on('python@3.5:', when='@7.44.1:') - depends_on('py-setuptools', when='@7.44.1:', type='build') + depends_on('python@2.6:', type=('build', 'run')) + depends_on('python@3.5:', when='@7.44.1:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('curl@7.19.0:') diff --git a/var/spack/repos/builtin/packages/py-pydatalog/package.py b/var/spack/repos/builtin/packages/py-pydatalog/package.py index fe8f253105..8cbae6662e 100644 --- a/var/spack/repos/builtin/packages/py-pydatalog/package.py +++ b/var/spack/repos/builtin/packages/py-pydatalog/package.py @@ -11,3 +11,6 @@ class PyPydatalog(PythonPackage): pypi = 'pyDatalog/pyDatalog-0.17.1.zip' version('0.17.1', sha256='b3d9cff0b9431e0fd0b2d5eefe4414c3d3c20bd18fdd7d1b42b2f01f25bac808') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pydmd/package.py b/var/spack/repos/builtin/packages/py-pydmd/package.py index e3c2238509..050a071536 100644 --- a/var/spack/repos/builtin/packages/py-pydmd/package.py +++ b/var/spack/repos/builtin/packages/py-pydmd/package.py @@ -32,18 +32,14 @@ class PyPydmd(PythonPackage): # https://github.com/mathLab/PyDMD/pull/133 patch('isuue-133.patch', when='@0.3') - @run_after('build') - def build_docs(self): - if '+docs' in self.spec: - with working_dir('docs'): - make('html') - @run_after('install') def install_docs(self): if '+docs' in self.spec: + with working_dir('docs'): + make('html') install_tree('docs', self.prefix.docs) - @run_after('build') + @run_after('install') @on_package_attributes(run_tests=True) def build_test(self): python('test.py') diff --git a/var/spack/repos/builtin/packages/py-pydv/package.py b/var/spack/repos/builtin/packages/py-pydv/package.py index b43ae2a9fd..c405e43e6f 100644 --- a/var/spack/repos/builtin/packages/py-pydv/package.py +++ b/var/spack/repos/builtin/packages/py-pydv/package.py @@ -15,6 +15,7 @@ class PyPydv(PythonPackage): version('2.4.2', sha256='46bda76e27e85beaad446455d0cc279388d455f05912a8ff8e4fb66de983992c') + depends_on('py-setuptools', type='build') depends_on('py-backports-functools-lru-cache', type=('build', 'run')) depends_on('py-cycler', type=('build', 'run')) depends_on('py-python-dateutil', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyelftools/package.py b/var/spack/repos/builtin/packages/py-pyelftools/package.py index eeb7144893..96779d234d 100644 --- a/var/spack/repos/builtin/packages/py-pyelftools/package.py +++ b/var/spack/repos/builtin/packages/py-pyelftools/package.py @@ -14,4 +14,4 @@ class PyPyelftools(PythonPackage): version('0.26', sha256='86ac6cee19f6c945e8dedf78c6ee74f1112bd14da5a658d8c9d4103aed5756a2') version('0.23', sha256='fc57aadd096e8f9b9b03f1a9578f673ee645e1513a5ff0192ef439e77eab21de') - depends_on('py-setuptools', when='@0.25:', type='build') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pyem/package.py b/var/spack/repos/builtin/packages/py-pyem/package.py index e8940b9722..932cbbf6f6 100644 --- a/var/spack/repos/builtin/packages/py-pyem/package.py +++ b/var/spack/repos/builtin/packages/py-pyem/package.py @@ -19,9 +19,5 @@ class PyPyem(PythonPackage): version('2.1.0', sha256='5234a20427ab2813a8a0bf1e9112d4d854b1b0502b3e63d17c1b1a3c4be9340e') depends_on('python@3.7:', type=('build', 'run')) + # pip silently replaces distutils with setuptools depends_on('py-setuptools', type='build') - - # distutils does not support entry_points, setuptools needed to install pyem binary - def patch(self): - filter_file(r'from distutils.core import setup', - 'from setuptools import setup', 'setup.py') diff --git a/var/spack/repos/builtin/packages/py-pygpu/package.py b/var/spack/repos/builtin/packages/py-pygpu/package.py index c7968913ab..f3731fc4ad 100644 --- a/var/spack/repos/builtin/packages/py-pygpu/package.py +++ b/var/spack/repos/builtin/packages/py-pygpu/package.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os - from spack import * @@ -35,10 +33,7 @@ class PyPygpu(PythonPackage): depends_on('py-mako', type=('build', 'run')) depends_on('check') - phases = ['build_ext', 'install'] - - def build_ext_args(self, spec, prefix): - + def install_options(self, spec, prefix): _ = self.spec['libgpuarray'].prefix include_flags = '-I{0}'.format(os.path.join(_, 'include')) library_flags = '-L{0}'.format(os.path.join(_, 'lib')) diff --git a/var/spack/repos/builtin/packages/py-pygtrie/package.py b/var/spack/repos/builtin/packages/py-pygtrie/package.py index ce1479f46c..92c30a7f52 100644 --- a/var/spack/repos/builtin/packages/py-pygtrie/package.py +++ b/var/spack/repos/builtin/packages/py-pygtrie/package.py @@ -15,3 +15,6 @@ class PyPygtrie(PythonPackage): version('2.4.2', sha256='43205559d28863358dbbf25045029f58e2ab357317a59b11f11ade278ac64692') version('2.4.0', sha256='77700d2fcaab321ac65e86c2969fb4b64c116796baf52ab12d07de2e1f6cfc5d') version('2.3.2', sha256='6299cdedd2cbdfda0895c2dbc43efe8828e698c62b574f3ef7e14b3253f80e23') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pyheadtail/package.py b/var/spack/repos/builtin/packages/py-pyheadtail/package.py index 2316cd2dbb..4581637549 100644 --- a/var/spack/repos/builtin/packages/py-pyheadtail/package.py +++ b/var/spack/repos/builtin/packages/py-pyheadtail/package.py @@ -18,6 +18,7 @@ class PyPyheadtail(PythonPackage): depends_on('python', type=('build', 'run')) depends_on('python@3:', when='@1.13.5:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-cython', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyke/package.py b/var/spack/repos/builtin/packages/py-pyke/package.py index 11709272b9..3ac3d896fd 100644 --- a/var/spack/repos/builtin/packages/py-pyke/package.py +++ b/var/spack/repos/builtin/packages/py-pyke/package.py @@ -18,3 +18,5 @@ class PyPyke(PythonPackage): version('1.1.1', sha256='b0b294f435c6e6d2d4a80badf57d92cb66814dfe21e644a521901209e6a3f8ae') depends_on('python@3:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pylev/package.py b/var/spack/repos/builtin/packages/py-pylev/package.py new file mode 100644 index 0000000000..393aaff658 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pylev/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPylev(PythonPackage): + """A pure Python Levenshtein implementation that's not freaking GPL'd.""" + + homepage = "http://github.com/toastdriven/pylev" + pypi = "pylev/pylev-1.4.0.tar.gz" + + version('1.4.0', sha256='9e77e941042ad3a4cc305dcdf2b2dec1aec2fbe3dd9015d2698ad02b173006d1') + + depends_on('python@2.7,3.3:', type=('build', 'run')) + depends_on('py-setuptools@42:', type='build') diff --git a/var/spack/repos/builtin/packages/py-pylikwid/package.py b/var/spack/repos/builtin/packages/py-pylikwid/package.py index 01869732e1..42baaf1f45 100644 --- a/var/spack/repos/builtin/packages/py-pylikwid/package.py +++ b/var/spack/repos/builtin/packages/py-pylikwid/package.py @@ -24,6 +24,8 @@ class PyPylikwid(PythonPackage): default=False, description='with Nvidia GPU profiling support') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('likwid', when='~cuda') depends_on('likwid+cuda', when='+cuda') diff --git a/var/spack/repos/builtin/packages/py-pymatgen/package.py b/var/spack/repos/builtin/packages/py-pymatgen/package.py index 28d4bf1c4a..7cdb17e6f8 100644 --- a/var/spack/repos/builtin/packages/py-pymatgen/package.py +++ b/var/spack/repos/builtin/packages/py-pymatgen/package.py @@ -51,5 +51,3 @@ class PyPymatgen(PythonPackage): depends_on('py-sympy', when='@2021.1.1:', type=('build', 'run')) depends_on('py-uncertainties@3.1.4:', when='@2021.1.1:', type=('build', 'run')) depends_on('py-networkx@2.2:', when='@2021.1.1:', type=('build', 'run')) - # while optional, for imports of spack install --test=root, these are required - depends_on('py-netcdf4@1.5.3:', when='@2021.1.1:', type=('test')) diff --git a/var/spack/repos/builtin/packages/py-pymol/package.py b/var/spack/repos/builtin/packages/py-pymol/package.py index 3e3ab85a26..eed63ee713 100644 --- a/var/spack/repos/builtin/packages/py-pymol/package.py +++ b/var/spack/repos/builtin/packages/py-pymol/package.py @@ -21,6 +21,8 @@ class PyPymol(PythonPackage): depends_on('python+tkinter@2.7:', type=('build', 'run'), when='@2.3.0:2.4.0') depends_on('python+tkinter@3.6:', type=('build', 'run'), when='@2.5.0:') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('gl') depends_on('glew') depends_on('libpng') @@ -38,10 +40,8 @@ class PyPymol(PythonPackage): depends_on('libpng', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) - def install_args(self, spec, prefix): - args = super(PyPymol, self).install_args(spec, prefix) - args.append('--no-launcher') - return args + def install_options(self, spec, prefix): + return ['--no-launcher'] @run_after('install') def install_launcher(self): diff --git a/var/spack/repos/builtin/packages/py-pympler/package.py b/var/spack/repos/builtin/packages/py-pympler/package.py index 35c1abca04..f5a2d5a789 100644 --- a/var/spack/repos/builtin/packages/py-pympler/package.py +++ b/var/spack/repos/builtin/packages/py-pympler/package.py @@ -20,4 +20,6 @@ class PyPympler(PythonPackage): version('0.4', sha256='b280480502df658b18cb6310d2c744fabf05d4c518f873377884b4d4b5d2992d') version('0.3.1', sha256='8cb170fddfe592342856590e2239e8c20ac61eacf18bc4f65a95ccaf74475e3e') - depends_on('python@2.5:') + depends_on('python@2.5:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pymumps/package.py b/var/spack/repos/builtin/packages/py-pymumps/package.py index c3c1fb4eb6..e3ca1df1a0 100644 --- a/var/spack/repos/builtin/packages/py-pymumps/package.py +++ b/var/spack/repos/builtin/packages/py-pymumps/package.py @@ -28,9 +28,7 @@ class PyPymumps(PythonPackage): # See https://github.com/PyMumps/pymumps/issues/13 patch('py-pymumps.setup.patch') - phases = ['build_ext', 'install'] - - def build_ext_args(self, spec, prefix): + def install_options(self, spec, prefix): # Requires --library-dirs, # '--libraries', spec['mumps'].prefix.libs, does not cut it args = ['--include-dirs', diff --git a/var/spack/repos/builtin/packages/py-pynio/package.py b/var/spack/repos/builtin/packages/py-pynio/package.py index 2ff4cd7085..bff5b1017b 100644 --- a/var/spack/repos/builtin/packages/py-pynio/package.py +++ b/var/spack/repos/builtin/packages/py-pynio/package.py @@ -48,6 +48,8 @@ class PyPynio(PythonPackage): # I have left off a few other optional dependencies, as they are not yet # in Spack. HDFEOS, HDFEOS5, GRIB. See the pynio setup.py for details. + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/py-pynn/package.py b/var/spack/repos/builtin/packages/py-pynn/package.py index 5f5775c77d..5ac5271aee 100644 --- a/var/spack/repos/builtin/packages/py-pynn/package.py +++ b/var/spack/repos/builtin/packages/py-pynn/package.py @@ -21,7 +21,9 @@ class PyPynn(PythonPackage): version('0.8.1', sha256='ce94246284588414d1570c1d5d697805f781384e771816727c830b01ee30fe39') version('0.7.5', sha256='15f75f422f3b71c6129ecef23f29d8baeb3ed6502e7a321b8a2596c78ef7e03c') - depends_on('python@2.6:2.8,3.3:') + depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-jinja2@2.7:', type=('build', 'run')) depends_on('py-docutils@0.10:', type=('build', 'run')) depends_on('py-numpy@1.5:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyodbc/package.py b/var/spack/repos/builtin/packages/py-pyodbc/package.py index 459968a038..c47a13cc30 100644 --- a/var/spack/repos/builtin/packages/py-pyodbc/package.py +++ b/var/spack/repos/builtin/packages/py-pyodbc/package.py @@ -20,9 +20,5 @@ class PyPyodbc(PythonPackage): depends_on('py-setuptools', type='build') depends_on('unixodbc', type=('build', 'run')) - phases = ['build_ext', 'install'] - - def build_ext_args(self, spec, prefix): - - args = (['--rpath=%s' % (spec['unixodbc'].prefix.lib)]) - return args + def install_options(self, spec, prefix): + return ['--rpath=%s' % spec['unixodbc'].prefix.lib] diff --git a/var/spack/repos/builtin/packages/py-pyopencl/package.py b/var/spack/repos/builtin/packages/py-pyopencl/package.py index d73bc1419d..38a7a2d16b 100644 --- a/var/spack/repos/builtin/packages/py-pyopencl/package.py +++ b/var/spack/repos/builtin/packages/py-pyopencl/package.py @@ -28,7 +28,7 @@ class PyPyopencl(PythonPackage): depends_on('py-pytools@2017.6:', type=('build', 'run')) depends_on('py-setuptools', type='build') - @run_before('build') + @run_before('install') def prepare(self): cl_prefix = self.spec['ocl-icd'].prefix python('configure.py', '--cl-inc-dir=' + cl_prefix.include, diff --git a/var/spack/repos/builtin/packages/py-pypar/package.py b/var/spack/repos/builtin/packages/py-pypar/package.py index a742d350a2..900f93714d 100644 --- a/var/spack/repos/builtin/packages/py-pypar/package.py +++ b/var/spack/repos/builtin/packages/py-pypar/package.py @@ -16,6 +16,8 @@ class PyPypar(PythonPackage): version('2.1.5_108', sha256='6076c47d32d48424a07c7b7b29ac16e12cc4b2d28b681b895f94fa76cd82fa12') depends_on('mpi') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) build_directory = 'source' diff --git a/var/spack/repos/builtin/packages/py-pyparsing/package.py b/var/spack/repos/builtin/packages/py-pyparsing/package.py index c819e3d384..28a00cf53e 100644 --- a/var/spack/repos/builtin/packages/py-pyparsing/package.py +++ b/var/spack/repos/builtin/packages/py-pyparsing/package.py @@ -22,6 +22,6 @@ class PyPyparsing(PythonPackage): depends_on('python@3.6:', when='@3:', type=('build', 'run')) depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) - depends_on('py-setuptools', when='@2.1:', type='build') + depends_on('py-setuptools', type='build') import_modules = ['pyparsing'] diff --git a/var/spack/repos/builtin/packages/py-pypeg2/package.py b/var/spack/repos/builtin/packages/py-pypeg2/package.py index 3b4d77c881..1c6358148e 100644 --- a/var/spack/repos/builtin/packages/py-pypeg2/package.py +++ b/var/spack/repos/builtin/packages/py-pypeg2/package.py @@ -14,4 +14,6 @@ class PyPypeg2(PythonPackage): version('2.15.2', sha256='2b2d4f80d8e1a9370b2a91f4a25f4abf7f69b85c8da84cd23ec36451958a1f6d') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-lxml', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyscf/package.py b/var/spack/repos/builtin/packages/py-pyscf/package.py index bd07301fdb..907dc08ed5 100644 --- a/var/spack/repos/builtin/packages/py-pyscf/package.py +++ b/var/spack/repos/builtin/packages/py-pyscf/package.py @@ -22,6 +22,7 @@ class PyPyscf(PythonPackage): # dependencies depends_on('cmake@2.8:', type='build') depends_on('python@2.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-numpy@1.8.0:', type=('build', 'run')) depends_on('py-scipy@0.12:', type=('build', 'run')) depends_on('py-h5py@2.3.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyside/package.py b/var/spack/repos/builtin/packages/py-pyside/package.py index 681f85e296..9d475584b7 100644 --- a/var/spack/repos/builtin/packages/py-pyside/package.py +++ b/var/spack/repos/builtin/packages/py-pyside/package.py @@ -81,5 +81,5 @@ class PyPyside(PythonPackage): "'Programming Language :: Python :: 3.5'", "setup.py") - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): return ['--jobs={0}'.format(make_jobs)] diff --git a/var/spack/repos/builtin/packages/py-pyside2/package.py b/var/spack/repos/builtin/packages/py-pyside2/package.py index eae93550ab..a5e3791fb8 100644 --- a/var/spack/repos/builtin/packages/py-pyside2/package.py +++ b/var/spack/repos/builtin/packages/py-pyside2/package.py @@ -38,7 +38,7 @@ class PyPyside2(PythonPackage): depends_on('libxslt@1.1.19:', when='+doc', type='build') depends_on('py-sphinx', when='+doc', type='build') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [ '--parallel={0}'.format(make_jobs), '--ignore-git', @@ -48,7 +48,7 @@ class PyPyside2(PythonPackage): args.append('--build-tests') return args - @run_after('build') - def build_docs(self): + @run_after('install') + def install_docs(self): if '+doc' in self.spec: make('apidoc') diff --git a/var/spack/repos/builtin/packages/py-pysqlite/package.py b/var/spack/repos/builtin/packages/py-pysqlite/package.py index d05b95aa87..eb3ecbb246 100644 --- a/var/spack/repos/builtin/packages/py-pysqlite/package.py +++ b/var/spack/repos/builtin/packages/py-pysqlite/package.py @@ -16,4 +16,6 @@ class PyPysqlite(PythonPackage): # pysqlite is built into Python3 depends_on('python@2.7.0:2.7', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('sqlite', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pytest-isort/package.py b/var/spack/repos/builtin/packages/py-pytest-isort/package.py index 846ac3671b..d622a4d270 100644 --- a/var/spack/repos/builtin/packages/py-pytest-isort/package.py +++ b/var/spack/repos/builtin/packages/py-pytest-isort/package.py @@ -14,5 +14,6 @@ class PyPytestIsort(PythonPackage): version('0.3.1', sha256='4bfee60dad1870b51700d55a85f5ceda766bd9d3d2878c1bbabee80e61b1be1a') + depends_on('py-setuptools', type='build') depends_on('py-pytest@3.5:', type=('build', 'run')) depends_on('py-isort@4.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pytest-random-order/package.py b/var/spack/repos/builtin/packages/py-pytest-random-order/package.py index a182b89c05..fc3eb53255 100644 --- a/var/spack/repos/builtin/packages/py-pytest-random-order/package.py +++ b/var/spack/repos/builtin/packages/py-pytest-random-order/package.py @@ -14,11 +14,6 @@ class PyPytestRandomOrder(PythonPackage): version('1.0.4', sha256='6b2159342a4c8c10855bc4fc6d65ee890fc614cb2b4ff688979b008a82a0ff52') - depends_on('python@3.4:', type=('build', 'run')) + depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-pytest@3.0.0:', type=('build', 'test', 'run')) - depends_on('py-coverage', type=('test', 'run')) - depends_on('py-pytest-xdist', type=('test', 'run')) - depends_on('py-sphinx', type=('test', 'run')) - depends_on('py-tox', type=('test', 'run')) - depends_on('py-py', type=('test', 'run')) diff --git a/var/spack/repos/builtin/packages/py-python-fmask/package.py b/var/spack/repos/builtin/packages/py-python-fmask/package.py index 9e5acb9b9e..8ded79a755 100644 --- a/var/spack/repos/builtin/packages/py-python-fmask/package.py +++ b/var/spack/repos/builtin/packages/py-python-fmask/package.py @@ -16,6 +16,8 @@ class PyPythonFmask(PythonPackage): version('0.5.4', sha256='a216aa3108de837fec182602b2b4708442746be31fc1585906802437784a63fe') depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-rios', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-python-logstash/package.py b/var/spack/repos/builtin/packages/py-python-logstash/package.py index 73fcc8c617..d0bf247508 100644 --- a/var/spack/repos/builtin/packages/py-python-logstash/package.py +++ b/var/spack/repos/builtin/packages/py-python-logstash/package.py @@ -13,3 +13,6 @@ class PyPythonLogstash(PythonPackage): pypi = "python-logstash/python-logstash-0.4.6.tar.gz" version('0.4.6', sha256='10943e5df83f592b4d61b63ad1afff855ccc8c9467f78718f0a59809ba1fe68c') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-python-lzo/package.py b/var/spack/repos/builtin/packages/py-python-lzo/package.py index 8a18db57d1..a92a4d107e 100644 --- a/var/spack/repos/builtin/packages/py-python-lzo/package.py +++ b/var/spack/repos/builtin/packages/py-python-lzo/package.py @@ -15,4 +15,6 @@ class PyPythonLzo(PythonPackage): version('1.12', sha256='97a8e46825e8f1abd84c2a3372bc09adae9745a5be5d3af2692cd850dac35345') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('lzo') diff --git a/var/spack/repos/builtin/packages/py-python-meep/package.py b/var/spack/repos/builtin/packages/py-python-meep/package.py index fcc0d23c5b..1af25ea948 100644 --- a/var/spack/repos/builtin/packages/py-python-meep/package.py +++ b/var/spack/repos/builtin/packages/py-python-meep/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack import * @@ -18,6 +20,8 @@ class PyPythonMeep(PythonPackage): variant('mpi', default=True, description='Enable MPI support') depends_on('python@2.6:2.7', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) @@ -31,12 +35,11 @@ class PyPythonMeep(PythonPackage): # or else it can't handle newer C++ compilers and flags. depends_on('swig@1.3.39:3.0.2') - phases = ['clean', 'build_ext', 'install', 'bdist'] - - def setup_file(self): - return 'setup-mpi.py' if '+mpi' in self.spec else 'setup.py' + def patch(self): + if '+mpi' in self.spec: + copy('setup-mpi.py', 'setup.py') - def common_args(self, spec, prefix): + def install_options(self, spec, prefix): include_dirs = [ spec['meep'].prefix.include, os.path.join( @@ -63,12 +66,3 @@ class PyPythonMeep(PythonPackage): # meep_common.i:89: Error: Unable to find 'meep.hpp' return [include_flags, library_flags] - - def clean_args(self, spec, prefix): - return ['--all'] - - def build_ext_args(self, spec, prefix): - return self.common_args(spec, prefix) - - def bdist_args(self, spec, prefix): - return self.common_args(spec, prefix) diff --git a/var/spack/repos/builtin/packages/py-python3-xlib/package.py b/var/spack/repos/builtin/packages/py-python3-xlib/package.py index e48a1c7356..59e9f6052d 100644 --- a/var/spack/repos/builtin/packages/py-python3-xlib/package.py +++ b/var/spack/repos/builtin/packages/py-python3-xlib/package.py @@ -14,3 +14,5 @@ class PyPython3Xlib(PythonPackage): version('0.15', sha256='dc4245f3ae4aa5949c1d112ee4723901ade37a96721ba9645f2bfa56e5b383f8') depends_on('python@3:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pythonqwt/package.py b/var/spack/repos/builtin/packages/py-pythonqwt/package.py index ce6e0b93d7..6582cd4baf 100644 --- a/var/spack/repos/builtin/packages/py-pythonqwt/package.py +++ b/var/spack/repos/builtin/packages/py-pythonqwt/package.py @@ -14,10 +14,7 @@ class PyPythonqwt(PythonPackage): version('0.5.5', sha256='1f13cc8b555a57f8fe0f806d6c2f6d847050e4d837649503932b81316d12788a') - variant('docs', default=False, description="Build documentation.") - depends_on('py-setuptools', type='build') depends_on('py-numpy@1.3:', type=('build', 'run')) depends_on('py-sip', type=('build', 'run')) depends_on('py-pyqt4', type=('build', 'run')) - depends_on('py-sphinx@1.1:', type=('build', 'run'), when='+docs') diff --git a/var/spack/repos/builtin/packages/py-pythonsollya/package.py b/var/spack/repos/builtin/packages/py-pythonsollya/package.py index 7e6e1f30fe..2a72429a49 100644 --- a/var/spack/repos/builtin/packages/py-pythonsollya/package.py +++ b/var/spack/repos/builtin/packages/py-pythonsollya/package.py @@ -24,7 +24,7 @@ class PyPythonsollya(PythonPackage): depends_on('py-bigfloat', type=('build', 'run')) depends_on('mpfi', type=('build', 'link')) - @run_before('build') + @run_before('install') def patch(self): filter_file('PYTHON ?= python2', 'PYTHON ?= ' + self.spec['python'].command.path, diff --git a/var/spack/repos/builtin/packages/py-pytoml/package.py b/var/spack/repos/builtin/packages/py-pytoml/package.py new file mode 100644 index 0000000000..7d32d4d30c --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pytoml/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPytoml(PythonPackage): + """A parser for TOML-0.4.0. + + Deprecated: use py-toml instead.""" + + homepage = "https://github.com/avakar/pytoml" + pypi = "pytoml/pytoml-0.1.21.tar.gz" + + version('0.1.21', sha256='8eecf7c8d0adcff3b375b09fe403407aa9b645c499e5ab8cac670ac4a35f61e7') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-pyutilib/package.py b/var/spack/repos/builtin/packages/py-pyutilib/package.py index 1a7c4fd3da..9d8d752c8f 100644 --- a/var/spack/repos/builtin/packages/py-pyutilib/package.py +++ b/var/spack/repos/builtin/packages/py-pyutilib/package.py @@ -30,5 +30,6 @@ class PyPyutilib(PythonPackage): version('5.3.3', sha256='318f4d60c9552493fe81a4b2e0418d2cf43aaab68e6d23e2c9a68ef010c9cf21') depends_on('python@2.7:2,3.4:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-nose', type=('build', 'run')) depends_on('py-six', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyyaml/package.py b/var/spack/repos/builtin/packages/py-pyyaml/package.py index f182633266..8a4fae60c5 100644 --- a/var/spack/repos/builtin/packages/py-pyyaml/package.py +++ b/var/spack/repos/builtin/packages/py-pyyaml/package.py @@ -13,8 +13,6 @@ class PyPyyaml(PythonPackage): pypi = "PyYAML/PyYAML-5.3.1.tar.gz" git = "https://github.com/yaml/pyyaml.git" - maintainers = ['adamjstewart'] - version('6.0', sha256='68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2') version('5.3.1', sha256='b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d') version('5.2', sha256='c0ee8eca2c582d29c3c2ec6e2c4f703d1b7f1fb10bc72317355a746057e7346c') @@ -26,13 +24,11 @@ class PyPyyaml(PythonPackage): variant('libyaml', default=True, description='Use libYAML bindings') - depends_on('python@2.7:2.8,3.5:', type=('build', 'run')) - depends_on('python@3.6:', type=('build', 'run'), when='@6.0:') - depends_on('libyaml', when='+libyaml') - depends_on('py-setuptools', when='@6.0:') - depends_on('py-cython', when='@6.0: +libyaml') - - phases = ['build_ext', 'install'] + depends_on('python@2.7,3.5:', type=('build', 'link', 'run')) + depends_on('python@3.6:', when='@6:', type=('build', 'link', 'run')) + depends_on('libyaml', when='+libyaml', type='link') + depends_on('py-setuptools', type='build') + depends_on('py-cython', when='@6:+libyaml', type='build') @property def import_modules(self): @@ -43,30 +39,12 @@ class PyPyyaml(PythonPackage): return modules - def setup_py(self, *args, **kwargs): - if self.spec.satisfies('@:5'): - # Cast from tuple to list - args = list(args) - - if '+libyaml' in self.spec: - args.insert(0, '--with-libyaml') - else: - args.insert(0, '--without-libyaml') - - super(PyPyyaml, self).setup_py(*args, **kwargs) - - def build_ext_args(self, spec, prefix): + def global_options(self, spec, prefix): args = [] - if spec.satisfies('@:5 +libyaml'): - args.extend([ - spec['libyaml'].libs.search_flags, - spec['libyaml'].headers.include_flags, - ]) + if '+libyaml' in self.spec: + args.append('--with-libyaml') + else: + args.append('--without-libyaml') return args - - # Tests need to be re-added since `phases` was overridden - run_after('install')( - PythonPackage._run_default_install_time_test_callbacks) - run_after('install')(PythonPackage.sanity_check_prefix) diff --git a/var/spack/repos/builtin/packages/py-qiskit-aer/package.py b/var/spack/repos/builtin/packages/py-qiskit-aer/package.py index 9f4b6af754..4f8e615809 100644 --- a/var/spack/repos/builtin/packages/py-qiskit-aer/package.py +++ b/var/spack/repos/builtin/packages/py-qiskit-aer/package.py @@ -36,7 +36,7 @@ class PyQiskitAer(PythonPackage, CudaPackage): env.set('DISABLE_DEPENDENCY_INSTALL', '1') env.set("CUDAHOSTCXX", spack_cxx) - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] args.append('-DDISABLE_CONAN=ON') if '~gdr' in self.spec: diff --git a/var/spack/repos/builtin/packages/py-qtconsole/package.py b/var/spack/repos/builtin/packages/py-qtconsole/package.py index 11b5295e67..b37dca01d0 100644 --- a/var/spack/repos/builtin/packages/py-qtconsole/package.py +++ b/var/spack/repos/builtin/packages/py-qtconsole/package.py @@ -20,6 +20,7 @@ class PyQtconsole(PythonPackage): depends_on('python@2.7:2.8,3.3:', type=('build', 'run')) depends_on('python@3.6:', type=('build', 'run'), when='@5.2.0:') + depends_on('py-setuptools', type='build') depends_on('py-ipykernel@4.1:', type=('build', 'run')) depends_on('py-jupyter-client@4.1:', type=('build', 'run')) depends_on('py-jupyter-core', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-quantities/package.py b/var/spack/repos/builtin/packages/py-quantities/package.py index d8fa355c9d..698c3b0139 100644 --- a/var/spack/repos/builtin/packages/py-quantities/package.py +++ b/var/spack/repos/builtin/packages/py-quantities/package.py @@ -19,4 +19,6 @@ class PyQuantities(PythonPackage): conflicts('^py-numpy@1.13:', when='@:0.11') depends_on('python@2.6.0:') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy@1.4.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-ranger-fm/package.py b/var/spack/repos/builtin/packages/py-ranger-fm/package.py index 2b61107f9d..4691eb03e0 100644 --- a/var/spack/repos/builtin/packages/py-ranger-fm/package.py +++ b/var/spack/repos/builtin/packages/py-ranger-fm/package.py @@ -14,3 +14,6 @@ class PyRangerFm(PythonPackage): git = "https://github.com/ranger/ranger.git" version('1.9.2', sha256='0ec62031185ad1f40b9faebd5a2d517c8597019c2eee919e3f1c60ce466d8625') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-rdflib/package.py b/var/spack/repos/builtin/packages/py-rdflib/package.py index 4820a359af..cb1723bb55 100644 --- a/var/spack/repos/builtin/packages/py-rdflib/package.py +++ b/var/spack/repos/builtin/packages/py-rdflib/package.py @@ -22,8 +22,7 @@ class PyRdflib(PythonPackage): version('5.0.0', sha256='78149dd49d385efec3b3adfbd61c87afaf1281c30d3fcaf1b323b34f603fb155') depends_on('python@3.7:', when='@6:', type='build') - depends_on('py-setuptools', when='@:5', type='build') - depends_on('py-setuptools', when='@6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-pyparsing', type=('build', 'run')) depends_on('py-isodate', type=('build', 'run')) depends_on('py-six', when='@:5', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-requests/package.py b/var/spack/repos/builtin/packages/py-requests/package.py index 04978df737..d8348bf49a 100644 --- a/var/spack/repos/builtin/packages/py-requests/package.py +++ b/var/spack/repos/builtin/packages/py-requests/package.py @@ -30,7 +30,8 @@ class PyRequests(PythonPackage): depends_on('python@2.7:2.8,3.6:', type=('build', 'run'), when='@2.26.0:') depends_on('py-setuptools', type='build') - depends_on('py-chardet@3.0.2:4', type=('build', 'run'), when='@2.25.1: ^python@2:2') + depends_on('py-chardet@3.0.2:4', type=('build', 'run'), when='@2.26: ^python@2:2') + depends_on('py-chardet@3.0.2:4', type=('build', 'run'), when='@2.25.1:2.25') depends_on('py-chardet@3.0.2:3', type=('build', 'run'), when='@2.23.0:2.25.0') depends_on('py-chardet@3.0.2:3.0', type=('build', 'run'), when='@2.16.0:2.22') depends_on('py-charset-normalizer@2.0.0:2.0', type=('build', 'run'), when='@2.26.0: ^python@3:') diff --git a/var/spack/repos/builtin/packages/py-resultsfile/package.py b/var/spack/repos/builtin/packages/py-resultsfile/package.py index f8b1d8b264..653a5de41a 100644 --- a/var/spack/repos/builtin/packages/py-resultsfile/package.py +++ b/var/spack/repos/builtin/packages/py-resultsfile/package.py @@ -20,3 +20,5 @@ class PyResultsfile(PythonPackage): depends_on('python@2.7:2.8', type=('build', 'run'), when='@1.0:1') depends_on('python@3:', type=('build', 'run'), when='@2.0:') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-rios/package.py b/var/spack/repos/builtin/packages/py-rios/package.py index 1eac1c5b33..21272f829a 100644 --- a/var/spack/repos/builtin/packages/py-rios/package.py +++ b/var/spack/repos/builtin/packages/py-rios/package.py @@ -19,5 +19,7 @@ class PyRios(PythonPackage): version('1.4.10', sha256='7f11b54eb1f2ec551d7fc01c039b60bf2c67f0c2fc5b2946f8d986d6a9bc7063') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('gdal+python', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-scientificpython/package.py b/var/spack/repos/builtin/packages/py-scientificpython/package.py index 1ddfbb493f..16b882cc56 100644 --- a/var/spack/repos/builtin/packages/py-scientificpython/package.py +++ b/var/spack/repos/builtin/packages/py-scientificpython/package.py @@ -16,4 +16,6 @@ class PyScientificpython(PythonPackage): url = "https://sourcesup.renater.fr/frs/download.php/file/4411/ScientificPython-2.8.1.tar.gz" version('2.8.1', sha256='d9ef354736410bbb2e8be33cb7433cf62114307a44e3a96baaa793b58b4b518b') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-scipy/package.py b/var/spack/repos/builtin/packages/py-scipy/package.py index 12a9f02eef..f8e58fdc92 100644 --- a/var/spack/repos/builtin/packages/py-scipy/package.py +++ b/var/spack/repos/builtin/packages/py-scipy/package.py @@ -55,7 +55,7 @@ class PyScipy(PythonPackage): depends_on('python@3.7:', when='@1.6:1.6.1', type=('build', 'link', 'run')) depends_on('python@3.7:3.9', when='@1.6.2:1.7.1', type=('build', 'link', 'run')) depends_on('python@3.7:3.10', when='@1.7.2:', type=('build', 'link', 'run')) - depends_on('py-setuptools', when='@:1.5', type='build') + depends_on('py-setuptools', type='build') depends_on('py-setuptools@:51.0.0', when='@1.6', type='build') depends_on('py-setuptools@:57', when='@1.7:', type='build') depends_on('py-pybind11@2.2.4:', when='@1.4.0', type=('build', 'link')) @@ -101,7 +101,7 @@ class PyScipy(PythonPackage): if platform.mac_ver()[0][0:2] == '11': env.set('MACOSX_DEPLOYMENT_TARGET', '10.15') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] if spec.satisfies('%fj'): args.extend(['config_fc', '--fcompiler=fujitsu']) diff --git a/var/spack/repos/builtin/packages/py-scs/package.py b/var/spack/repos/builtin/packages/py-scs/package.py index 42fb916091..a2ef803b80 100644 --- a/var/spack/repos/builtin/packages/py-scs/package.py +++ b/var/spack/repos/builtin/packages/py-scs/package.py @@ -25,7 +25,7 @@ class PyScs(PythonPackage): depends_on('py-numpy@1.7:', type=('build', 'run')) depends_on('py-scipy@0.13.2:', type=('build', 'run')) - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = [] if '+cuda' in spec or '+float32' in spec or '+int32' in spec or\ '+extra_verbose' in spec or '+blas64' in spec: diff --git a/var/spack/repos/builtin/packages/py-secretstorage/package.py b/var/spack/repos/builtin/packages/py-secretstorage/package.py index 8676609e36..0b81c371c0 100644 --- a/var/spack/repos/builtin/packages/py-secretstorage/package.py +++ b/var/spack/repos/builtin/packages/py-secretstorage/package.py @@ -14,11 +14,13 @@ class PySecretstorage(PythonPackage): version('3.3.1', sha256='fd666c51a6bf200643495a04abb261f83229dcb6fd8472ec393df7ffc8b6f195') version('3.1.2', sha256='15da8a989b65498e29be338b3b279965f1b8f09b9668bd8010da183024c8bff6') + version('2.3.1', sha256='3af65c87765323e6f64c83575b05393f9e003431959c9395d1791d51497f29b6') depends_on('python@3.6:', when='@3.3:', type=('build', 'run')) - depends_on('python@3.5:', when='@:3.2', type=('build', 'run')) - depends_on('py-setuptools@30.3:', type='build') + depends_on('python@3.5:', when='@3.0:3.2', type=('build', 'run')) + depends_on('py-setuptools@30.3:', when='@3:', type='build') + depends_on('py-setuptools', type='build') depends_on('py-cryptography@2.0:', when='@3.2:', type=('build', 'run')) depends_on('py-cryptography', when='@:3.1', type=('build', 'run')) depends_on('py-jeepney@0.6:', when='@3.3:', type=('build', 'run')) - depends_on('py-jeepney@0.4.2:', when='@:3.2', type=('build', 'run')) + depends_on('py-jeepney@0.4.2:', when='@3.0:3.2', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-setuptools-rust/package.py b/var/spack/repos/builtin/packages/py-setuptools-rust/package.py index f613e77184..1c4a01dfc6 100644 --- a/var/spack/repos/builtin/packages/py-setuptools-rust/package.py +++ b/var/spack/repos/builtin/packages/py-setuptools-rust/package.py @@ -20,8 +20,8 @@ class PySetuptoolsRust(PythonPackage): deprecated=True) depends_on('python@3.6:', when='@0.12:', type=('build', 'run')) - depends_on('py-setuptools@46.1:', when='@0.11.6:', type='build') - depends_on('py-setuptools', type='build') + depends_on('py-setuptools@46.1:', when='@0.11.6:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) depends_on('py-setuptools-scm+toml@3.4.3:', when='@0.11:', type='build') depends_on('py-semantic-version@2.6.0:', type=('build', 'run')) depends_on('py-toml@0.9.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-setuptools-scm-git-archive/package.py b/var/spack/repos/builtin/packages/py-setuptools-scm-git-archive/package.py index 86545dd628..50d6dea701 100644 --- a/var/spack/repos/builtin/packages/py-setuptools-scm-git-archive/package.py +++ b/var/spack/repos/builtin/packages/py-setuptools-scm-git-archive/package.py @@ -21,4 +21,4 @@ class PySetuptoolsScmGitArchive(PythonPackage): '1.0', sha256='52425f905518247c685fc64c5fdba6e1e74443c8562e141c8de56059be0e31da') depends_on('py-setuptools', type='build') - depends_on('py-setuptools-scm', type='build') + depends_on('py-setuptools-scm', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-setuptools/package.py b/var/spack/repos/builtin/packages/py-setuptools/package.py index 71804b5a69..b75aff3934 100644 --- a/var/spack/repos/builtin/packages/py-setuptools/package.py +++ b/var/spack/repos/builtin/packages/py-setuptools/package.py @@ -23,7 +23,9 @@ class PySetuptools(PythonPackage): version('49.6.0', sha256='46bd862894ed22c2edff033c758c2dc026324788d758e96788e8f7c11f4e9707') version('49.2.0', sha256='afe9e81fee0270d3f60d52608549cc8ec4c46dada8c95640c1a00160f577acf2') version('46.1.3', sha256='795e0475ba6cd7fa082b1ee6e90d552209995627a2a227a47c6ea93282f4bfb1') + version('44.1.1', sha256='c67aa55db532a0dadc4d2e20ba9961cbd3ccc84d544e9029699822542b5a476b') version('44.1.0', sha256='794a96b0c1dc6f182c36b72ab70d7e90f1d59f7a132e6919bb37b4fd4d424aca') + version('43.0.0', sha256='db45ebb4a4b3b95ff0aca3ce5fe1e820ce17be393caf8902c78aa36240e8c378') version('41.4.0', sha256='7eae782ccf36b790c21bde7d86a4f303a441cd77036b25c559a602cf5186ce4d') version('41.3.0', sha256='9f5c54b529b2156c6f288e837e625581bb31ff94d4cfd116b8f271c589749556') version('41.0.1', sha256='a222d126f5471598053c9a77f4b5d4f26eaa1f150ad6e01dcf1a42e185d05613') diff --git a/var/spack/repos/builtin/packages/py-sgp4/package.py b/var/spack/repos/builtin/packages/py-sgp4/package.py index e8a563110a..0d92b0dc9c 100644 --- a/var/spack/repos/builtin/packages/py-sgp4/package.py +++ b/var/spack/repos/builtin/packages/py-sgp4/package.py @@ -16,3 +16,5 @@ class PySgp4(PythonPackage): version('1.4', sha256='1fb3cdbc11981a9ff34a032169f83c1f4a2877d1b6c295aed044e1d890b73892') depends_on('python@2.6:2.8,3.3:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-shellingham/package.py b/var/spack/repos/builtin/packages/py-shellingham/package.py index a08ac33ce6..eca6a5046c 100644 --- a/var/spack/repos/builtin/packages/py-shellingham/package.py +++ b/var/spack/repos/builtin/packages/py-shellingham/package.py @@ -16,4 +16,3 @@ class PyShellingham(PythonPackage): depends_on('python@2.6:2.7,3.4:', type=('build', 'run')) depends_on('py-setuptools', type='build') - depends_on('py-wheel', type='build') diff --git a/var/spack/repos/builtin/packages/py-shiboken/package.py b/var/spack/repos/builtin/packages/py-shiboken/package.py index a9636321d3..2ec3f88fcc 100644 --- a/var/spack/repos/builtin/packages/py-shiboken/package.py +++ b/var/spack/repos/builtin/packages/py-shiboken/package.py @@ -43,5 +43,5 @@ class PyShiboken(PythonPackage): r'#rpath_cmd(shiboken_path, srcpath)', 'shiboken_postinstall.py') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): return ['--jobs={0}'.format(make_jobs)] diff --git a/var/spack/repos/builtin/packages/py-shiboken2/package.py b/var/spack/repos/builtin/packages/py-shiboken2/package.py index 8e5c1c5e28..c021bd1578 100644 --- a/var/spack/repos/builtin/packages/py-shiboken2/package.py +++ b/var/spack/repos/builtin/packages/py-shiboken2/package.py @@ -3,33 +3,25 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import platform +import sys from spack import * -class PyShiboken2(Package): +class PyShiboken2(PythonPackage): """Python / C++ bindings helper module.""" homepage = "https://www.pyside.org/" - if platform.system() == "Linux" and platform.machine() == "x86_64": + if sys.platform.startswith('linux'): version('5.15.2', url="https://files.pythonhosted.org/packages/cp35.cp36.cp37.cp38.cp39/s/shiboken2/shiboken2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl", sha256='4aee1b91e339578f9831e824ce2a1ec3ba3a463f41fda8946b4547c7eb3cba86', expand=False) - - elif platform.system() == "Linux" and platform.machine() == "maxosx": + elif sys.platform == 'darwin': version('5.15.2', url="https://files.pythonhosted.org/packages/cp35.cp36.cp37.cp38.cp39/s/shiboken2/shiboken2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-macosx_10_13_intel.whl", sha256='edc12a4df2b5be7ca1e762ab94e331ba9e2fbfe3932c20378d8aa3f73f90e0af', expand=False) - extends('python') - depends_on('py-pip', type='build') - depends_on('python@3.5:3.9', type=('build', 'run')) - - def install(self, spec, prefix): - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-simplekml/package.py b/var/spack/repos/builtin/packages/py-simplekml/package.py index 8613346177..100d6d4635 100644 --- a/var/spack/repos/builtin/packages/py-simplekml/package.py +++ b/var/spack/repos/builtin/packages/py-simplekml/package.py @@ -16,4 +16,6 @@ class PySimplekml(PythonPackage): version('1.3.1', sha256='30c121368ce1d73405721730bf766721e580cae6fbb7424884c734c89ec62ad7') - depends_on('python@2.6:') + depends_on('python@2.6:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-sip/package.py b/var/spack/repos/builtin/packages/py-sip/package.py index 981959150f..7d6732e9b5 100644 --- a/var/spack/repos/builtin/packages/py-sip/package.py +++ b/var/spack/repos/builtin/packages/py-sip/package.py @@ -60,6 +60,10 @@ class PySip(PythonPackage): python('configure.py', *args) + @when('@5:') + def build(self, spec, prefix): + pass + @when('@:4') def build(self, spec, prefix): make() diff --git a/var/spack/repos/builtin/packages/py-snowballstemmer/package.py b/var/spack/repos/builtin/packages/py-snowballstemmer/package.py index 621becfe68..5b55553d7e 100644 --- a/var/spack/repos/builtin/packages/py-snowballstemmer/package.py +++ b/var/spack/repos/builtin/packages/py-snowballstemmer/package.py @@ -16,4 +16,4 @@ class PySnowballstemmer(PythonPackage): version('2.0.0', sha256='df3bac3df4c2c01363f3dd2cfa78cce2840a79b9f1c2d2de9ce8d31683992f52') version('1.2.1', sha256='919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128') - depends_on('py-setuptools', when='@2:', type='build') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-sphinx-autodoc-typehints/package.py b/var/spack/repos/builtin/packages/py-sphinx-autodoc-typehints/package.py index 0e842d1596..eeb96ffa8b 100644 --- a/var/spack/repos/builtin/packages/py-sphinx-autodoc-typehints/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx-autodoc-typehints/package.py @@ -15,11 +15,6 @@ class PySphinxAutodocTypehints(PythonPackage): version('1.12.0', sha256='193617d9dbe0847281b1399d369e74e34cd959c82e02c7efde077fca908a9f52') depends_on('python@3.6:', type=('build', 'run')) - depends_on('py-setuptools@36.2.7:', type='build') - depends_on('py-setuptools-scm@1.7.0:', type='build') - depends_on('py-sphinx@3.2.0:', type='build') - depends_on('py-dataclasses', type=('test', 'run'), when='^python@:3.6') - depends_on('py-pytest@3.1.0:', type=('test', 'run')) - depends_on('py-sphobjinv@2.0:', type=('test', 'run')) - depends_on('py-typing-extensions@3.5:', type=('test', 'run')) - depends_on('py-typed-ast', type=('test', 'run')) + depends_on('py-setuptools@40.0.4:', type='build') + depends_on('py-setuptools-scm@2.0.0:', type='build') + depends_on('py-sphinx@3:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sphinxcontrib-mermaid/package.py b/var/spack/repos/builtin/packages/py-sphinxcontrib-mermaid/package.py index 464924247c..621cc89a26 100644 --- a/var/spack/repos/builtin/packages/py-sphinxcontrib-mermaid/package.py +++ b/var/spack/repos/builtin/packages/py-sphinxcontrib-mermaid/package.py @@ -16,4 +16,5 @@ class PySphinxcontribMermaid(PythonPackage): version('0.4.0', sha256='0ee45ba45b9575505eacdd6212e4e545213f4f93dfa32c7eeca32720dbc3b468') - depends_on('py-sphinx@1.7:') + depends_on('py-setuptools', type='build') + depends_on('py-sphinx@1.7:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sphinxcontrib-trio/package.py b/var/spack/repos/builtin/packages/py-sphinxcontrib-trio/package.py index fd4aea9243..0a1a527156 100644 --- a/var/spack/repos/builtin/packages/py-sphinxcontrib-trio/package.py +++ b/var/spack/repos/builtin/packages/py-sphinxcontrib-trio/package.py @@ -17,6 +17,7 @@ class PySphinxcontribTrio(PythonPackage): version('1.1.2', sha256='9f1ba9c1d5965b534e85258d8b677dd94e9b1a9a2e918b85ccd42590596b47c0') version('1.1.0', sha256='d90f46d239ba0556e53d9a110989f98c9eb2cea76ab47937a1f39b62f63fe654') - depends_on('py-sphinx@1.7:') + depends_on('py-setuptools', type='build') + depends_on('py-sphinx@1.7:', type=('build', 'run')) patch('sphinxcontrib-trio.patch', when='@1.1.0') diff --git a/var/spack/repos/builtin/packages/py-spyder/package.py b/var/spack/repos/builtin/packages/py-spyder/package.py index 43adf99b9f..a319249335 100644 --- a/var/spack/repos/builtin/packages/py-spyder/package.py +++ b/var/spack/repos/builtin/packages/py-spyder/package.py @@ -15,6 +15,8 @@ class PySpyder(PythonPackage): version('3.1.3', sha256='4978872cc5a006803bc8742d0a8fb43c49aef9524f0a9fcb8bd6dfcfdc2d2d6a') depends_on('python@2.7.0:2.8.0,3.3.0:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-rope@0.9.4:', type=('build', 'run'), when='^python@:3') # depends_on('py-rope_py3k', type=('build', 'run'), when='^python@3:') depends_on('py-jedi@0.9.0', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sqlalchemy-stubs/package.py b/var/spack/repos/builtin/packages/py-sqlalchemy-stubs/package.py index 615393c79f..401cdd9d3f 100644 --- a/var/spack/repos/builtin/packages/py-sqlalchemy-stubs/package.py +++ b/var/spack/repos/builtin/packages/py-sqlalchemy-stubs/package.py @@ -15,6 +15,6 @@ class PySqlalchemyStubs(PythonPackage): version('0.4', sha256='c665d6dd4482ef642f01027fa06c3d5e91befabb219dc71fc2a09e7d7695f7ae') depends_on('python@3.5:', type=('build', 'run')) - depends_on('py-mypy@0.790:', type=('test', 'run')) - depends_on('py-typing-extensions@3.7.4:', type=('test', 'run')) + depends_on('py-mypy@0.790:', type=('build', 'run')) + depends_on('py-typing-extensions@3.7.4:', type=('build', 'run')) depends_on('py-setuptools', type=('build')) diff --git a/var/spack/repos/builtin/packages/py-statsmodels/package.py b/var/spack/repos/builtin/packages/py-statsmodels/package.py index 3992146ed0..89e9189b68 100644 --- a/var/spack/repos/builtin/packages/py-statsmodels/package.py +++ b/var/spack/repos/builtin/packages/py-statsmodels/package.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import glob - from spack import * @@ -51,7 +49,7 @@ class PyStatsmodels(PythonPackage): depends_on('py-pytest', type='test') - @run_after('build') + @run_after('install') @on_package_attributes(run_tests=True) def build_test(self): dirs = glob.glob("build/lib*") # There can be only one... diff --git a/var/spack/repos/builtin/packages/py-symengine/package.py b/var/spack/repos/builtin/packages/py-symengine/package.py index 0411c455bf..3a154334da 100644 --- a/var/spack/repos/builtin/packages/py-symengine/package.py +++ b/var/spack/repos/builtin/packages/py-symengine/package.py @@ -12,7 +12,6 @@ class PySymengine(PythonPackage): homepage = "https://github.com/symengine/symengine.py" pypi = "symengine/symengine-0.2.0.tar.gz" git = "https://github.com/symengine/symengine.py.git" - phases = ['install'] version('master', branch='master') # pypi source doesn't have necessary files in cmake directory @@ -31,5 +30,5 @@ class PySymengine(PythonPackage): depends_on('symengine@0.2.0', when='@0.2.0') depends_on('symengine@0.8.1', when='@0.8.1') - def install_args(self, spec, prefix): + def install_options(self, spec, prefix): return ['--symengine-dir={0}'.format(spec['symengine'].prefix)] diff --git a/var/spack/repos/builtin/packages/py-sympy/package.py b/var/spack/repos/builtin/packages/py-sympy/package.py index 0a66ac6025..edb728a240 100644 --- a/var/spack/repos/builtin/packages/py-sympy/package.py +++ b/var/spack/repos/builtin/packages/py-sympy/package.py @@ -29,4 +29,6 @@ class PySympy(PythonPackage): depends_on('python@3.5:', when='@1.6', type=('build', 'run')) depends_on('python@3.6:', when='@1.7:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-mpmath@0.19:', when='@1.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-systemd-python/package.py b/var/spack/repos/builtin/packages/py-systemd-python/package.py index cdb531c4b2..f234d66c7c 100644 --- a/var/spack/repos/builtin/packages/py-systemd-python/package.py +++ b/var/spack/repos/builtin/packages/py-systemd-python/package.py @@ -13,3 +13,6 @@ class PySystemdPython(PythonPackage): pypi = "systemd-python/systemd-python-234.tar.gz" version('234', sha256='fd0e44bf70eadae45aadc292cb0a7eb5b0b6372cd1b391228047d33895db83e7') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py b/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py index 74775535b0..ae4d752023 100644 --- a/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py +++ b/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py @@ -28,6 +28,8 @@ class PyTensorboardPluginWit(Package): # Bazel 3.7+ does not work # https://github.com/PAIR-code/what-if-tool/issues/140 depends_on('bazel@0.26.1:3.6', type='build') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools@36.2.0:', type='build') depends_on('python@2.7:2.8,3.2:', type=('build', 'run')) depends_on('py-wheel', type='build') @@ -83,6 +85,6 @@ class PyTensorboardPluginWit(Package): def install(self, spec, prefix): with working_dir('spack-build/release'): - setup_py('install', '--prefix={0}'.format(prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) remove_linked_tree(self.tmp_path) diff --git a/var/spack/repos/builtin/packages/py-tensorboard/package.py b/var/spack/repos/builtin/packages/py-tensorboard/package.py index d02154959a..8efcb02afc 100644 --- a/var/spack/repos/builtin/packages/py-tensorboard/package.py +++ b/var/spack/repos/builtin/packages/py-tensorboard/package.py @@ -23,6 +23,8 @@ class PyTensorboard(Package): depends_on('python@2.7:2.8,3.2:', type=('build', 'run')) depends_on('bazel@2.1.0:', type='build', when='@2.2.0:') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools@41.0.0:', type=('build', 'run')) depends_on('py-absl-py@0.4:', type=('build', 'run')) depends_on('py-markdown@2.6.8:', type=('build', 'run')) @@ -102,6 +104,6 @@ class PyTensorboard(Package): def install(self, spec, prefix): with working_dir('spack-build'): - setup_py('install', '--prefix={0}'.format(prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) remove_linked_tree(self.tmp_path) diff --git a/var/spack/repos/builtin/packages/py-tensorflow-estimator/package.py b/var/spack/repos/builtin/packages/py-tensorflow-estimator/package.py index 04b4a8c225..bac41b4436 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow-estimator/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow-estimator/package.py @@ -34,6 +34,8 @@ class PyTensorflowEstimator(Package): depends_on('py-tensorflow@1.13.1', type=('build', 'run'), when='@1.13.0') depends_on('bazel@0.19.0:', type='build') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-funcsigs@1.0.2:', type=('build', 'run')) def install(self, spec, prefix): @@ -74,6 +76,6 @@ class PyTensorflowEstimator(Package): buildpath = join_path(self.stage.source_path, 'spack-build') build_pip_package('--src', buildpath) with working_dir(buildpath): - setup_py('install', '--prefix={0}'.format(prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) remove_linked_tree(self.tmp_path) diff --git a/var/spack/repos/builtin/packages/py-tensorflow-hub/package.py b/var/spack/repos/builtin/packages/py-tensorflow-hub/package.py index f432c8fc8c..cce54d34ea 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow-hub/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow-hub/package.py @@ -21,6 +21,8 @@ class PyTensorflowHub(Package): extends('python') depends_on('bazel', type='build') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools', type='build') depends_on('python@3.6:', type=('build', 'run')) depends_on('py-numpy@1.12.0:', type=('build', 'run')) @@ -68,8 +70,8 @@ class PyTensorflowHub(Package): join_path(insttmp_path, 'tensorflow_hub')) with working_dir(insttmp_path): - setup_py('install', '--prefix={0}'.format(prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) remove_linked_tree(tmp_path) remove_linked_tree(insttmp_path) diff --git a/var/spack/repos/builtin/packages/py-tensorflow-probability/package.py b/var/spack/repos/builtin/packages/py-tensorflow-probability/package.py index 109a99d05d..9a7f2e6eba 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow-probability/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow-probability/package.py @@ -24,6 +24,8 @@ class PyTensorflowProbability(Package): url='https://github.com/tensorflow/probability/archive/0.8.0.tar.gz') extends('python') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools', type='build') depends_on('py-six@1.10.0:', type=('build', 'run')) @@ -78,7 +80,7 @@ class PyTensorflowProbability(Package): with working_dir(join_path('bazel-bin', 'pip_pkg.runfiles', 'tensorflow_probability')): - setup_py('install', '--prefix={0}'.format(prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) remove_linked_tree(self.tmp_path) diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index 0544eddc85..e6ea286225 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -134,6 +134,8 @@ class PyTensorflow(Package, CudaPackage): depends_on('bazel@0.1.1', type='build', when='@0.5:0.6') depends_on('swig', type='build') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') depends_on('py-setuptools', type='build') depends_on('py-future', type='build', when='^python@:2') @@ -787,9 +789,8 @@ def protobuf_deps(): tmp_path = env['TEST_TMPDIR'] buildpath = join_path(self.stage.source_path, 'spack-build') with working_dir(buildpath): - - setup_py('install', '--prefix={0}'.format(prefix), - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) remove_linked_tree(tmp_path) def test(self): diff --git a/var/spack/repos/builtin/packages/py-termcolor/package.py b/var/spack/repos/builtin/packages/py-termcolor/package.py index 9bd6d5c0d6..c0135ede7e 100644 --- a/var/spack/repos/builtin/packages/py-termcolor/package.py +++ b/var/spack/repos/builtin/packages/py-termcolor/package.py @@ -12,3 +12,6 @@ class PyTermcolor(PythonPackage): pypi = "termcolor/termcolor-1.1.0.tar.gz" version('1.1.0', sha256='1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-terminado/package.py b/var/spack/repos/builtin/packages/py-terminado/package.py index 75b60f68ac..6cf8a0848e 100644 --- a/var/spack/repos/builtin/packages/py-terminado/package.py +++ b/var/spack/repos/builtin/packages/py-terminado/package.py @@ -15,8 +15,10 @@ class PyTerminado(PythonPackage): version('0.8.1', sha256='55abf9ade563b8f9be1f34e4233c7b7bde726059947a593322e8a553cc4c067a') version('0.6', sha256='2c0ba1f624067dccaaead7d2247cfe029806355cef124dc2ccb53c83229f0126') - depends_on('py-tornado@4:', type=('build', 'run')) - depends_on('py-ptyprocess', type=('build', 'run')) - depends_on('python@2.7:2.8,3.4:', when='@0.8.2:', type=('build', 'run')) depends_on('python@3.6:', when='@0.12.1:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.4:', when='@0.8.2:', type=('build', 'run')) depends_on('py-setuptools@40.8.0:', when='@0.12.1:', type='build') + depends_on('py-setuptools', type='build') + depends_on('py-flit', when='@0.8', type='build') + depends_on('py-tornado@4:', type=('build', 'run')) + depends_on('py-ptyprocess', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-testpath/package.py b/var/spack/repos/builtin/packages/py-testpath/package.py index 9766e052ea..0bf37046ab 100644 --- a/var/spack/repos/builtin/packages/py-testpath/package.py +++ b/var/spack/repos/builtin/packages/py-testpath/package.py @@ -17,3 +17,4 @@ class PyTestpath(PythonPackage): version('0.4.2', sha256='b694b3d9288dbd81685c5d2e7140b81365d46c29f5db4bc659de5aa6b98780f8') depends_on('python@3.5:', type=('build', 'run'), when='@0.5.0:') + depends_on('py-flit-core@3.2.0:3.2', type='build') diff --git a/var/spack/repos/builtin/packages/py-tfdlpack/package.py b/var/spack/repos/builtin/packages/py-tfdlpack/package.py index ce0771a5f4..e8419866fd 100644 --- a/var/spack/repos/builtin/packages/py-tfdlpack/package.py +++ b/var/spack/repos/builtin/packages/py-tfdlpack/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -class PyTfdlpack(CMakePackage): +class PyTfdlpack(CMakePackage, PythonPackage): """Tensorflow plugin for DLPack.""" homepage = "https://github.com/VoVAllen/tf-dlpack" @@ -37,8 +37,8 @@ class PyTfdlpack(CMakePackage): def install(self, spec, prefix): with working_dir('python'): - setup_py('install', '--prefix=' + prefix, - '--single-version-externally-managed', '--root=/') + args = std_pip_args + ['--prefix=' + prefix, '.'] + pip(*args) def setup_run_environment(self, env): # Prevent TensorFlow from taking over the whole GPU diff --git a/var/spack/repos/builtin/packages/py-thirdorder/package.py b/var/spack/repos/builtin/packages/py-thirdorder/package.py index 4b77d2d3cd..c09ba2e100 100644 --- a/var/spack/repos/builtin/packages/py-thirdorder/package.py +++ b/var/spack/repos/builtin/packages/py-thirdorder/package.py @@ -12,7 +12,8 @@ class PyThirdorder(PythonPackage): homepage = "https://www.shengbte.org" url = "http://www.shengbte.org/downloads/thirdorder-v1.1.1-8526f47.tar.bz2" - version('1.1.1-8526f47', '5e1cc8d6ffa7efdb7325c397ca236863ea8a9c5bed1c558acca68b140f89167e') + # Deprecated because download doesn't work + version('1.1.1-8526f47', '5e1cc8d6ffa7efdb7325c397ca236863ea8a9c5bed1c558acca68b140f89167e', deprecated=True) depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-threadpoolctl/package.py b/var/spack/repos/builtin/packages/py-threadpoolctl/package.py index e4fa34ab2f..21fb632903 100644 --- a/var/spack/repos/builtin/packages/py-threadpoolctl/package.py +++ b/var/spack/repos/builtin/packages/py-threadpoolctl/package.py @@ -17,3 +17,4 @@ class PyThreadpoolctl(PythonPackage): depends_on('python@3.5:', type=('build', 'run')) depends_on('python@3.6:', type=('build', 'run'), when='@3.0.0:') + depends_on('py-flit', type='build') diff --git a/var/spack/repos/builtin/packages/py-tomli/package.py b/var/spack/repos/builtin/packages/py-tomli/package.py index 914e2098a5..6f4e2586ad 100644 --- a/var/spack/repos/builtin/packages/py-tomli/package.py +++ b/var/spack/repos/builtin/packages/py-tomli/package.py @@ -6,21 +6,16 @@ from spack import * -class PyTomli(Package): +class PyTomli(PythonPackage): """Tomli is a Python library for parsing TOML. Tomli is fully compatible with TOML v1.0.0.""" homepage = "https://github.com/hukkin/tomli" - url = "https://pypi.io/packages/py3/t/tomli/tomli-1.2.1-py3-none-any.whl" + url = "https://files.pythonhosted.org/packages/py3/t/tomli/tomli-1.2.2-py3-none-any.whl" + list_url = "https://pypi.org/simple/tomli/" + version('1.2.2', sha256='f04066f68f5554911363063a30b108d2b5a5b1a010aa8b6132af78489fe3aade', expand=False) version('1.2.1', sha256='8dd0e9524d6f386271a36b41dbf6c57d8e32fd96fd22b6584679dc569d20899f', expand=False) - extends('python') depends_on('python@3.6:', type=('build', 'run')) - depends_on('py-pip', type='build') - - def install(self, spec, prefix): - # TODO: figure out how to build with flit - pip = which('pip') - pip('install', self.stage.archive_file, '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-tomlkit/package.py b/var/spack/repos/builtin/packages/py-tomlkit/package.py index 202240510a..67a694a059 100644 --- a/var/spack/repos/builtin/packages/py-tomlkit/package.py +++ b/var/spack/repos/builtin/packages/py-tomlkit/package.py @@ -15,9 +15,8 @@ class PyTomlkit(PythonPackage): version('0.7.2', sha256='d7a454f319a7e9bd2e249f239168729327e4dd2d27b17dc68be264ad1ce36754') version('0.7.0', sha256='ac57f29693fab3e309ea789252fcce3061e19110085aa31af5446ca749325618') - depends_on('python@2.7:2.8,3.5:', type=('build', 'run')) - depends_on('py-setuptools', type='build') - - depends_on('py-enum34@1.1:1', when='^python@:2', type=('build', 'run')) - depends_on('py-functools32@3.2.3:3', when='^python@:2', type=('build', 'run')) - depends_on('py-typing@3.6:3', when='^python@:3.4', type=('build', 'run')) + depends_on('python@2.7,3.5:', type=('build', 'run')) + depends_on('py-poetry-core@1:', type='build') + depends_on('py-enum34@1.1:1', when='^python@2.7', type=('build', 'run')) + depends_on('py-functools32@3.2.3:3', when='^python@2.7', type=('build', 'run')) + depends_on('py-typing@3.6:3', when='^python@2.7,3.4', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-tomopy/package.py b/var/spack/repos/builtin/packages/py-tomopy/package.py index 81856f816a..45b384ceb9 100644 --- a/var/spack/repos/builtin/packages/py-tomopy/package.py +++ b/var/spack/repos/builtin/packages/py-tomopy/package.py @@ -34,8 +34,7 @@ class PyTomopy(PythonPackage): depends_on('py-scikit-image@0.17:', type=('build', 'run')) depends_on('py-numpy+blas', type=('build', 'run')) depends_on('py-pyfftw', type=('build', 'run'), when='@1.0:1.9') - depends_on('py-numexpr', type=('test')) - depends_on('py-scipy', type=('build', 'test', 'run')) + depends_on('py-scipy', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-h5py', type=('build', 'run')) depends_on('py-six', type=('build', 'run')) @@ -43,7 +42,7 @@ class PyTomopy(PythonPackage): depends_on('py-dxchange', type=('build', 'run')) @when('@1.10:') - def build_args(self, spec, prefix): + def install_options(self, spec, prefix): args = ['--enable-arch'] if 'avx512' in self.spec.target: args.append('--enable-avx512') diff --git a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py index af6666b6c8..4056c8fb25 100644 --- a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py +++ b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py @@ -11,8 +11,6 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage): homepage = "https://github.com/nvidia/apex/" git = "https://github.com/nvidia/apex/" - phases = ['install'] - version('master', branch='master') version('2020-10-19', commit='8a1ed9e8d35dfad26fb973996319965e4224dcdd') @@ -34,8 +32,8 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage): self.spec.variants['cuda_arch'].value) env.set('TORCH_CUDA_ARCH_LIST', torch_cuda_arch) - def install_args(self, spec, prefix): - args = super(PyTorchNvidiaApex, self).install_args(spec, prefix) + def install_options(self, spec, prefix): + args = [] if spec.satisfies('^py-torch@1.0:'): args.append('--cpp_ext') if '+cuda' in spec: diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index 1563310bb2..750782db5b 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -201,10 +201,6 @@ class PyTorch(PythonPackage, CudaPackage): patch('https://github.com/pytorch/pytorch/commit/c075f0f633fa0136e68f0a455b5b74d7b500865c.patch', sha256='e69e41b5c171bfb00d1b5d4ee55dd5e4c8975483230274af4ab461acd37e40b8', when='@1.10.0+distributed~tensorpipe') - # Both build and install run cmake/make/make install - # Only run once to speed up build times - phases = ['install'] - @property def libs(self): root = join_path(python_platlib, 'torch', 'lib') @@ -397,8 +393,3 @@ class PyTorch(PythonPackage, CudaPackage): def install_test(self): with working_dir('test'): python('run_test.py') - - # Tests need to be re-added since `phases` was overridden - run_after('install')( - PythonPackage._run_default_install_time_test_callbacks) - run_after('install')(PythonPackage.sanity_check_prefix) diff --git a/var/spack/repos/builtin/packages/py-torchfile/package.py b/var/spack/repos/builtin/packages/py-torchfile/package.py index eb3b13dec0..25eedd64a4 100644 --- a/var/spack/repos/builtin/packages/py-torchfile/package.py +++ b/var/spack/repos/builtin/packages/py-torchfile/package.py @@ -19,4 +19,6 @@ class PyTorchfile(PythonPackage): version('0.1.0', sha256='a53dfe134b737845a9f2cb24fe0585317874f965932cebdb0439d13c8da4136e') depends_on('python@2.7:2,3.4:', type=('build', 'run')) + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-traitlets/package.py b/var/spack/repos/builtin/packages/py-traitlets/package.py index 5ea86a8ab4..f8828d865d 100644 --- a/var/spack/repos/builtin/packages/py-traitlets/package.py +++ b/var/spack/repos/builtin/packages/py-traitlets/package.py @@ -25,6 +25,7 @@ class PyTraitlets(PythonPackage): depends_on('python@3.7:', when='@5:', type=('build', 'run')) depends_on('python@2.7:2.8,3.3:', type=('build', 'run')) + depends_on('py-setuptools@40.8:', type='build') depends_on('py-ipython-genutils', when='@:5.0', type=('build', 'run')) depends_on('py-six', when='@:4', type=('build', 'run')) depends_on('py-decorator', when='@:4', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-transforms3d/package.py b/var/spack/repos/builtin/packages/py-transforms3d/package.py index 97540ad2fb..d441fa7c8a 100644 --- a/var/spack/repos/builtin/packages/py-transforms3d/package.py +++ b/var/spack/repos/builtin/packages/py-transforms3d/package.py @@ -14,4 +14,6 @@ class PyTransforms3d(PythonPackage): version('0.3.1', sha256='404c7797c78aa461cb8043081901fc5517cef342d5ff56becd74a7967ba88d78') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-numpy@1.5.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-treehash/package.py b/var/spack/repos/builtin/packages/py-treehash/package.py index 5373ef5179..ddc1f0bfb1 100644 --- a/var/spack/repos/builtin/packages/py-treehash/package.py +++ b/var/spack/repos/builtin/packages/py-treehash/package.py @@ -14,3 +14,6 @@ class PyTreehash(PythonPackage): pypi = "treehash/TreeHash-1.0.2.tar.gz" version('1.0.2', sha256='fefcadd6a1e8ba2808897d776d5ae8bdae56ec3fe90ed385c1322357269f27a4') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-triangle/package.py b/var/spack/repos/builtin/packages/py-triangle/package.py index a1ea8fe592..cb4bf7f9ba 100644 --- a/var/spack/repos/builtin/packages/py-triangle/package.py +++ b/var/spack/repos/builtin/packages/py-triangle/package.py @@ -14,6 +14,7 @@ class PyTriangle(PythonPackage): version('20200424', sha256='fc207641f8f39986f7d2bee1b91688a588cd235d2e67777422f94e61fece27e9') + depends_on('py-setuptools', type='build') depends_on('triangle', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) depends_on('py-cython', type=('build')) diff --git a/var/spack/repos/builtin/packages/py-tuiview/package.py b/var/spack/repos/builtin/packages/py-tuiview/package.py index be0035dad4..f8dd8831ac 100644 --- a/var/spack/repos/builtin/packages/py-tuiview/package.py +++ b/var/spack/repos/builtin/packages/py-tuiview/package.py @@ -17,6 +17,8 @@ class PyTuiview(PythonPackage): version('1.2.6', sha256='61b136fa31c949d7a7a4dbf8562e6fc677d5b1845b152ec39e337f4eb2e91662') version('1.1.7', sha256='fbf0bf29cc775357dad4f8a2f0c2ffa98bbf69d603a96353e75b321adef67573') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on("py-pyqt4", type=('build', 'run'), when='@:1.1') depends_on("py-pyqt5", type=('build', 'run'), when='@1.2.0:') depends_on("py-numpy", type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-typeguard/package.py b/var/spack/repos/builtin/packages/py-typeguard/package.py index b8765f4ec0..7d9de625b6 100644 --- a/var/spack/repos/builtin/packages/py-typeguard/package.py +++ b/var/spack/repos/builtin/packages/py-typeguard/package.py @@ -15,9 +15,5 @@ class PyTypeguard(PythonPackage): version('2.12.1', sha256='c2af8b9bdd7657f4bd27b45336e7930171aead796711bc4cfc99b4731bb9d051') depends_on('python@3.5.3:', type=('build', 'run')) - depends_on('py-setuptools', type='build') - depends_on('py-sphinx-rtd-theme', type='build') - depends_on('py-sphinx-autodoc-typehints', type='build') - depends_on('py-pytest', type=('test', 'run')) - depends_on('py-typing-extensions', type=('test', 'run')) - depends_on('py-mypy', type=('test', 'run')) + depends_on('py-setuptools@42:', type='build') + depends_on('py-setuptools-scm@3.4:+toml', type='build') diff --git a/var/spack/repos/builtin/packages/py-typesentry/package.py b/var/spack/repos/builtin/packages/py-typesentry/package.py index 12afda00c3..d02f615758 100644 --- a/var/spack/repos/builtin/packages/py-typesentry/package.py +++ b/var/spack/repos/builtin/packages/py-typesentry/package.py @@ -17,4 +17,5 @@ class PyTypesentry(PythonPackage): # See the git history of __version__.py for versioning information version('0.2.7', commit='0ca8ed0e62d15ffe430545e7648c9a9b2547b49c') + depends_on('py-setuptools', type='build') depends_on('py-colorama@0.3.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-uhi/package.py b/var/spack/repos/builtin/packages/py-uhi/package.py index f79e9ab1e4..dc8fb7bb3b 100644 --- a/var/spack/repos/builtin/packages/py-uhi/package.py +++ b/var/spack/repos/builtin/packages/py-uhi/package.py @@ -18,5 +18,4 @@ class PyUhi(PythonPackage): depends_on('python@3.6:', type=('build', 'run')) depends_on('py-numpy@1.13.3:', type=('build', 'run')) depends_on('py-typing-extensions@3.7:', type=('build', 'run'), when='^python@:3.7') - depends_on('py-setuptools', type='build') - # depends_on('py-poetry-core@1:', type='build') -- WIP + depends_on('py-poetry-core@1:', type='build') diff --git a/var/spack/repos/builtin/packages/py-vcf-kit/package.py b/var/spack/repos/builtin/packages/py-vcf-kit/package.py index 5db1f02667..63ffd22cac 100644 --- a/var/spack/repos/builtin/packages/py-vcf-kit/package.py +++ b/var/spack/repos/builtin/packages/py-vcf-kit/package.py @@ -15,7 +15,7 @@ class PyVcfKit(PythonPackage): version('0.1.6', sha256='4865414ac9dc6996c0baeefadf1d528c28e6d0c3cc3dbdc28a2cdc6e06212428', deprecated=True) - depends_on('python@2.7:2.8', type=('build', 'run')) + depends_on('python', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-awesome-slugify', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-vermin/package.py b/var/spack/repos/builtin/packages/py-vermin/package.py index 8fb01357e1..d5174d84c1 100644 --- a/var/spack/repos/builtin/packages/py-vermin/package.py +++ b/var/spack/repos/builtin/packages/py-vermin/package.py @@ -32,7 +32,7 @@ class PyVermin(PythonPackage): depends_on('python@2.7:', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run')) - @run_after('build') + @run_after('install') @on_package_attributes(run_tests=True) def build_test(self): make('test') diff --git a/var/spack/repos/builtin/packages/py-webkit-server/package.py b/var/spack/repos/builtin/packages/py-webkit-server/package.py index 985c6d511d..a3868b1827 100644 --- a/var/spack/repos/builtin/packages/py-webkit-server/package.py +++ b/var/spack/repos/builtin/packages/py-webkit-server/package.py @@ -15,3 +15,6 @@ class PyWebkitServer(PythonPackage): version('develop', branch='master') version('1.0', sha256='836dac18c823bf7737461a2d938c66c7b3601c858897e6c92c7ba0e33574a2bc') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-wget/package.py b/var/spack/repos/builtin/packages/py-wget/package.py index 329abed851..0d795a7b78 100644 --- a/var/spack/repos/builtin/packages/py-wget/package.py +++ b/var/spack/repos/builtin/packages/py-wget/package.py @@ -15,3 +15,6 @@ class PyWget(PythonPackage): pypi = "wget/wget-3.2.zip" version('3.2', sha256='35e630eca2aa50ce998b9b1a127bb26b30dfee573702782aa982f875e3f16061') + + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-wheel/package.py b/var/spack/repos/builtin/packages/py-wheel/package.py index f90ac695c0..12ca492976 100644 --- a/var/spack/repos/builtin/packages/py-wheel/package.py +++ b/var/spack/repos/builtin/packages/py-wheel/package.py @@ -6,26 +6,33 @@ from spack import * -class PyWheel(PythonPackage): +class PyWheel(Package): """A built-package format for Python.""" homepage = "https://github.com/pypa/wheel" - pypi = "wheel/wheel-0.34.2.tar.gz" + url = "https://files.pythonhosted.org/packages/py2.py3/w/wheel/wheel-0.34.2-py2.py3-none-any.whl" + list_url = "https://pypi.org/simple/wheel/" - version('0.37.0', sha256='e2ef7239991699e3355d54f8e968a21bb940a1dbf34a4d226741e64462516fad') - version('0.36.2', sha256='e11eefd162658ea59a60a0f6c7d493a7190ea4b9a85e335b33489d9f17e0245e') - version('0.35.1', sha256='99a22d87add3f634ff917310a3d87e499f19e663413a52eb9232c447aa646c9f') - version('0.34.2', sha256='8788e9155fe14f54164c1b9eb0a319d98ef02c160725587ad60f14ddc57b6f96') - version('0.33.6', sha256='10c9da68765315ed98850f8e048347c3eb06dd81822dc2ab1d4fde9dc9702646') - version('0.33.4', sha256='62fcfa03d45b5b722539ccbc07b190e4bfff4bb9e3a4d470dd9f6a0981002565') - version('0.33.1', sha256='66a8fd76f28977bb664b098372daef2b27f60dc4d1688cfab7b37a09448f0e9d') - version('0.32.3', sha256='029703bf514e16c8271c3821806a1c171220cc5bdd325cbf4e7da1e056a01db6') - version('0.29.0', sha256='1ebb8ad7e26b448e9caa4773d2357849bf80ff9e313964bcaf79cbf0201a1648') - version('0.26.0', sha256='eaad353805c180a47545a256e6508835b65a8e830ba1093ed8162f19a50a530c') + version('0.37.0', sha256='21014b2bd93c6d0034b6ba5d35e4eb284340e09d63c59aef6fc14b0f346146fd', expand=False) + version('0.36.2', sha256='78b5b185f0e5763c26ca1e324373aadd49182ca90e825f7853f4b2509215dc0e', expand=False) + version('0.35.1', sha256='497add53525d16c173c2c1c733b8f655510e909ea78cc0e29d374243544b77a2', expand=False) + version('0.34.2', sha256='df277cb51e61359aba502208d680f90c0493adec6f0e848af94948778aed386e', expand=False) + version('0.33.6', sha256='f4da1763d3becf2e2cd92a14a7c920f0f00eca30fdde9ea992c836685b9faf28', expand=False) + version('0.33.4', sha256='5e79117472686ac0c4aef5bad5172ea73a1c2d1646b808c35926bd26bdfb0c08', expand=False) + version('0.33.1', sha256='8eb4a788b3aec8abf5ff68d4165441bc57420c9f64ca5f471f58c3969fe08668', expand=False) + version('0.32.3', sha256='1e53cdb3f808d5ccd0df57f964263752aa74ea7359526d3da6c02114ec1e1d44', expand=False) + version('0.29.0', sha256='ea8033fc9905804e652f75474d33410a07404c1a78dd3c949a66863bd1050ebd', expand=False) + version('0.26.0', sha256='c92ed3a2dd87c54a9e20024fb0a206fe591c352c745fff21e8f8c6cdac2086ea', expand=False) + extends('python') depends_on('python@2.7:2.8,3.5:', when='@0.34:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', when='@0.30:', type=('build', 'run')) depends_on('python@2.6:2.8,3.2:', type=('build', 'run')) - depends_on('py-setuptools@40.9.0:', when='@0.34.1:', type=('build', 'run')) - depends_on('py-setuptools', type=('build', 'run')) - depends_on('py-setuptools-scm@3.4:', when='@0.34.0', type='build') + depends_on('py-pip', type='build') + + def install(self, spec, prefix): + # To build wheel from source, you need setuptools and wheel already installed. + # We get around this by using a pre-built wheel, see: + # https://discuss.python.org/t/bootstrapping-a-specific-version-of-pip/12306 + args = std_pip_args + ['--prefix=' + prefix, self.stage.archive_file] + pip(*args) diff --git a/var/spack/repos/builtin/packages/py-wrapt/package.py b/var/spack/repos/builtin/packages/py-wrapt/package.py index 48f085ed08..89450be88a 100644 --- a/var/spack/repos/builtin/packages/py-wrapt/package.py +++ b/var/spack/repos/builtin/packages/py-wrapt/package.py @@ -20,4 +20,4 @@ class PyWrapt(PythonPackage): depends_on('python@2.7:2,3.5:', when='@1.13.1:', type=('build', 'run')) depends_on('python@2.7:2,3.3:', when='@1.13:', type=('build', 'run')) - depends_on('py-setuptools@38.3:', when='@1.13:', type='build') + depends_on('py-setuptools@38.3:', type='build') diff --git a/var/spack/repos/builtin/packages/py-xgboost/package.py b/var/spack/repos/builtin/packages/py-xgboost/package.py index b1c08f53b3..d5534686e4 100644 --- a/var/spack/repos/builtin/packages/py-xgboost/package.py +++ b/var/spack/repos/builtin/packages/py-xgboost/package.py @@ -54,10 +54,6 @@ class PyXgboost(PythonPackage): conflicts('+dask', when='@:0') conflicts('+plotting', when='@:0') - # `--use-system-libxgboost` is only valid for the 'install' phase, but we want to - # skip building of the C++ library and rely on an external dependency - phases = ['install'] - @when('@:0.90') def patch(self): # Fix OpenMP support on macOS @@ -79,12 +75,5 @@ class PyXgboost(PythonPackage): os.path.join('xgboost', 'libpath.py'), string=True) @when('@1.3:') - def install_args(self, spec, prefix): - args = super(PyXgboost, self).install_args(spec, prefix) - args.append('--use-system-libxgboost') - return args - - # Tests need to be re-added since `phases` was overridden - run_after('install')( - PythonPackage._run_default_install_time_test_callbacks) - run_after('install')(PythonPackage.sanity_check_prefix) + def install_options(self, spec, prefix): + return ['--use-system-libxgboost'] diff --git a/var/spack/repos/builtin/packages/py-xlrd/package.py b/var/spack/repos/builtin/packages/py-xlrd/package.py index 6e4719ede6..ba76fe621c 100644 --- a/var/spack/repos/builtin/packages/py-xlrd/package.py +++ b/var/spack/repos/builtin/packages/py-xlrd/package.py @@ -18,4 +18,4 @@ class PyXlrd(PythonPackage): depends_on('python@2.7:2.8,3.6:', when='@2:', type=('build', 'run')) depends_on('python@2.6:', type=('build', 'run')) - depends_on('py-setuptools', when='@1:', type='build') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-xlsxwriter/package.py b/var/spack/repos/builtin/packages/py-xlsxwriter/package.py index 34e93b0606..d017a4e053 100644 --- a/var/spack/repos/builtin/packages/py-xlsxwriter/package.py +++ b/var/spack/repos/builtin/packages/py-xlsxwriter/package.py @@ -13,3 +13,5 @@ class PyXlsxwriter(PythonPackage): pypi = "XlsxWriter/XlsxWriter-1.0.2.tar.gz" version('1.0.2', sha256='a26bbbafff88abffce592ffd5dfaa4c9f08dc44ef4afbf45c70d3e270325f856') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-yahmm/package.py b/var/spack/repos/builtin/packages/py-yahmm/package.py index 193901cd85..785f3d7da1 100644 --- a/var/spack/repos/builtin/packages/py-yahmm/package.py +++ b/var/spack/repos/builtin/packages/py-yahmm/package.py @@ -14,6 +14,8 @@ class PyYahmm(PythonPackage): version('1.1.3', sha256='fe3614ef96da9410468976756fb93dc8235485242c05df01d8e5ed356a7dfb43') version('1.1.2', sha256='5e81077323dc6da9fb792169b639f29e5293b0c8272e4c22b204ca95ac0df90a') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-cython@0.20.1:', type=('build', 'run')) depends_on('py-numpy@1.8.0:', type=('build', 'run')) depends_on('py-scipy@0.13.3:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-yarl/package.py b/var/spack/repos/builtin/packages/py-yarl/package.py index 19cadcdbc8..cd7abdd4f2 100644 --- a/var/spack/repos/builtin/packages/py-yarl/package.py +++ b/var/spack/repos/builtin/packages/py-yarl/package.py @@ -22,7 +22,7 @@ class PyYarl(PythonPackage): depends_on('py-idna@2.0:', type=('build', 'run')) depends_on('py-typing-extensions@3.7.4:', type=('build', 'run'), when='@1.7.2: ^python@:3.7') - @run_before('build') + @run_before('install') def fix_cython(self): if self.spec.satisfies('@1.7.2:'): pyxfile = 'yarl/_quoting_c' diff --git a/var/spack/repos/builtin/packages/py-yolk3k/package.py b/var/spack/repos/builtin/packages/py-yolk3k/package.py index f256b50bb5..2af703b38d 100644 --- a/var/spack/repos/builtin/packages/py-yolk3k/package.py +++ b/var/spack/repos/builtin/packages/py-yolk3k/package.py @@ -17,6 +17,4 @@ class PyYolk3k(PythonPackage): version('0.9', sha256='cf8731dd0a9f7ef50b5dc253fe0174383e3fed295a653672aa918c059eef86ae') - depends_on('py-pygments') - depends_on('py-jinja2') - depends_on('py-docutils') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-ytopt/package.py b/var/spack/repos/builtin/packages/py-ytopt/package.py index 85d260d35e..9fcfd8c26e 100644 --- a/var/spack/repos/builtin/packages/py-ytopt/package.py +++ b/var/spack/repos/builtin/packages/py-ytopt/package.py @@ -19,6 +19,7 @@ class PyYtopt(PythonPackage): version('0.0.1', sha256='3ca616922c8e76e73f695a5ddea5dd91b0103eada726185f008343cc5cbd7744') depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') depends_on('py-scikit-learn@0.23.1', type=('build', 'run')) depends_on('py-dh-scikit-optimize', type=('build', 'run')) depends_on('py-configspace', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index c8146e48a4..f456fbc947 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -1061,8 +1061,6 @@ config.update(get_paths()) """Called before python modules' install() methods.""" module.python = self.command - module.setup_py = Executable( - self.command.path + ' setup.py --no-user-cfg') module.python_platlib = join_path(dependent_spec.prefix, self.platlib) module.python_purelib = join_path(dependent_spec.prefix, self.purelib) diff --git a/var/spack/repos/builtin/packages/reditools/package.py b/var/spack/repos/builtin/packages/reditools/package.py index 64df6ffce8..8c9c0c7500 100644 --- a/var/spack/repos/builtin/packages/reditools/package.py +++ b/var/spack/repos/builtin/packages/reditools/package.py @@ -27,6 +27,8 @@ class Reditools(PythonPackage): variant('nature_protocol', default=False, description='Install the Nature Protocol scripts and files') + # pip silently replaces distutils with setuptools + depends_on('py-setuptools', type='build') depends_on('py-reindent', type='build', when='^python@3:') depends_on('blat', type='run') depends_on('py-fisher', type='run') @@ -57,7 +59,7 @@ class Reditools(PythonPackage): patch('setup.py.patch') patch('batch_sort.patch', when='^python@3:') - @run_before('build') + @run_before('install') def p2_to_p3(self): if '^python@3:' in self.spec: # clean up space/tab mixing diff --git a/var/spack/repos/builtin/packages/scons/package.py b/var/spack/repos/builtin/packages/scons/package.py index 2f425b568f..a17bf0ab3d 100644 --- a/var/spack/repos/builtin/packages/scons/package.py +++ b/var/spack/repos/builtin/packages/scons/package.py @@ -23,17 +23,11 @@ class Scons(PythonPackage): # Python 3 support was added in SCons 3.0.0 depends_on('python@:2', when='@:2', type=('build', 'run')) - depends_on('py-setuptools', when='@3.0.2:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) patch('fjcompiler.patch', when='%fj') patch('py3-hashbang.patch', when='^python@3:') - # Prevent passing --single-version-externally-managed to - # setup.py, which it does not support. - @when('@3.0.2:') - def install_args(self, spec, prefix): - return ['--prefix={0}'.format(prefix), '--root=/'] - def setup_run_environment(self, env): env.prepend_path('PYTHONPATH', self.prefix.lib.scons) diff --git a/var/spack/repos/builtin/packages/sgpp/package.py b/var/spack/repos/builtin/packages/sgpp/package.py index d5b18472f2..9e20658869 100644 --- a/var/spack/repos/builtin/packages/sgpp/package.py +++ b/var/spack/repos/builtin/packages/sgpp/package.py @@ -80,6 +80,8 @@ class Sgpp(SConsPackage): depends_on('zlib', type=('link')) # Python dependencies extends('python', when='+python') + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') depends_on('py-setuptools', when='+python', type=('build')) # Python 3 support was added in version 3.2.0 depends_on('python@2.7:2.8', when='@1.0.0:3.1.0+python', type=('build', 'run')) @@ -207,8 +209,8 @@ class Sgpp(SConsPackage): return self.args - def install_args(self, spec, prefix): - # Everything is already built, time to install our python bindings: - if '+python' in spec: - setup_py('install', '--prefix={0}'.format(prefix)) - return self.args + @run_after('install') + def python_install(self): + if '+python' in self.spec: + args = std_pip_args + ['--prefix=' + self.prefix, '.'] + pip(*args) diff --git a/var/spack/repos/builtin/packages/treelite/package.py b/var/spack/repos/builtin/packages/treelite/package.py index dbd717880a..c7ed22bfba 100644 --- a/var/spack/repos/builtin/packages/treelite/package.py +++ b/var/spack/repos/builtin/packages/treelite/package.py @@ -3,12 +3,10 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os - from spack import * -class Treelite(CMakePackage, PythonPackage): +class Treelite(CMakePackage): """Treelite is a model compiler for efficient deployment of decision tree ensembles.""" @@ -22,12 +20,13 @@ class Treelite(CMakePackage, PythonPackage): depends_on('protobuf', when='+protobuf') depends_on('python@3.6:', when='+python', type=('build', 'run')) + depends_on('py-pip', when='+python', type='build') + depends_on('py-wheel', when='+python', type='build') depends_on('py-setuptools', when='+python', type='build') depends_on('py-numpy', when='+python', type=('build', 'run')) depends_on('py-scipy', when='+python', type=('build', 'run')) build_directory = 'build' - phases = ['cmake', 'build', 'python_build', 'install', 'python_install'] def cmake_args(self): args = [] @@ -41,21 +40,9 @@ class Treelite(CMakePackage, PythonPackage): return args - def python_build(self, spec, prefix): - if '+python' in spec: - self._build_directory = 'python' - PythonPackage.build_ext(self, spec, prefix) - else: - print('python deselected') - - def python_install(self, spec, prefix): - if '+python' in spec: - PythonPackage.install(self, spec, prefix) - else: - print('python deselected') - - def setup_py(self, *args, **kwargs): - setup = self.setup_file() - - with working_dir(os.path.join(self.stage.source_path, 'python')): - self.python('-s', setup, '--no-user-cfg', *args, **kwargs) + @run_after('install') + def python_install(self): + if '+python' in self.spec: + with working_dir('python'): + args = std_pip_args + ['--prefix=' + self.prefix, '.'] + pip(*args) -- cgit v1.2.3-60-g2f50