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 <phase>_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
This commit is contained in:
@@ -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
|
||||
^^^^^^
|
||||
^^^^^^^^^^^
|
||||
Terminology
|
||||
^^^^^^^^^^^
|
||||
|
||||
The ``PythonPackage`` base class provides the following phases that
|
||||
can be overridden:
|
||||
In the Python ecosystem, there are a number of terms that are
|
||||
important to understand.
|
||||
|
||||
* ``build``
|
||||
* ``build_py``
|
||||
* ``build_ext``
|
||||
* ``build_clib``
|
||||
* ``build_scripts``
|
||||
* ``install``
|
||||
* ``install_lib``
|
||||
* ``install_headers``
|
||||
* ``install_scripts``
|
||||
* ``install_data``
|
||||
**PyPI**
|
||||
The `Python Package Index <https://pypi.org/>`_, where most Python
|
||||
libraries are hosted.
|
||||
|
||||
These are all standard ``setup.py`` commands and can be found by running:
|
||||
**sdist**
|
||||
Source distributions, distributed as tarballs (.tar.gz) and zip
|
||||
files (.zip). Contain the source code of the package.
|
||||
|
||||
.. code-block:: console
|
||||
**bdist**
|
||||
Built distributions, distributed as wheels (.whl). Contain the
|
||||
pre-built library.
|
||||
|
||||
$ python setup.py --help-commands
|
||||
**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 <https://packaging.python.org/en/latest/specifications/binary-distribution-format/>`_
|
||||
for more details.
|
||||
|
||||
**build frontend**
|
||||
Command-line tools used to build and install wheels. Examples
|
||||
include `pip <https://pip.pypa.io/>`_,
|
||||
`build <https://pypa-build.readthedocs.io/>`_, and
|
||||
`installer <https://installer.readthedocs.io/>`_.
|
||||
|
||||
By default, only the ``build`` and ``install`` phases are run:
|
||||
**build backend**
|
||||
Libraries used to define how to build a wheel. Examples
|
||||
include `setuptools <https://setuptools.pypa.io/>`__,
|
||||
`flit <https://flit.readthedocs.io/>`_, and
|
||||
`poetry <https://python-poetry.org/>`_.
|
||||
|
||||
#. ``build`` - build everything needed to install
|
||||
#. ``install`` - install everything from build directory
|
||||
^^^^^^^^^^^
|
||||
Downloading
|
||||
^^^^^^^^^^^
|
||||
|
||||
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 ``<phase>`` that runs:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ python -s setup.py --no-user-cfg <phase>
|
||||
|
||||
|
||||
Each phase also has a ``<phase_args>`` 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
|
||||
^^^^
|
||||
|
||||
The vast majority of Python packages are hosted on PyPI (The Python
|
||||
Package Index), which is :ref:`preferred over GitHub <pypi-vs-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 <package-name>" 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::
|
||||
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 <https://pypi.org/>`_, which is
|
||||
:ref:`preferred over GitHub <pypi-vs-github>` for downloading
|
||||
packages. Search for the package name on PyPI to find the project
|
||||
page. The project page is usually located at::
|
||||
|
||||
https://pypi.org/project/<package-name>
|
||||
|
||||
|
||||
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:
|
||||
|
||||
.. 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
|
||||
|
||||
pypi = 'setuptools/setuptools-49.2.0.zip'
|
||||
|
||||
|
||||
^^^^^^^^^^^
|
||||
Description
|
||||
^^^^^^^^^^^
|
||||
|
||||
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
|
||||
|
||||
$ python setup.py --description
|
||||
$ python setup.py --long-description
|
||||
|
||||
|
||||
^^^^^^^^
|
||||
Homepage
|
||||
^^^^^^^^
|
||||
|
||||
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:
|
||||
|
||||
.. 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::
|
||||
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::
|
||||
|
||||
https://pypi.io/packages/py3/a/azureml_sdk/azureml_sdk-1.11.0-py3-none-any.whl
|
||||
|
||||
Once you've found a URL to download the package from, run:
|
||||
|
||||
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:: console
|
||||
|
||||
.. code-block:: python
|
||||
$ spack create <url>
|
||||
|
||||
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,252 +133,124 @@ 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 <pypi>` to facilitate construction of PyPI package
|
||||
references.
|
||||
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.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Build system dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^
|
||||
PyPI
|
||||
^^^^
|
||||
|
||||
There are a few dependencies common to the ``PythonPackage`` build system.
|
||||
|
||||
""""""
|
||||
Python
|
||||
""""""
|
||||
|
||||
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'))
|
||||
pypi = 'setuptools/setuptools-49.2.0.zip'
|
||||
|
||||
|
||||
If Python 2.7 is the only version that works, you can use:
|
||||
If a package has a different homepage listed on PyPI, you can
|
||||
override it by setting your own ``homepage``.
|
||||
|
||||
^^^^^^^^^^^
|
||||
Description
|
||||
^^^^^^^^^^^
|
||||
|
||||
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.
|
||||
|
||||
^^^^^^^^^^^^^
|
||||
Build backend
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
Once you've determined the basic metadata for a package, the next
|
||||
step is to determine the build backend. ``PythonPackage`` uses
|
||||
`pip <https://pip.pypa.io/>`_ to install the package, but pip
|
||||
requires a backend to actually build the package.
|
||||
|
||||
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:: toml
|
||||
|
||||
[build-system]
|
||||
requires = [
|
||||
"setuptools>=42",
|
||||
"wheel",
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
|
||||
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', type=('build', 'run'))
|
||||
depends_on('py-setuptools@42:', type='build')
|
||||
|
||||
|
||||
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 <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-numpy/package.py>`_
|
||||
looks like:
|
||||
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.
|
||||
|
||||
.. code-block:: python
|
||||
See `PEP 517 <https://www.python.org/dev/peps/pep-0517/>`_ and
|
||||
`PEP 518 <https://www.python.org/dev/peps/pep-0518/>`_ for more
|
||||
information on the design of ``pyproject.toml``.
|
||||
|
||||
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*'
|
||||
Depending on which build backend a project uses, there are various
|
||||
places that run-time dependencies can be listed.
|
||||
|
||||
"""""""""
|
||||
distutils
|
||||
"""""""""
|
||||
|
||||
You may also find a version check at the top of the ``setup.py``:
|
||||
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.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
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.")
|
||||
|
||||
|
||||
This can be converted to Spack's spec notation like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('python@2.7:2.8,3.4:', type=('build', 'run'))
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
This would be translated to:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
extends('python')
|
||||
depends_on('python@3.5:3', type=('build', 'run'))
|
||||
|
||||
|
||||
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:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import setuptools
|
||||
|
||||
|
||||
or:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
Some packages are designed to work with both setuptools and distutils,
|
||||
so you may find something like:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('py-setuptools', type='build')
|
||||
|
||||
|
||||
"""
|
||||
pip
|
||||
"""
|
||||
|
||||
Packages distributed as Python wheels will require an extra dependency
|
||||
on pip:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('py-pip', type='build')
|
||||
|
||||
|
||||
We will use pip to install the actual wheel.
|
||||
|
||||
""""""
|
||||
cython
|
||||
""""""
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
* ``python_requires``
|
||||
|
||||
As mentioned above, this specifies which versions of Python are
|
||||
required.
|
||||
This specifies the version of Python that is required.
|
||||
|
||||
* ``setup_requires``
|
||||
|
||||
@@ -524,43 +262,88 @@ If the package uses ``setuptools``, check for the following clues:
|
||||
These packages are required for building and installation. You can
|
||||
add them with ``type=('build', 'run')``.
|
||||
|
||||
* ``extra_requires``
|
||||
* ``extras_require``
|
||||
|
||||
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``
|
||||
* ``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.
|
||||
|
||||
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:
|
||||
See https://setuptools.pypa.io/en/latest/userguide/dependency_management.html
|
||||
for more information on how setuptools handles dependency management.
|
||||
See `PEP 440 <https://www.python.org/dev/peps/pep-0440/#version-specifiers>`_
|
||||
for documentation on version specifiers in setuptools.
|
||||
|
||||
* mock
|
||||
* nose
|
||||
* pytest
|
||||
""""
|
||||
flit
|
||||
""""
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
Either of these files may contain keys like:
|
||||
|
||||
If you are write a recipe for a package that only distributes wheels,
|
||||
check the ``METADATA`` file for lines like::
|
||||
* ``requires-python``
|
||||
|
||||
This specifies the version of Python that is required
|
||||
|
||||
* ``dependencies`` or ``requires``
|
||||
|
||||
These packages are required for building and installation. You can
|
||||
add them with ``type=('build', 'run')``.
|
||||
|
||||
* ``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.
|
||||
|
||||
See https://flit.readthedocs.io/en/latest/pyproject_toml.html for
|
||||
more information.
|
||||
|
||||
""""""
|
||||
poetry
|
||||
""""""
|
||||
|
||||
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 <https://python-poetry.org/docs/dependency-specification/#version-constraints>`_
|
||||
for specifying the version requirements. Note that ``~=`` works
|
||||
differently in poetry than in setuptools and flit for versions that
|
||||
start with a zero.
|
||||
|
||||
""""""
|
||||
wheels
|
||||
""""""
|
||||
|
||||
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. 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
|
||||
|
||||
$ python setup.py <phase> --help
|
||||
|
||||
|
||||
Each phase provides a ``<phase_args>`` function that can be used to
|
||||
pass arguments to that phase. For example,
|
||||
`py-numpy <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-numpy/package.py>`_
|
||||
adds:
|
||||
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:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def build_args(self, spec, prefix):
|
||||
args = []
|
||||
def global_options(self, spec, prefix):
|
||||
options = []
|
||||
if '+libyaml' in spec:
|
||||
options.append('--with-libyaml')
|
||||
else:
|
||||
options.append('--without-libyaml')
|
||||
return options
|
||||
|
||||
# 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)]
|
||||
|
||||
return args
|
||||
"""""""""""""""
|
||||
Install options
|
||||
"""""""""""""""
|
||||
|
||||
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``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
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:
|
||||
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
|
||||
|
||||
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 <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-meep/package.py>`_ and
|
||||
`py-adios <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-adios/package.py>`_
|
||||
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:
|
||||
|
||||
.. 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 ``<prefix>/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 ``<prefix>/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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -18,65 +18,19 @@
|
||||
)
|
||||
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 <phase> that runs:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ python -s setup.py --no-user-cfg <phase>
|
||||
|
||||
Each phase also has a <phase_args> 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 @@ def configure(self, spec, prefix):
|
||||
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 @@ def import_modules(self):
|
||||
|
||||
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."""
|
||||
"""The root directory of the Python package.
|
||||
|
||||
This is usually the directory containing one of the following files:
|
||||
|
||||
* ``pyproject.toml``
|
||||
* ``setup.cfg``
|
||||
* ``setup.py``
|
||||
"""
|
||||
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)
|
||||
|
||||
self.setup_py('build', *args)
|
||||
|
||||
def build_args(self, spec, prefix):
|
||||
"""Arguments to pass to build."""
|
||||
def install_options(self, spec, prefix):
|
||||
"""Extra arguments to be supplied to the setup.py install command."""
|
||||
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)
|
||||
|
||||
def build_ext_args(self, spec, prefix):
|
||||
"""Arguments to pass to build_ext."""
|
||||
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)
|
||||
args = PythonPackage._std_args(self) + ['--prefix=' + prefix]
|
||||
|
||||
def install_args(self, spec, prefix):
|
||||
"""Arguments to pass to install."""
|
||||
args = ['--prefix={0}'.format(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)
|
||||
|
||||
# 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']
|
||||
if self.stage.archive_file and self.stage.archive_file.endswith('.whl'):
|
||||
args.append(self.stage.archive_file)
|
||||
else:
|
||||
args.append('.')
|
||||
|
||||
# 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 []
|
||||
|
||||
def install_data(self, spec, prefix):
|
||||
"""Install data files."""
|
||||
args = self.install_data_args(spec, prefix)
|
||||
|
||||
self.setup_py('install_data', *args)
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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 @@ def __init__(self, name, url, *args, **kwargs):
|
||||
# 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)])
|
||||
# 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}"'
|
||||
self.url_line = ' pypi = "{url}"'
|
||||
else:
|
||||
# Add a reminder about spack preferring PyPI URLs
|
||||
self.url_line = '''
|
||||
@@ -581,6 +604,9 @@ def __call__(self, stage, url):
|
||||
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 @@ def __call__(self, stage, url):
|
||||
(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'),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
15
var/spack/repos/builtin.mock/packages/py-pip/package.py
Normal file
15
var/spack/repos/builtin.mock/packages/py-pip/package.py
Normal file
@@ -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')
|
||||
15
var/spack/repos/builtin.mock/packages/py-wheel/package.py
Normal file
15
var/spack/repos/builtin.mock/packages/py-wheel/package.py
Normal file
@@ -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')
|
||||
@@ -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'))
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 @@ def install(self, spec, prefix):
|
||||
make('install')
|
||||
|
||||
if '+python' in spec:
|
||||
setup_py('install', '--prefix=' + prefix)
|
||||
args = std_pip_args + ['--prefix=' + prefix, '.']
|
||||
pip(*args)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 @@ def install(self, spec, prefix):
|
||||
|
||||
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
|
||||
|
||||
@@ -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 @@ def setup_run_environment(self, env):
|
||||
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)
|
||||
|
||||
@@ -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 @@ def python_install(self):
|
||||
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 = []
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 @@ def install(self, spec, prefix):
|
||||
@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)
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
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))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 @@ def cmake_args(self):
|
||||
|
||||
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."""
|
||||
|
||||
@@ -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 [
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -72,7 +72,7 @@ def patch(self):
|
||||
# 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',
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import os
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
@@ -43,18 +41,3 @@ def url_for_version(self, version):
|
||||
|
||||
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))
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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')
|
||||
|
||||
24
var/spack/repos/builtin/packages/py-cachecontrol/package.py
Normal file
24
var/spack/repos/builtin/packages/py-cachecontrol/package.py
Normal file
@@ -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')
|
||||
19
var/spack/repos/builtin/packages/py-cachy/package.py
Normal file
19
var/spack/repos/builtin/packages/py-cachy/package.py
Normal file
@@ -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')
|
||||
@@ -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 @@ def setup_build_environment(self, env):
|
||||
# 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)
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 @@ def setup_build_environment(self, env):
|
||||
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
|
||||
|
||||
@@ -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'))
|
||||
|
||||
19
var/spack/repos/builtin/packages/py-cleo/package.py
Normal file
19
var/spack/repos/builtin/packages/py-cleo/package.py
Normal file
@@ -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'))
|
||||
25
var/spack/repos/builtin/packages/py-clikit/package.py
Normal file
25
var/spack/repos/builtin/packages/py-clikit/package.py
Normal file
@@ -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'))
|
||||
@@ -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))
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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'))
|
||||
|
||||
19
var/spack/repos/builtin/packages/py-crashtest/package.py
Normal file
19
var/spack/repos/builtin/packages/py-crashtest/package.py
Normal file
@@ -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')
|
||||
@@ -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))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -45,7 +45,7 @@ def command(self):
|
||||
"""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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 @@ def cmake_args(self):
|
||||
|
||||
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)
|
||||
|
||||
@@ -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=/']
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user