Repository: flatsurf/surface-dynamics (language: python)

Issue:
Deploy documentation on flatsurf.github.io
 Together with e-antic and sage-flatsurf it would be good to have the documentation on flatsurf.github.io
- [x] depoy on github.io
- [x] change hyperlinks in README and elsewhere in the repo
- [x] make redirections from https://www.labri.fr/perso/vdelecro/surface-dynamics/


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml
new file mode 100644
index 00000000..b300eba4
--- /dev/null
+++ b/.github/workflows/cancel.yml
@@ -0,0 +1,15 @@
+name: Cancel outdated runs
+on:
+  workflow_run:
+    workflows: ['Test']
+    types: ['requested']
+
+jobs:
+  cancel-duplicate-workflow-runs:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: potiuk/cancel-workflow-runs@master
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+          sourceRunId: ${{ github.event.workflow_run.id }}
+          skipEventTypes: '["push", "schedule"]'
diff --git a/doc/news/environment.rst b/doc/news/environment.rst
new file mode 100644
index 00000000..c2a6aa63
--- /dev/null
+++ b/doc/news/environment.rst
@@ -0,0 +1,3 @@
+**Added:**
+
+* Added `environment.yml` file to install all dependencies of surface-dynamics with conda.
diff --git a/environment.yml b/environment.yml
new file mode 100644
index 00000000..301c3044
--- /dev/null
+++ b/environment.yml
@@ -0,0 +1,28 @@
+# This file lists the dependencies needed to build and test all of
+# surface-dynamics.
+# Create a Conda environment with these dependencies preinstalled with:
+# conda env create -f environment.yml
+name: surface-dynamics-build
+channels:
+  - flatsurf
+  - conda-forge
+  - defaults
+dependencies:
+  - c-compiler
+  - cxx-compiler
+  - pytest
+  - pytest-xdist
+  - ipywidgets
+  - scipy
+  - matplotlib-base
+  - gap-defaults
+  - sympy
+  - sagemath-db-conway-polynomials
+  - sagelib
+  # Work around https://github.com/conda-forge/givaro-feedstock/issues/13
+  - givaro=4.1.1=h192cbe9_1
+  - sage-flatsurf  # optional: sage_flatsurf
+  - pyflatsurf >=3.6.4,<4  # optional: sage_flatsurf
+  - pyeantic >=1.0.0,<2  # optional: pyeantic
+  - pyintervalxt >= 3.1.0,<4  # optional: pyintervalxt
+  - pip


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index e587d515..b61d1f23 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -10,17 +10,17 @@ jobs:
       matrix:
         include:
           - optionals: "sage,pplpy"
-            packages: "sagelib=8.8"
+            sagelib: "8.8"
           - optionals: "sage,pplpy"
-            packages: "sagelib=8.9"
+            sagelib: "8.9"
           - optionals: "sage,pplpy"
-            packages: "sagelib=9.1"
+            sagelib: "9.1"
           - optionals: "sage,pplpy,gmpxxyy,pyeantic,pyintervalxt,sage_flatsurf"
-            packages: "sagelib=9.1 sage-flatsurf pyflatsurf>=1.1.0 pyeantic pyintervalxt>=3.1.0"
+            sagelib: "9.1"
           - optionals: "sage,pplpy,mzv"
-            packages: "sagelib=9.2"
+            sagelib: "9.2"
           - optionals: "sage,pplpy,mzv,gmpxxyy,pyeantic,pyintervalxt,sage_flatsurf"
-            packages: "sagelib=9.2 sage-flatsurf pyflatsurf>=1.1.0 pyeantic pyintervalxt>=3.1.0"
+            sagelib: "9.2"
     steps:
       - uses: actions/checkout@v2
         with: { submodules: recursive }
@@ -29,10 +29,16 @@ jobs:
       - name: Install dependencies
         shell: bash -l {0}
         run: |
-          mamba install --yes --quiet c-compiler cxx-compiler pip pytest pytest-xdist ipywidgets scipy matplotlib-base gap-defaults sympy sagemath-db-conway-polynomials ${{ matrix.packages }}
-          # Work around https://github.com/conda-forge/givaro-feedstock/issues/13
-          mamba install --yes --quiet givaro=4.1.1=h192cbe9_1
-          conda activate test
+          mamba install -n test sagelib=${{ matrix.sagelib }}
+          echo "sagelib ==${{ matrix.sagelib }}" >> $CONDA_PREFIX/conda-meta/pinned
+
+          while read -r line; do
+            optional=$(echo "$line" | grep -o '# optional: [^ ]*' | awk '{ print $3; }') || true
+            (test "$optional" == '' || (echo "${{ matrix.optionals }}" | grep -E '\b'"$optional"'\b') > /dev/null) && echo $line || true
+          done < environment.yml > environment.test.yml
+
+          mamba env update --quiet -n test -f environment.test.yml
+
           conda list
       - name: Install surface-dynamics
         shell: bash -l {0}