Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:
cancel-in-progress: true

jobs:
ubuntu:
check-doc:
name: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -24,20 +24,21 @@ jobs:
env:
CXX: "ccache ${{ matrix.compiler }}"
CXXFLAGS: "-O2 -g"
UV_NO_SYNC: "1"
LD_LIBRARY_PATH: "/usr/local/lib"
steps:
# Setup environment
- uses: actions/checkout@v5
- name: "Create micromamba environment"
uses: mamba-org/setup-micromamba@v2
- name: Set up Python . . .
uses: actions/setup-python@v6
with:
environment-name: libsemigroups
create-args: >-
python
fmt
- name: "Set environment variables . . ."
run: |
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/libsemigroups/share/pkgconfig:/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib" >> $GITHUB_ENV
echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV
python-version-file: "pyproject.toml"
- name: Install uv . . .
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

# Build libsemigroups
- name: "macOS only: Install libsemigroups dependencies . . ."
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install autoconf automake libtool
Expand All @@ -50,18 +51,13 @@ jobs:
run: |
git clone --depth 1 --branch main https://github.com/libsemigroups/libsemigroups.git
cd libsemigroups
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt && sudo make install -j8
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi && sudo make install -j8
ccache -s
- name: "Python version . . ."
run: |
python --version
pip3 --version
- name: "Pip installing requirements.txt . . ."
run: |
pip3 install -r requirements.txt
- name: "Pip3 installing libsemigroups_pybind11 . . ."
run: |
echo $PKG_CONFIG_PATH
pip3 install . -v
- name: "Check doc builds"
run: make doc SPHINXOPTS="-W"

# Build libsemigroups_pybind11
- name: "Install libsemigroups_pybind11 . . ."
run: uv sync --locked --extra docs --no-dev

# Check the docs
- name: "Checking the doc for warnings . . ."
run: uv run make doc SPHINXOPTS="-W"
71 changes: 71 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Run tests (pip)
on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run-tests:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
include:
- os: ubuntu-latest
compiler: g++
- os: macOS-latest
compiler: clang++
runs-on: ${{ matrix.os }}
timeout-minutes: 15
defaults:
run:
shell: bash -l {0}
env:
CXX: "ccache ${{ matrix.compiler }}"
CXXFLAGS: "-O2 -g"
UV_NO_SYNC: "1"
LD_LIBRARY_PATH: "/usr/local/lib"
steps:
# Setup environment
- uses: actions/checkout@v5
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

# Build libsemigroups
- name: "macOS only: Install libsemigroups dependencies . . ."
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install autoconf automake libtool
- name: "Setup ccache . . ."
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
install_ccache: true
- name: "Install libsemigroups . . ."
run: |
git clone --depth 1 --branch main https://github.com/libsemigroups/libsemigroups.git
cd libsemigroups
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi && sudo make install -j8
ccache -s

# Build libsemigroups_pybind11
- name: "Install libsemigroups_pybind11 dependencies . . ."
run: uv sync --no-install-project --locked --all-extras --no-dev
- name: "Install libsemigroups_pybind11 . . ."
run: pip install .

# Run the tests
- name: "Running tests . . ."
run: uv run pytest
- name: "Running doc tests . . ."
run: |
uv run etc/make-doc.sh # so that all files are generated!
cd docs
uv run python -m sphinx -b doctest -d _build/doctrees source _build/doctest
59 changes: 24 additions & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ concurrency:

jobs:
run-tests:
name: ${{ matrix.os }} Python 3.${{ matrix.python_minor_version }}
name: ${{ matrix.os }} Python ${{ matrix.python_version }}
strategy:
fail-fast: false
matrix:
python_minor_version: ["10", "11", "12", "13", "14"]
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest, macOS-latest]
include:
- os: ubuntu-latest
Expand All @@ -26,23 +26,18 @@ jobs:
env:
CXX: "ccache ${{ matrix.compiler }}"
CXXFLAGS: "-O2 -g"
UV_NO_SYNC: "1"
LD_LIBRARY_PATH: "/usr/local/lib"
steps:
# Setup environment
- uses: actions/checkout@v5
- name: "Create micromamba environment"
uses: mamba-org/setup-micromamba@v2
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
environment-name: libsemigroups
create-args: >-
python=3.${{ matrix.python_minor_version }}
fmt
pylint
ruff
cpplint
- name: "Set environment variables . . ."
run: |
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/libsemigroups/share/pkgconfig:/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib" >> $GITHUB_ENV
echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV
python-version: ${{ matrix.python_version }}
enable-cache: true

# Build libsemigroups
- name: "macOS only: Install libsemigroups dependencies . . ."
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install autoconf automake libtool
Expand All @@ -55,26 +50,20 @@ jobs:
run: |
git clone --depth 1 --branch main https://github.com/libsemigroups/libsemigroups.git
cd libsemigroups
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt && sudo make install -j8
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi && sudo make install -j8
ccache -s
- name: "Python version . . ."
run: |
python --version
pip3 --version
- name: "Pip installing requirements . . ."
run: |
pip3 install -r requirements-archive/py${{ matrix.python_minor_version }}-requirements.txt
- name: "Pip3 installing libsemigroups_pybind11 . . ."
run: |
echo $PKG_CONFIG_PATH
pip3 install . -v
- name: "python -m pytest -vv tests/test_*.py . . ."
run: |
python -m pytest -vv tests/test_*.py
- name: "Run doc tests . . ."

# Build libsemigroups_pybind11
- name: "Install libsemigroups_pybind11 . . ."
run: uv sync --locked --all-extras --no-dev --group lint

# Run the tests and lint
- name: "Running tests . . ."
run: uv run pytest
- name: "Running doc tests . . ."
run: |
etc/make-doc.sh # so that all files are generated!
uv run etc/make-doc.sh # so that all files are generated!
cd docs
python -m sphinx -b doctest -d _build/doctrees source _build/doctest
uv run python -m sphinx -b doctest -d _build/doctrees source _build/doctest
- name: "Running ruff, pylint and cpplint . . ."
run: make lint
run: uv run make lint
6 changes: 5 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:

steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6

# Used to host cibuildwheel
- name: Build wheel
Expand All @@ -42,10 +44,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install libsemigroups
run: source etc/make-libsemigroups.sh && sudo make install
- name: Build SDist
run: pipx run build --sdist
run: uv build --sdist
- uses: actions/upload-artifact@v5
with:
name: sdist
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ exclude src/CPPLINT.cfg
exclude .clang-format
exclude .gitignore
exclude .mailmap
exclude .python-version
exclude CONTRIBUTING.rst
exclude dev-environment.yml
exclude release.toml
exclude requirements.txt
exclude uv.lock

# ... and add desired untracked ones
include src/libsemigroups_pybind11/_version.py
Expand Down
53 changes: 49 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,63 @@ pip3 install libsemigroups_pybind11
python -m pip install libsemigroups_pybind11
```

### From the sources
### Installing with mamba

This installation method assumes that you have anaconda or miniconda installed.
See the [getting started][] and [miniconda download page][] on the [conda]
website.

[conda]: https://conda.io/
[getting started]: http://bit.ly/33B0Vfs

[miniconda]: download page: https://conda.io/miniconda.html

It might be a good idea to create and activate a conda/mamba environment to contain
the installation of the `libsemigroups_pybind11`:

```console
mamba create --name myenv_name libsemigroups_pybind11
mamba activate myenv_name
```

## Adding libsemigroups as a dependency to your project using uv

If you manage a Python project with [uv][], you can add libsemigroups as a
dependency as follows:

```console
uv add libsemigroups_pybind11
```

For more information, see uv's guide on [managing dependencies][].

[uv]: https://docs.astral.sh/uv
[managing dependencies]: https://docs.astral.sh/uv/concepts/projects/dependencies/

## From the sources

Before installing `libsemigroups_pybind11` from its sources, you should first
perform a system install of `libsemigroups`. For information
about how to do this, see the
perform a system install of `libsemigroups`. For information about how to do
this, see the
[libsemigroups installation guide](https://libsemigroups.github.io/libsemigroups/md_install.html).

Assuming that you have `libsemigroups` installed, you can install
`libsemigroups_pybind11` as follows:
`libsemigroups_pybind11` with `pip`:

```console
git clone https://github.com/libsemigroups/libsemigroups_pybind11
cd libsemigroups_pybind11
pip install .
```

or with the `uv` pip-compatible interface:

```console
git clone https://github.com/libsemigroups/libsemigroups_pybind11
cd libsemigroups_pybind11
uv pip install .
```

### From a release archive

To build `libsemigroups_pybind11` from a release archive:
Expand Down Expand Up @@ -158,3 +199,7 @@ We would like to thank the authors and contributors of these projects!
[issue tracker]: https://github.com/libsemigroups/libsemigroups_pybind11/issues
[Graphviz]: https://www.graphviz.org
[pybind11]: https://pybind11.readthedocs.io/en/stable/#

```

```
26 changes: 25 additions & 1 deletion docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ the installation of the ``libsemigroups_pybind11``:
$ mamba create --name myenv_name libsemigroups_pybind11
$ mamba activate myenv_name

Adding libsemigroups as a dependency to your project using uv
-------------------------------------------------------------

If you manage a Python project with `uv`_, you can add libsemigroups as a
dependency as follows:

::

$ uv add libsemigroups_pybind11

For more information, see uv's guide on `managing dependencies`_.

.. _uv: https://docs.astral.sh/uv

.. _managing dependencies: https://docs.astral.sh/uv/concepts/projects/dependencies/

From the sources
----------------

Expand All @@ -59,14 +75,22 @@ about how to do this, see the `libsemigroups installation guide
<https://libsemigroups.github.io/libsemigroups/md_install.html>`_.

Assuming that you have ``libsemigroups`` installed, you can install
``libsemigroups_pybind11`` as follows:
``libsemigroups_pybind11`` with ``pip``:

::

$ git clone https://github.com/libsemigroups/libsemigroups_pybind11
$ cd libsemigroups_pybind11
$ pip install .

or with the ``uv`` pip-compatible interface

::

$ git clone https://github.com/libsemigroups/libsemigroups_pybind11
$ cd libsemigroups_pybind11
$ uv pip install .

From a release archive
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
Loading
Loading