diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index a8fddd62..cbf151d9 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -16,11 +16,15 @@ jobs: with: path: micro-manager - - name: Install Micro Manager and uninstall pyprecice - working-directory: micro-manager + - name: Install dependencies run: | apt-get -qq update apt-get -qq install python3-dev python3-pip git python-is-python3 pkg-config + pip3 install --upgrade pip + + - name: Install Micro Manager and uninstall pyprecice + working-directory: micro-manager + run: | pip3 install --user . pip3 uninstall -y pyprecice diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0d3340..23f5b6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## latest +- Use `pyproject.toml` instead of `setup.py` to configure the build. Package name is now `micro_manager_precice` https://github.com/precice/micro-manager/pull/84 - Add handling of crashing micro simulations https://github.com/precice/micro-manager/pull/85 - Add switch to turn adaptivity on and off in configuration https://github.com/precice/micro-manager/pull/93 diff --git a/docs/running.md b/docs/running.md index cf0e9dd3..4b5f0c8b 100644 --- a/docs/running.md +++ b/docs/running.md @@ -8,21 +8,11 @@ summary: Run the Micro Manager from the terminal with a configuration file as in The Micro Manager is run directly from the terminal by providing the path to the configuration file as an input argument in the following way ```bash -micro_manager micro-manager-config.json +micro-manager-precice micro-manager-config.json ``` -Alternatively the Manager can also be run by creating a Python script which imports the Micro Manager package and calls its run function. For example a run script `run-micro-manager.py` would look like - -```python -from micro_manager import MicroManager - -manager = MicroManager("micro-manager-config.json") - -manager.solve() -``` - -The Micro Manager can also be run in parallel, using the same script as stated above +The Micro Manager can also be run in parallel ```bash -mpirun -n python3 run-micro-manager.py +mpiexec -n micro-manager-precice micro-manager-config.json ``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f9aa9562 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools>=41", "wheel", "setuptools-git-versioning"] +build-backend = "setuptools.build_meta" + +[project] +name="micro-manager-precice" +dynamic = [ "version" ] +dependencies = [ + "pyprecice>=3.0.0.0", "numpy", "mpi4py", "scikit-learn" +] +requires-python = ">=3.8" +authors = [ + { name = "The preCICE Developers", email="info@precice.org"} +] +maintainers = [ + { name = "Ishaan Desai", email="ishaan.desai@ipvs.uni-stuttgart.de"} +] +description="A tool which facilitates two-scale macro-micro coupled simulations using preCICE." +readme = "README.md" +license={ text = "GPLv3" } +keywords = [ "preCICE", "multiscale", "coupling" ] +classifiers=[ +"Development Status :: 4 - Beta", +"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", +"Programming Language :: Python :: 3 :: Only", +"Programming Language :: Python :: 3.8", +"Topic :: Scientific/Engineering", +] + +[project.urls] +Homepage = "https://precice.org" +Documentation = "https://precice.org/tooling-micro-manager-overview.html" +Repository = "https://github.com/precice/micro-manager" +"Bug Tracker" = "https://github.com/precice/micro-manager/issues" + +[project.scripts] +micro-manager-precice = "micro_manager.micro_manager:main" + +[tool.setuptools] +packages=["micro_manager", "micro_manager.adaptivity"] + +[tool.setuptools-git-versioning] +enabled = true diff --git a/setup.py b/setup.py index 20cf67a4..60684932 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,3 @@ -import os +from setuptools import setup -# from https://stackoverflow.com/a/9079062 -import sys - -from setuptools import find_packages, setup - -if sys.version_info[0] < 3: - raise Exception( - "micromanager only supports Python3. Did you run $python setup.py