Skip to content

Commit 5dae8dc

Browse files
authored
Updated instructions and CI for pip-only installations (#101)
* docs: updated instructions for pip-only instructions, including the required binary libraries for debian/ubuntu and macos. ci: added smoke builds for pip-only installations * ci: clean mamba cache for tests
1 parent c223afa commit 5dae8dc

File tree

2 files changed

+127
-11
lines changed

2 files changed

+127
-11
lines changed

.github/workflows/build-test.yml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches: [ main ]
99

1010
jobs:
11-
build:
11+
build-test:
1212
if: github.repository == 'cseptesting/floatcsep'
1313
runs-on: ${{ matrix.os }}
1414
strategy:
@@ -44,6 +44,12 @@ jobs:
4444
pip install -e .[dev]
4545
python -c "import floatcsep; print('Version: ', floatcsep.__version__)"
4646
47+
- name: Free disk
48+
run: |
49+
micromamba clean --all --yes
50+
rm -rf "$MAMBA_ROOT_PREFIX/pkgs" || true
51+
df -h
52+
4753
- name: Test with pytest
4854
run: |
4955
pytest --durations=0
@@ -53,4 +59,62 @@ jobs:
5359
uses: codecov/codecov-action@v3
5460
with:
5561
token: ${{ secrets.CODECOV_TOKEN }}
56-
fail_ci_if_error: false
62+
fail_ci_if_error: false
63+
64+
pip_smoke_linux:
65+
if: github.repository == 'cseptesting/floatcsep'
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/[email protected]
69+
70+
- name: Set up Python
71+
uses: actions/setup-python@v5
72+
with:
73+
python-version: "3.11"
74+
cache: pip
75+
76+
- name: Install system deps (WeasyPrint)
77+
run: |
78+
sudo apt-get update
79+
sudo apt-get install -y \
80+
libglib2.0-0 \
81+
libpango-1.0-0 \
82+
libpangoft2-1.0-0 \
83+
libharfbuzz0b \
84+
libharfbuzz-subset0
85+
86+
- name: Pip-only install (no tests)
87+
run: |
88+
python -m pip install --upgrade pip
89+
python -m pip install -e ".[dev]"
90+
python -c "import floatcsep; print('floatcsep OK:', floatcsep.__version__)"
91+
python -c "import weasyprint; print('WeasyPrint OK:', weasyprint.__version__)"
92+
floatcsep --help
93+
94+
95+
pip_smoke_macos:
96+
if: github.repository == 'cseptesting/floatcsep'
97+
runs-on: macos-latest
98+
steps:
99+
- uses: actions/[email protected]
100+
101+
- name: Set up Python
102+
uses: actions/setup-python@v5
103+
with:
104+
python-version: "3.11"
105+
cache: pip
106+
107+
- name: Install system deps (WeasyPrint)
108+
run: |
109+
brew update
110+
brew install cairo pango gdk-pixbuf libffi glib
111+
112+
- name: Pip-only install (no tests)
113+
env:
114+
DYLD_FALLBACK_LIBRARY_PATH: /opt/homebrew/lib:/usr/local/lib:${{ env.DYLD_FALLBACK_LIBRARY_PATH }}
115+
run: |
116+
python -m pip install --upgrade pip
117+
python -m pip install -e ".[dev]"
118+
python -c "import floatcsep; print('floatcsep OK:', floatcsep.__version__)"
119+
python -c "import weasyprint; print('WeasyPrint OK:', weasyprint.__version__)"
120+
floatcsep --help

docs/intro/installation.rst

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ Latest Version
1111

1212
This option is recommended to learn the software, run the tutorials, and drafting **Testing Experiments**.
1313

14+
.. note::
15+
16+
We recommend installing with ``conda`` because it bundles native/system dependencies.
17+
18+
19+
.. _conda-install-note:
20+
1421
1. Using ``conda``
1522
~~~~~~~~~~~~~~~~~~
1623

@@ -55,15 +62,55 @@ Lastly, install **floatCSEP** into the new environment using ``pip``:
5562
2. Using only ``pip``
5663
~~~~~~~~~~~~~~~~~~~~~
5764

58-
To install using the ``pip`` manager only, we require to install the binary dependencies of **pyCSEP** (see `Installing pyCSEP <https://docs.cseptesting.org/getting_started/installing.html>`_). The **floatCSEP** latest version can then be installed as:
65+
To install using the ``pip`` manager only, you need the binary dependencies of **pyCSEP**
66+
(see `Installing pyCSEP <https://docs.cseptesting.org/getting_started/installing.html>`_).
67+
68+
.. note::
69+
70+
Pip-only installs may require native libraries for PDF report generation (WeasyPrint).
71+
See :ref:`pip-binary-deps`.
72+
73+
The **floatCSEP** latest version can then be installed as:
74+
75+
.. code-block:: console
76+
77+
$ git clone https://github.com/cseptesting/floatcsep
78+
$ cd floatcsep
79+
$ python -m venv venv
80+
$ pip install .
81+
82+
83+
.. _pip-binary-deps:
84+
85+
Binary dependencies for pip-only installs
86+
-----------------------------------------
87+
88+
Debian/Ubuntu:
5989

6090
.. code-block:: console
6191
62-
$ git clone https://github.com/cseptesting/floatcsep
63-
$ cd floatcsep
64-
$ python -m venv venv
65-
$ pip install .
92+
$ sudo apt-get update
93+
$ sudo apt-get install -y \
94+
libglib2.0-0 \
95+
libpango-1.0-0 \
96+
libpangoft2-1.0-0 \
97+
libharfbuzz0b \
98+
libharfbuzz-subset0
99+
100+
macOS (Homebrew):
101+
102+
.. code-block:: console
103+
104+
$ brew install cairo pango gdk-pixbuf libffi
105+
106+
107+
In macOS, if ``import weasyprint`` fails to find libraries (e.g. ``libgobject-2.0-0``),
108+
set this for the current terminal session:
109+
110+
.. code-block:: console
66111
112+
$ export DYLD_FALLBACK_LIBRARY_PATH="/opt/homebrew/lib:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
113+
export DYLD_FALLBACK_LIBRARY_PATH="/opt/homebrew/lib:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
67114

68115
Latest Stable Release
69116
---------------------
@@ -73,7 +120,7 @@ This option is recommended for deploying *Floating Testing Experiments* live.
73120
1. From the ``conda-forge`` channel
74121
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75122

76-
Having a ``conda`` manager installed (see **Note** box above), type in a console:
123+
Having a ``conda`` manager installed (see ``conda`` managers in :ref:`conda-install-note`), type in a console:
77124

78125
.. code-block:: console
79126
@@ -86,7 +133,10 @@ where ``3.9 < {PYTHON_VERSION} <= 3.12`` is at your convenience.
86133
2. From the ``PyPI`` repository
87134
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88135

89-
Having installed the binary dependencies of **pyCSEP** (see `Installing pyCSEP <https://docs.cseptesting.org/getting_started/installing.html>`_}, install **floatCSEP** by:
136+
Having installed the binary dependencies of **pyCSEP**
137+
(see `Installing pyCSEP <https://docs.cseptesting.org/getting_started/installing.html>`_)
138+
and, for pip-only environments, the system dependencies in :ref:`pip-binary-deps`,
139+
install **floatCSEP** by:
90140

91141
.. code-block:: console
92142
@@ -129,14 +179,16 @@ post-installation steps:
129179
For Developers
130180
--------------
131181

132-
It is recommended (not obligatory) to use a ``conda`` environment to make sure your contributions do not depend on your system local libraries. For contributing to the **floatCSEP** codebase, please consider `forking the repository <https://docs.github.com/articles/fork-a-repo>`_ and `create pull-requests <https://docs.github.com/articles/creating-a-pull-request>`_ from there.
182+
We recommend using a ``conda`` environment for development to avoid relying on system libraries. For contributing to
183+
the **floatCSEP** codebase, please consider `forking the repository <https://docs.github.com/articles/fork-a-repo>`_
184+
and `creating pull requests <https://docs.github.com/articles/creating-a-pull-request>`_ from there.
133185

134186
.. code-block:: console
135187
136188
$ conda create -n floatcsep_dev
137189
$ conda activate floatcsep_dev
138190
$ git clone https://github.com/${your_fork}/floatcsep
139191
$ cd floatcsep
140-
$ pip install -e .[dev]
192+
$ pip install -e ".[dev]"
141193
142194
This will install and configure all the unit-testing, linting, and documentation packages.

0 commit comments

Comments
 (0)