Skip to content

Enhance Windows compatibility and update CI configurations#212

Open
hkmoon wants to merge 252 commits intobertiniteam:developfrom
hkmoon:develop
Open

Enhance Windows compatibility and update CI configurations#212
hkmoon wants to merge 252 commits intobertiniteam:developfrom
hkmoon:develop

Conversation

@hkmoon
Copy link
Copy Markdown

@hkmoon hkmoon commented Mar 28, 2026

This pull request introduces significant improvements to the build system and release workflow for the project, especially focusing on cross-platform compatibility and automated Python package publishing. The main highlights include the addition of a comprehensive GitHub Actions workflow for building and publishing Python wheels to PyPI/TestPyPI, enhancements for Windows compatibility, and updates to documentation and changelogs to reflect these changes.

Automated Build and Release Workflow:

  • Added a new GitHub Actions workflow (.github/workflows/build-and-publish-to-pypi.yml) to automate building Python wheels for Linux, macOS, and Windows, and to publish them to PyPI, TestPyPI, and GitHub Releases. This workflow includes environment setup, dependency installation, platform-specific build steps, artifact uploading, and release signing.

Windows Compatibility Improvements:

  • Updated CMake modules (cmake/FindGMP.cmake, cmake/FindMPFR.cmake, cmake/FindMPC.cmake) to correctly locate and link against Windows-specific library filenames, improving build reliability on Windows. [1] [2] [3]
  • Modified core/CMakeLists.txt to set appropriate build flags and shared library options for MSVC, and improved Boost/Eigen3 detection and linking for cross-platform builds. [1] [2] [3] [4]

Documentation and Changelog Updates:

  • Added a detailed CHANGELOG.md documenting recent changes, release preparations, and platform-specific notes, including new contributor acknowledgments.
  • Updated the README.md with clear installation instructions for Linux, macOS, and Windows, and clarified wheel/platform support.

CMake Modernization and Refactoring:

  • Refactored the top-level CMakeLists.txt to use modern CMake practices, improved project metadata, integrated jrl-cmakemodules for streamlined dependency management, and added options for documentation and testing.
  • Temporarily disabled the addition of the python subdirectory in the build to avoid issues during the transition.

These changes collectively streamline the build, test, and release process, making it easier to maintain and distribute the package across all major platforms.

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Check the github workflow: https://github.com/hkmoon/b2/actions/runs/23671693162

Use https://pypi.org/manage/project/pybertini/release/1.0.9/ for testing.

image

HongKee Moon and others added 30 commits May 6, 2025 15:36
additionally, fix ctest folder
additionally, fix ctest folder
* chore: test for win32

* chore: use Release libraries for linking in windows

* chore: use 1e-14 instead of 1e-15

* 1e-15 doesn't work in windows

* chore: remove docker-compose.yml

* chore: revert test list

---------

Co-authored-by: HongKee Moon <moon@mpi-cbg.de>
HongKee Moon and others added 9 commits April 27, 2026 14:23
scipy stopped shipping manylinux_2_17 wheels in 1.14, so the per-Python
'pip install scipy' (needed for eigenpy's find_scipy at configure time)
fell back to source-building scipy on cp310/311/312/313 inside the
manylinux2014 container and failed on missing OpenBLAS.

manylinux_2_28 (glibc 2.28, AlmaLinux 8 base) has scipy binary wheels
for cp39–cp313. Tradeoff: produced wheels require glibc 2.28+ (Ubuntu
18.04+, RHEL/CentOS 8+, Debian 10+) instead of 2.17.
a74ca56 added --no-index to the wheel install, which is the right
intent (force the local wheel) but blocks pip from reaching PyPI for
the transitive numpy dependency: "No matching distribution found for
numpy". Install numpy from PyPI first, then bertini offline from dist/.
Ensure thread default precision matches static default precision for Boost.Multiprecision.
…ructors

With init<long int> on line 371 still in place plus IMPLICITLY_CONVERTIBLE(int, T) registered later in ExposeFloat, Float(123) will still resolve cleanly.
@ofloveandhate
Copy link
Copy Markdown
Contributor

I really like the documentation! I have a few notes about the Python docs:

  • I had previously used gitpython to write the git commit into the Sphinx-generated docs. Is that still working? Is there a better way to do it?
  • From the version I looked at on your repo, the library either wasn't built or wasn't importable when the docs were generated, so the classes and functions are lacking their autodocs. The only things that appear are the contents from the .rst files. When I was working on them last week on my mac, I had to adjust the pythonpath to pick up the build directory I was using. I think that's probably the fix?

@hkmoon
Copy link
Copy Markdown
Author

hkmoon commented Apr 29, 2026

  • I had previously used gitpython to write the git commit into the Sphinx-generated docs. Is that still working? Is there a better way to do it?

Yes, gitpython is used for Sphinx configuration. The docs are updated.

  • From the version I looked at on your repo, the library either wasn't built or wasn't importable when the docs were generated, so the classes and functions are lacking their autodocs. The only things that appear are the contents from the .rst files. When I was working on them last week on my mac, I had to adjust the pythonpath to pick up the build directory I was using. I think that's probably the fix?

Can you check it if it's working? I am currently working on docs branch that will be merged into develop when you confirm it.

The current url is based on github.com/hkmoon, which should be replaced by b2 when the PR is merged.

By the way, Bertini version is 2.0.0 in PyPI. Please check it when you have time.

@ofloveandhate
Copy link
Copy Markdown
Contributor

Hi! Thanks!!! I just want to be cautious: We shouldn't be using actual PyPI for development work through this PR... we should be using testpypi for this, until we get it all dialed in and make a release. Then releases should trigger to PyPI. But I'll still give it a try.

@hkmoon
Copy link
Copy Markdown
Author

hkmoon commented Apr 30, 2026

@ofloveandhate Sure, you can manage the releases and versions. I wound't touch it anymore. You can also delete the current release in PyPI too. Let me know when all the things are merged into develop/main. Then, I will check all the information and documentation links are properly updated. Thanks a lot!

@ofloveandhate
Copy link
Copy Markdown
Contributor

Ok! So I think this remains before merging: (we're so close!)

  • adjust the workflow to only publish to pypi from main (it already only procs with version tags)
  • documentation changes
  • update build instructions. find and destroy all out of date build and install instructions
  • in doc_resources/landing/index.html, change to the url to bertiniteam, not hkmoon

and this will be done after I accept:

  • point my domain to the github pages for this repo
  • change default branch to main

@ofloveandhate
Copy link
Copy Markdown
Contributor

more todos:

  • make bertini2 project on test/pypi, so that people are absolutely clear that they're not installing bertini 1.
  • delete the old un-qualified bertini project on test/pypi

ofloveandhate and others added 9 commits May 5, 2026 15:46
because i was messing around with using xcode, and i like having a bunch of build folders apparently, that differ by their suffix.
* 📝 docs: add GitHub Pages site combining Doxygen (C++) and Sphinx (Python)

Adds a unified docs site deployed under one github.io: a small landing
page links to the existing Sphinx site at /python/ and a new Doxygen
reference for the C++ core at /cpp/. Sphinx imports `bertini` from PyPI
to keep CI fast; C++ docs use doxygen-awesome-css for a modern theme.
Triggered on pushes to develop and version tags.

* 📚 docs: update push branch in workflow to 'docs'

* 📚 docs: update push branch in workflow from 'docs' to 'develop'

* 🐛 docs(ci): create Doxygen output directory before build

Doxygen only auto-creates a single directory level. The nested
`build/docs/cpp` path needs `mkdir -p` first to avoid the
"Output directory ... does not exist and cannot be created" error.

* 🐛 docs(ci): only deploy to GitHub Pages from develop or tags

The github-pages environment's branch-protection rule rejects
deployments from non-default branches, so PR runs were failing at
the deploy step despite a successful build. Gate the deploy job on
the ref so PRs build for validation but don't attempt to publish.

* 📚 docs: update workflow to trigger on 'docs' branch instead of 'develop'

* 📚 docs: update workflow condition to trigger on 'docs' branch

* 📝 docs: surface git commit hash and build date across the docs

Compute the commit SHA and build date once in CI and inject into all
three doc surfaces so users can identify which revision a deployed
docs page reflects:
- Doxygen: PROJECT_NUMBER override via stdin (no Doxyfile changes)
- Sphinx: env vars BERTINI_GIT_SHA / BERTINI_BUILD_DATE override the
  existing gitpython lookup; appended to `release` so the sidebar
  shows `<sha7> (YYYY-MM-DD HH:MM UTC)`
- Landing page: footer line links the short SHA to the GitHub commit

Also switches the checkout to fetch-depth: 0 so gitpython works for
local builds too.

* 🐛 docs(sphinx): only inject local source paths if they have _pybertini.so

Sphinx autodoc was producing empty stubs for every Python class and
function on the deployed site. Root cause: conf.py unconditionally
inserted the repo's `python/` source tree at the front of sys.path,
which shadowed the pip-installed `bertini` package in CI. The source
tree's `__init__.py` re-exports from `bertini._pybertini`, but the
compiled `.so` only exists next to the installed package -- so
`import bertini._pybertini` fell over and autodoc swallowed the error.

Now we only prepend the source tree (or `bld/python_bindings`) if the
binary extension actually lives there. CI's pip-installed package is
no longer shadowed; local builds with `BERTINI_BUILD_DIR=/path/to/bld`
or a populated source tree still work.

Verified locally: detailed/multiprec.html went from a near-empty shell
to a 556-line page with full autodoc'd class signatures.

* 📝 docs(sphinx): show git commit info in PyBertini doc footer

Override sphinx_rtd_theme's footer.html via the `extrafooter` block so
every Python docs page shows "Built from <short-sha> on <date>" with
a link to the GitHub commit. Values come from the html_context dict
populated by the same env vars CI already sets.

Adds matching styling to _static/custom.css. Falls back to no-op when
env vars aren't set (local builds without git metadata).

* 📚 docs: update GitHub repository links and workflow conditions

* 🔧 chore: update publish conditions for TestPyPI and PyPI in workflow

* ♻️ refactor(docs): enhance concurrency group naming for deployments

---------

Co-authored-by: HongKee Moon <moon@mpi-cbg.de>
notably, this caused some example code (also committed in this PR) to not freeze caught in this process, but instead crash.  i'd rather have crashes than freezes.

also notably, the denominator in `StepsizeSatisfyingCriterionB` changed from `predictor_order+1` to `predictor_order+1.0` -- this was probably a source of integer arithmetic problems, and now we guarantee that it's not integer arithmetic down there
helps the example be more self-contained
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants