Skip to content

Migrate to pyproject and tox #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Conversation

fsimonis
Copy link
Member

@fsimonis fsimonis commented Jul 2, 2025

This PR migrates from using setup.py and setup.cfg to using pyproject.toml.
It also replaces versioneer with setuptools-git-versioning.

The testing is now handled by tox, which sets an env used by setup.py to determine if it is in a testing environment.

@fsimonis fsimonis requested a review from IshaanDesai July 2, 2025 21:20
@fsimonis fsimonis self-assigned this Jul 2, 2025
MANIFEST.in Outdated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file still needed?

@@ -1,3 +1,31 @@
[build-system]
# PEP 518 - minimum build system requirements
requires = ["setuptools>=61,<72", "wheel", "Cython>=0.29", "packaging", "pip>=19.0.0", "numpy", "mpi4py", "pkgconfig"]
requires = ["setuptools>=61", "wheel", "Cython>=0.29", "packaging", "pip>=19.0.0", "numpy", "mpi4py", "pkgconfig", "setuptools-git-versioning"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure which minimum version of setuptools we need.
Also pip can most likely go.

dynamic = [ "version" ]
readme = "README.md"
description="Python language bindings for the preCICE coupling library"
license = "LGPL-3.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it LGPL-3.0 or LGPL-3.0-or-later?


[project.urls]
Repository = "https://github.com/precice/python-bindings.git"
Issues = "https://github.com/precice/python-bindings/issues"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compile_args += pkgconfig.cflags('libprecice').split()

if not is_test:
if os.environ.get('TOX_ENV_NAME') is not None:
Copy link
Member Author

@fsimonis fsimonis Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently use TOX_ENV_NAME to detect a testing scenario.
Maybe an env like PYPRECICE_MOCKED would be a better fit to simplify testing outside of tox environments.

Furthermore, this currently blocks us from running the solverdummies as a normal pytest in a tox environment.

PKG_CONFIG_SYSTEM_INCLUDE_PATH: 1
run: |
export CFLAGS=-I$GITHUB_WORKSPACE
python3 setup.py test
export PKG_CONFIG_PATH=$(readlink -f "precice-core/build")
tox
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably replace a substantial part of the workflow with tox itself.

@fsimonis fsimonis force-pushed the migrate-to-pyproject branch from e8082f1 to 3d90c03 Compare July 4, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant