diff --git a/.github/workflows/build-wheel-wrapper.yml b/.github/workflows/build-wheel-wrapper.yml new file mode 100644 index 000000000..19a500cf9 --- /dev/null +++ b/.github/workflows/build-wheel-wrapper.yml @@ -0,0 +1,27 @@ +# (C) Copyright 2024- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. + + +name: Build Python Wrapper Wheel + +on: + # Trigger the workflow manually + workflow_dispatch: ~ + + # Allow to be called from another workflow + workflow_call: ~ + + # TODO automation trigger + +jobs: + python-wrapper-wheel: + name: Python Wrapper Wheel + uses: ecmwf/reusable-workflows/.github/workflows/python-wrapper-wheel.yml@main + with: + wheel_directory: python/multiolib + secrets: inherit diff --git a/.gitignore b/.gitignore index 2e29f5ec8..0ef9b845c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,9 @@ doc/latex *.sublime-workspace .*.sw* .*un~ -build* +build/* docs/_build **/.ccls-cache __pycache__ *.egg-info -*.ipynb_checkpoints \ No newline at end of file +*.ipynb_checkpoints diff --git a/pyproject.toml b/pyproject.toml index 092d17dad..68b631b6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,8 @@ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ +# TODO migrate this to python/pymultio once the ci action is modular enough. Don't forget to update relative `license` and + [tool.pytest.ini_options] minversion = "6.0" addopts = "-vv -s" @@ -24,7 +26,7 @@ name = "pymultio" readme = "README.md" description = "A Python interface to multio." keywords = [ "multio", "multiopython", "tools" ] -license = { file = "LICENSE" } +license = { file = "./LICENSE" } authors = [ { name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int" }, ] @@ -64,7 +66,7 @@ urls.Repository = "https://github.com/ecmwf/multio/" [tool.setuptools] packages = ["multio"] -package-dir = { "multio" = "./pymultio/src/multio" } +package-dir = { "multio" = "./python/pymultio/src/multio" } include-package-data = true zip-safe = true diff --git a/python/multiolib/buildconfig b/python/multiolib/buildconfig new file mode 100644 index 000000000..02b7417be --- /dev/null +++ b/python/multiolib/buildconfig @@ -0,0 +1,18 @@ +# (C) Copyright 2025- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. + +# to be source'd by wheelmaker's compile.sh *and* wheel-linux.sh +# NOTE replace the whole thing with pyproject.toml? Less powerful, and quaint to use for sourcing ecbuild invocation +# TODO we duplicate information -- pyproject.toml's `name` and `packages` are derivable from $NAME and must stay consistent + +NAME="multio" +CMAKE_PARAMS1="-Deckit_ROOT=/tmp/multio/prereqs/eckitlib -Deccodes_ROOT=/tmp/multio/prereqs/eccodeslib -Dmetkit_ROOT=/tmp/multio/prereqs/metkitlib -Datlas_ROOT=/tmp/multio/prereqs/atlaslib -Dfdb5_ROOT=/tmp/multio/prereqs/fdblib -Dmir_ROOT=/tmp/multio/prereqs/mirlib -Dfckit_ROOT=/tmp/multio/prereqs/fckitlib" +CMAKE_PARAMS2="-DENABLE_ATLAS_IO=1" +CMAKE_PARAMS="$CMAKE_PARAMS1 $CMAKE_PARAMS2" +PYPROJECT_DIR="python/multiolib" +DEPENDENCIES='["eckitlib", "eccodeslib", "metkitlib", "atlaslib", "fdblib", "mirlib", "fckitlib"]' diff --git a/python/multiolib/setup.cfg b/python/multiolib/setup.cfg new file mode 100644 index 000000000..d68ff9cf5 --- /dev/null +++ b/python/multiolib/setup.cfg @@ -0,0 +1,5 @@ +[metadata] +description = "multiolib" +long_description = file: README.md +long_description_content_type = text/markdown +author = file: AUTHORS diff --git a/python/multiolib/setup.py b/python/multiolib/setup.py new file mode 100644 index 000000000..c64ad6d78 --- /dev/null +++ b/python/multiolib/setup.py @@ -0,0 +1,2 @@ +from setup_utils import plain_setup +plain_setup() diff --git a/pymultio/CHANGELOG.md b/python/pymultio/CHANGELOG.md similarity index 100% rename from pymultio/CHANGELOG.md rename to python/pymultio/CHANGELOG.md diff --git a/pymultio/README.md b/python/pymultio/README.md similarity index 100% rename from pymultio/README.md rename to python/pymultio/README.md diff --git a/pymultio/example/plan.py b/python/pymultio/example/plan.py similarity index 100% rename from pymultio/example/plan.py rename to python/pymultio/example/plan.py diff --git a/pymultio/example/test.grib b/python/pymultio/example/test.grib similarity index 100% rename from pymultio/example/test.grib rename to python/pymultio/example/test.grib diff --git a/pymultio/example/test.py b/python/pymultio/example/test.py similarity index 100% rename from pymultio/example/test.py rename to python/pymultio/example/test.py diff --git a/pymultio/requirements.txt b/python/pymultio/requirements.txt similarity index 100% rename from pymultio/requirements.txt rename to python/pymultio/requirements.txt diff --git a/pymultio/src/multio/__init__.py b/python/pymultio/src/multio/__init__.py similarity index 100% rename from pymultio/src/multio/__init__.py rename to python/pymultio/src/multio/__init__.py diff --git a/pymultio/src/multio/constants.py b/python/pymultio/src/multio/constants.py similarity index 100% rename from pymultio/src/multio/constants.py rename to python/pymultio/src/multio/constants.py diff --git a/pymultio/src/multio/lib.py b/python/pymultio/src/multio/lib.py similarity index 100% rename from pymultio/src/multio/lib.py rename to python/pymultio/src/multio/lib.py diff --git a/pymultio/src/multio/metadata.py b/python/pymultio/src/multio/metadata.py similarity index 100% rename from pymultio/src/multio/metadata.py rename to python/pymultio/src/multio/metadata.py diff --git a/pymultio/src/multio/multio.py b/python/pymultio/src/multio/multio.py similarity index 100% rename from pymultio/src/multio/multio.py rename to python/pymultio/src/multio/multio.py diff --git a/pymultio/src/multio/plans/__init__.py b/python/pymultio/src/multio/plans/__init__.py similarity index 100% rename from pymultio/src/multio/plans/__init__.py rename to python/pymultio/src/multio/plans/__init__.py diff --git a/pymultio/src/multio/plans/actions.py b/python/pymultio/src/multio/plans/actions.py similarity index 100% rename from pymultio/src/multio/plans/actions.py rename to python/pymultio/src/multio/plans/actions.py diff --git a/pymultio/src/multio/plans/plans.py b/python/pymultio/src/multio/plans/plans.py similarity index 100% rename from pymultio/src/multio/plans/plans.py rename to python/pymultio/src/multio/plans/plans.py diff --git a/pymultio/src/multio/plans/sinks.py b/python/pymultio/src/multio/plans/sinks.py similarity index 100% rename from pymultio/src/multio/plans/sinks.py rename to python/pymultio/src/multio/plans/sinks.py diff --git a/pymultio/src/multio/processed_multio.h b/python/pymultio/src/multio/processed_multio.h similarity index 100% rename from pymultio/src/multio/processed_multio.h rename to python/pymultio/src/multio/processed_multio.h diff --git a/pymultio/src/multio/utils.py b/python/pymultio/src/multio/utils.py similarity index 100% rename from pymultio/src/multio/utils.py rename to python/pymultio/src/multio/utils.py diff --git a/pymultio/tests/test_actions.py b/python/pymultio/tests/test_actions.py similarity index 100% rename from pymultio/tests/test_actions.py rename to python/pymultio/tests/test_actions.py diff --git a/pymultio/tests/test_context_manager.py b/python/pymultio/tests/test_context_manager.py similarity index 100% rename from pymultio/tests/test_context_manager.py rename to python/pymultio/tests/test_context_manager.py diff --git a/pymultio/tests/test_multio_pythonapi.py b/python/pymultio/tests/test_multio_pythonapi.py similarity index 100% rename from pymultio/tests/test_multio_pythonapi.py rename to python/pymultio/tests/test_multio_pythonapi.py diff --git a/pymultio/tests/test_plans.py b/python/pymultio/tests/test_plans.py similarity index 100% rename from pymultio/tests/test_plans.py rename to python/pymultio/tests/test_plans.py