Skip to content

Commit a14835e

Browse files
authored
Adds manifest and modifies build files (#37)
1 parent cafba0e commit a14835e

File tree

5 files changed

+16
-27
lines changed

5 files changed

+16
-27
lines changed

.github/workflows/build_wheel.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Build wheel
22

3-
on:
4-
workflow_dispatch:
3+
on: [workflow_dispatch, workflow_call]
54

65
concurrency:
76
group: ${{ github.head_ref || github.run_id }}
@@ -10,17 +9,14 @@ concurrency:
109
jobs:
1110
build:
1211
strategy:
13-
fail-fast: false
12+
fail-fast: true
1413
matrix:
15-
platform: [windows-latest, ubuntu-latest, macos-latest, macos-14]
14+
platform: [windows-latest, ubuntu-latest, macos-13, macos-14]
1615
env:
1716
CIBW_SKIP: 'pp*'
1817
CIBW_ARCHS: 'auto64'
1918
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.9'
2019
CIBW_TEST_REQUIRES: 'pytest'
21-
# Appends the project path since build is not done in the project directory
22-
CIBW_TEST_COMMAND: 'pytest {project}/tmp/tests'
23-
2420
defaults:
2521
run:
2622
shell: bash -l {0}
@@ -36,7 +32,7 @@ jobs:
3632
with:
3733
python-version: "3.x"
3834
- name: Install OMP (MacOS Intel)
39-
if: matrix.platform == 'macos-latest'
35+
if: matrix.platform == 'macos-13'
4036
run: |
4137
brew install llvm libomp
4238
echo "export CC=/usr/local/opt/llvm/bin/clang" >> ~/.bashrc
@@ -64,8 +60,10 @@ jobs:
6460
# of local package.
6561
mkdir tmp
6662
cp -r tests tmp/tests/
63+
CIBW_TEST_COMMAND='cd ${pwd}/tmp && python -m pytest tests'
64+
echo "CIBW_TEST_COMMAND=${CIBW_TEST_COMMAND}" >> $GITHUB_ENV
6765
python -m pip install cibuildwheel==2.16.5
68-
python -m cibuildwheel --output-dir wheelhouse
66+
python -m cibuildwheel --output-dir ./wheelhouse
6967
- uses: actions/upload-artifact@v4
7068
with:
7169
name: wheels-${{ runner.os }}-${{ strategy.job-index }}

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include README.md
2+
recursive-include cpp/RAT *
3+
prune tests
4+
prune */__pycache__
5+
global-exclude .git

cpp/rat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class DylibEngine
150150
return py::make_tuple(output, roughness);
151151

152152
}catch (const dylib::symbol_error &) {
153-
throw std::runtime_error("failed to get dynamic library symbol for ***functionName");
153+
throw std::runtime_error("failed to get dynamic library symbol for " + functionName);
154154
}
155155
};
156156
};

pyproject.toml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,3 @@ requires = [
66
]
77
build-backend = 'setuptools.build_meta'
88

9-
dependencies = [
10-
'numpy >= 1.20',
11-
'prettytable>=3.9.0',
12-
'pydantic>=2.7.2',
13-
'StrEnum>=0.4.15; python_version<"3.11"',
14-
]
15-
16-
[optional-dependencies]
17-
Dev = ['pytest>=7.4.0', 'pytest-cov>=4.1.0']
18-
Matlab_latest = ['matlabengine']
19-
Matlab-2023b = ['matlabengine==23.2.1']
20-
Matlab-2023a = ['matlabengine==9.14.3']
21-
Matlab-2022b = ['matlabengine==9.13.9']
22-
Matlab-2022a = ['matlabengine==9.12.19']
23-
Matlab-2021b = ['matlabengine==9.11.21']
24-
Matlab-2021a = ['matlabengine==9.10.3']

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ def build_libraries(self, libraries):
152152
author_email='',
153153
url='https://github.com/RascalSoftware/python-RAT',
154154
description='Python extension for the Reflectivity Analysis Toolbox (RAT)',
155+
long_description=open('README.md').read(),
156+
long_description_content_type='text/markdown',
155157
packages=find_packages(),
156158
include_package_data=True,
157-
package_data={'': [get_shared_object_name(libevent[0])]},
159+
package_data={'': [get_shared_object_name(libevent[0])], 'RAT.examples': ["data/*.dat"]},
158160
cmdclass={'build_clib': BuildClib, 'build_ext': BuildExt},
159161
libraries=[libevent],
160162
ext_modules=ext_modules,

0 commit comments

Comments
 (0)