From a14835eb8c331c1d81e5d857361cf67b6c1d676f Mon Sep 17 00:00:00 2001 From: StephenNneji <34302892+StephenNneji@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:56:50 +0100 Subject: [PATCH] Adds manifest and modifies build files (#37) --- .github/workflows/build_wheel.yml | 16 +++++++--------- MANIFEST.in | 5 +++++ cpp/rat.cpp | 2 +- pyproject.toml | 16 ---------------- setup.py | 4 +++- 5 files changed, 16 insertions(+), 27 deletions(-) create mode 100644 MANIFEST.in diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index e7d0096d..db91cf86 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -1,7 +1,6 @@ name: Build wheel -on: - workflow_dispatch: +on: [workflow_dispatch, workflow_call] concurrency: group: ${{ github.head_ref || github.run_id }} @@ -10,17 +9,14 @@ concurrency: jobs: build: strategy: - fail-fast: false + fail-fast: true matrix: - platform: [windows-latest, ubuntu-latest, macos-latest, macos-14] + platform: [windows-latest, ubuntu-latest, macos-13, macos-14] env: CIBW_SKIP: 'pp*' CIBW_ARCHS: 'auto64' CIBW_PROJECT_REQUIRES_PYTHON: '>=3.9' CIBW_TEST_REQUIRES: 'pytest' - # Appends the project path since build is not done in the project directory - CIBW_TEST_COMMAND: 'pytest {project}/tmp/tests' - defaults: run: shell: bash -l {0} @@ -36,7 +32,7 @@ jobs: with: python-version: "3.x" - name: Install OMP (MacOS Intel) - if: matrix.platform == 'macos-latest' + if: matrix.platform == 'macos-13' run: | brew install llvm libomp echo "export CC=/usr/local/opt/llvm/bin/clang" >> ~/.bashrc @@ -64,8 +60,10 @@ jobs: # of local package. mkdir tmp cp -r tests tmp/tests/ + CIBW_TEST_COMMAND='cd ${pwd}/tmp && python -m pytest tests' + echo "CIBW_TEST_COMMAND=${CIBW_TEST_COMMAND}" >> $GITHUB_ENV python -m pip install cibuildwheel==2.16.5 - python -m cibuildwheel --output-dir wheelhouse + python -m cibuildwheel --output-dir ./wheelhouse - uses: actions/upload-artifact@v4 with: name: wheels-${{ runner.os }}-${{ strategy.job-index }} diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..086d5f71 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include README.md +recursive-include cpp/RAT * +prune tests +prune */__pycache__ +global-exclude .git diff --git a/cpp/rat.cpp b/cpp/rat.cpp index b84bb375..81c26046 100644 --- a/cpp/rat.cpp +++ b/cpp/rat.cpp @@ -150,7 +150,7 @@ class DylibEngine return py::make_tuple(output, roughness); }catch (const dylib::symbol_error &) { - throw std::runtime_error("failed to get dynamic library symbol for ***functionName"); + throw std::runtime_error("failed to get dynamic library symbol for " + functionName); } }; }; diff --git a/pyproject.toml b/pyproject.toml index 29d309a0..b91bf7dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,19 +6,3 @@ requires = [ ] build-backend = 'setuptools.build_meta' -dependencies = [ - 'numpy >= 1.20', - 'prettytable>=3.9.0', - 'pydantic>=2.7.2', - 'StrEnum>=0.4.15; python_version<"3.11"', -] - -[optional-dependencies] -Dev = ['pytest>=7.4.0', 'pytest-cov>=4.1.0'] -Matlab_latest = ['matlabengine'] -Matlab-2023b = ['matlabengine==23.2.1'] -Matlab-2023a = ['matlabengine==9.14.3'] -Matlab-2022b = ['matlabengine==9.13.9'] -Matlab-2022a = ['matlabengine==9.12.19'] -Matlab-2021b = ['matlabengine==9.11.21'] -Matlab-2021a = ['matlabengine==9.10.3'] diff --git a/setup.py b/setup.py index cca3c73b..af559726 100644 --- a/setup.py +++ b/setup.py @@ -152,9 +152,11 @@ def build_libraries(self, libraries): author_email='', url='https://github.com/RascalSoftware/python-RAT', description='Python extension for the Reflectivity Analysis Toolbox (RAT)', + long_description=open('README.md').read(), + long_description_content_type='text/markdown', packages=find_packages(), include_package_data=True, - package_data={'': [get_shared_object_name(libevent[0])]}, + package_data={'': [get_shared_object_name(libevent[0])], 'RAT.examples': ["data/*.dat"]}, cmdclass={'build_clib': BuildClib, 'build_ext': BuildExt}, libraries=[libevent], ext_modules=ext_modules,