Skip to content

Commit

Permalink
Get CI working again (#925)
Browse files Browse the repository at this point in the history
* Swap order of installs

Something is borked with the mamba solver

* Install dependencies explicitly

`--no-deps` install of `fipy` is too fragile

* Add newer opcodes

* Ignore deprecated use of pkg_resources.declare_namespace

* Catch errors from old Trilinos prerequisites

* Update import of mmread

* Log environment

Hard to do regression testing when you don't know what was installed.
Why is Azure so useless?

* Replace deprecated `style` key in HTML template

`style` superceded by `styles` in Sphinx 5.1 and removed in Sphinx 7
sphinx-doc/sphinx#11381
  • Loading branch information
guyer committed May 12, 2023
1 parent 4db188c commit a26aafd
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 56 deletions.
76 changes: 42 additions & 34 deletions .azure/pipelines.yml
Expand Up @@ -34,7 +34,7 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3.10
python_version: 3
conda_packages: 'hunspell'

- bash: |
Expand Down Expand Up @@ -62,7 +62,7 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3.10
python_version: 3
conda_packages: 'numpy'

- bash: |
Expand All @@ -85,7 +85,7 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3.10
python_version: 3
conda_packages: 'numpy'

- bash: |
Expand All @@ -106,74 +106,74 @@ stages:
matrix:
linux-py3k-petsc:
image: ubuntu-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN:
linux-py3k-petsc-parallel:
image: ubuntu-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN: 'mpirun -np 2'
linux-py3k-scipy:
image: ubuntu-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:
linux-py37-trilinos:
linux-py3k-trilinos:
image: ubuntu-latest
python_version: 3.7
conda_packages: 'gmsh pytrilinos'
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN:
linux-py37-trilinos-parallel:
linux-py3k-trilinos-parallel:
image: ubuntu-latest
python_version: 3.7
conda_packages: 'gmsh pytrilinos'
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN: 'mpirun -np 2'
macos-py27-pysparse:
image: macos-latest
python_version: 2.7
conda_packages: '"traitsui<7.0.0" "gmsh<4.0"'
conda_packages: 'numpy scipy matplotlib-base future packaging pysparse mayavi "traitsui<7.0.0" "gmsh<4.0"'
FIPY_SOLVERS: pysparse
MPIRUN:
macos-py3k-petsc:
image: macos-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN:
macos-py3k-petsc-parallel:
image: macos-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN: 'mpirun -np 2'
macos-py3k-scipy:
image: macos-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:
macos-py37-trilinos:
macos-py3k-trilinos:
image: macos-latest
python_version: 3.7
conda_packages: 'gmsh pytrilinos'
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN:
macos-py37-trilinos-parallel:
macos-py3k-trilinos-parallel:
image: macos-latest
python_version: 3.7
conda_packages: 'gmsh pytrilinos'
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN: 'mpirun -np 2'
windows-py3k-scipy:
image: windows-latest
python_version: 3.10
conda_packages: gmsh
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:

Expand Down Expand Up @@ -214,8 +214,8 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3.10
conda_packages: 'sphinx future matplotlib pandas imagemagick'
python_version: 3
conda_packages: 'numpy scipy matplotlib future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2" sphinx pandas imagemagick'

- bash: |
source activate myEnvironment
Expand All @@ -233,6 +233,10 @@ stages:
sudo apt-get --yes install texlive-extra-utils
displayName: Install LaTeX
- bash: |
conda env export --name myEnvironment
displayName: Environment
- bash: |
source activate myEnvironment
export ETS_TOOLKIT=null
Expand Down Expand Up @@ -260,13 +264,13 @@ stages:
unix:
image: ubuntu-latest
python_version: 3.10
conda_packages: gmsh
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN:
windows:
image: windows-latest
python_version: 3.10
conda_packages: gmsh
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:

Expand All @@ -291,6 +295,10 @@ stages:
displayName: Build wheel
condition: startsWith(variables.image, 'ubuntu')
- bash: |
conda env export --name myEnvironment
displayName: Environment
- bash: |
source activate myEnvironment
python setup.py release --unix
Expand Down
2 changes: 0 additions & 2 deletions .azure/templates/install.yml
Expand Up @@ -44,12 +44,10 @@ steps:
- bash: |
if [[ ${{ parameters.python_version }} == "2.7" ]]; then
# mamba doesn't work in Py2.7; do mamba installs from base
mamba install --quiet --name myEnvironment --channel conda-forge --only-deps python=${{ parameters.python_version }} fipy
mamba install --quiet --name myEnvironment --channel conda-forge python=${{ parameters.python_version }} ${{ parameters.conda_packages }}
else
# do mamba installs from environment on Py3k
source activate myEnvironment
mamba install --quiet --channel conda-forge --only-deps python=${{ parameters.python_version }} fipy
mamba install --quiet --channel conda-forge python=${{ parameters.python_version }} ${{ parameters.conda_packages }}
fi
displayName: Install Anaconda packages
Expand Down
14 changes: 13 additions & 1 deletion INSTALLATION.rst
Expand Up @@ -78,6 +78,17 @@ Recommended Method
:term:`Gmsh` is an optional package because some versions are
incompatible with :term:`FiPy`, so it must be requested explicitly.

.. note::

The `fipy conda-forge`_ package is a convenience. You may choose to
install packages explicitly, e.g.,::

$ conda create --name <MYFIPYENV> --channel conda-forge python=3 numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"

or

$ conda create --name <MYFIPYENV> --channel conda-forge python=2.7 numpy scipy matplotlib-base future packaging pysparse mayavi "traitsui<7.0.0" "gmsh<4.0"

.. attention::

Windows x86_64 is fully supported, but this does not work on
Expand Down Expand Up @@ -150,7 +161,8 @@ Recommended Method
.. _Windows: http://www.microsoft.com/windows/
.. |CondaForge| image:: https://anaconda.org/conda-forge/fipy/badges/installer/conda.svg
.. _CondaForge: https://anaconda.org/conda-forge/fipy
.. _mamba: https://github.com/mamba-org/mamba
.. _mamba: https://mamba.readthedocs.io/
.. _fipy conda-forge: https://anaconda.org/conda-forge/fipy


--------------
Expand Down
2 changes: 1 addition & 1 deletion documentation/_themes/nist/basic_layout.html
Expand Up @@ -94,7 +94,7 @@ <h3>{{ _('Navigation') }}</h3>
{%- endmacro %}

{%- macro css() %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/' + styles[-1], 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for css in css_files %}
{%- if css|attr("filename") %}
Expand Down
7 changes: 5 additions & 2 deletions fipy/matrices/trilinosMatrix.py
Expand Up @@ -477,7 +477,10 @@ def exportMmf(self, filename):
def numpyArray(self):
import tempfile
import os
from scipy.io import mmio
try:
from scipy.io import mmread
except ImportError:
from scipy.io.mmio import mmread
from fipy.tools import parallelComm

if parallelComm.procID == 0:
Expand All @@ -490,7 +493,7 @@ def numpyArray(self):
self.exportMmf(mtxName)

parallelComm.Barrier()
mtx = mmio.mmread(mtxName)
mtx = mmread(mtxName)
parallelComm.Barrier()

if parallelComm.procID == 0:
Expand Down
21 changes: 12 additions & 9 deletions fipy/solvers/trilinos/__init__.py
Expand Up @@ -34,15 +34,18 @@ def _dealWithTrilinosImportPathologies():

from PyTrilinos import Epetra

import platform
if platform.dist()[0] == 'debian':
import PyTrilinos
if '10.0.4' in PyTrilinos.version():
# The package mpi4py is a required package if you are using
# Trilinos on a Debian platform with Trilinos version 10.0.4 due to
# a Trilinos bug (see <https://github.com/usnistgov/fipy/issues/301>).

from mpi4py import MPI
try:
import platform
if platform.dist()[0] == 'debian':
import PyTrilinos
if '10.0.4' in PyTrilinos.version():
# The package mpi4py is a required package if you are using
# Trilinos on a Debian platform with Trilinos version 10.0.4 due to
# a Trilinos bug (see <https://github.com/usnistgov/fipy/issues/301>).

from mpi4py import MPI
except:
pass

_dealWithTrilinosImportPathologies()

Expand Down
7 changes: 7 additions & 0 deletions fipy/tests/test.py
Expand Up @@ -40,6 +40,13 @@ def runTests(self):
message="`np\.int` is a deprecated alias for the builtin `int`.*",
module="skfmm\.pfmm")

# Don't raise errors in scikits.umfpack
# due to deprecation of pkg_resources.declare_namespace
# raised in Python 3.7, but not newer
# (combination of PyTrilinos and Gmsh(?) forces this old configuration)
warnings.filterwarnings(action="default", category=DeprecationWarning,
message="Deprecated call to `pkg_resources\.declare_namespace\('scikits'\)`.*")

super(DeprecationErroringTestProgram, self).runTests()

class test(_test):
Expand Down

0 comments on commit a26aafd

Please sign in to comment.