Skip to content

Commit b20cfbb

Browse files
Merge pull request #10 from python-microscopy/meson
Meson
2 parents bfd9b96 + fb59e7d commit b20cfbb

File tree

8 files changed

+21229
-15540
lines changed

8 files changed

+21229
-15540
lines changed

.github/workflows/build_pip.yml

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,69 +8,74 @@ on:
88

99
jobs:
1010
deploy_source:
11-
runs-on: 'ubuntu-latest'
12-
11+
runs-on: 'macos-latest'
12+
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v2
1515
- name: Set up Python
16-
uses: actions/setup-python@v3
16+
uses: actions/setup-python@v2
1717
with:
18-
python-version: 3.8
19-
- name: Add conda to system path
18+
python-version: '3.11'
19+
- name: Install build dependencies
2020
run: |
21-
# $CONDA is an environment variable pointing to the root of the miniconda directory
22-
echo $CONDA/bin >> $GITHUB_PATH
23-
- name: Install dependencies
21+
python -m pip install --upgrade pip
22+
pip install build twine
23+
- name: Build source distribution
2424
run: |
25-
conda install setuptools wheel twine cython numpy pyyaml
26-
#python -m pip install --upgrade pip
27-
#pip install setuptools wheel twine cython numpy==1.14 pyyaml
28-
- name: Build and publish
25+
python -m build --sdist
26+
- name: Publish source distribution
2927
env:
3028
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
3129
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
3230
run: |
33-
python setup.py sdist
34-
python -m twine upload --skip-existing dist/*
31+
twine upload --skip-existing dist/*.tar.gz
3532
3633
deploy_wheel_mac:
3734
needs: deploy_source #don't build wheels unless we successfully built source package.
3835
strategy:
3936
matrix:
40-
os: [macos-latest]
41-
python: ['3.7', '3.8', '3.9'] #,2.7] - # 2.7 disabled for now due to missing VC9
37+
os: [macos-latest] #, ubuntu-latest]
38+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
39+
arch: [x86_64, arm64]
40+
exclude:
41+
- os: windows-latest
42+
arch: arm64
43+
- os: ubuntu-latest
44+
arch: arm64
4245

4346
runs-on: ${{ matrix.os }}
4447

4548
steps:
46-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v2
4750
- name: Set up Python
48-
uses: actions/setup-python@v3
51+
uses: actions/setup-python@v2
4952
with:
5053
python-version: ${{ matrix.python }}
51-
- name: Add conda to system path
54+
- name: Install build dependencies
5255
run: |
53-
# $CONDA is an environment variable pointing to the root of the miniconda directory
54-
echo $CONDA/bin >> $GITHUB_PATH
55-
- name: Install dependencies
56+
python -m pip install --upgrade pip
57+
pip install build twine
58+
- name: Build wheel
59+
shell: bash
5660
run: |
57-
conda install setuptools wheel twine cython numpy pyyaml
58-
#python -m pip install --upgrade pip
59-
#pip install setuptools wheel twine cython numpy==1.14 pyyaml
60-
- name: Build and publish
61+
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
62+
arch -${{ matrix.arch }} python -m build --wheel
63+
else
64+
python -m build --wheel
65+
fi
66+
- name: Publish wheel
6167
env:
6268
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
6369
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
6470
run: |
65-
python setup.py bdist_wheel
66-
twine upload --skip-existing dist/*
71+
twine upload --skip-existing dist/*.whl
6772
6873
deploy_wheel_win:
6974
needs: deploy_source #don't build wheels unless we successfully built source package.
7075
strategy:
7176
matrix:
7277
os: [windows-latest]
73-
python: ['3.7', '3.8', '3.9'] #,2.7] - # 2.7 disabled for now due to missing VC9
78+
python: ['3.9', '3.10', '3.11', '3.12', '3.13'] #,2.7] - # 2.7 disabled for now due to missing VC9
7479

7580
runs-on: ${{ matrix.os }}
7681

@@ -82,14 +87,13 @@ jobs:
8287
python-version: ${{ matrix.python }}
8388
- name: Install dependencies
8489
run: |
85-
conda install setuptools wheel twine cython numpy pyyaml libpython m2w64-toolchain
86-
#python -m pip install --upgrade pip
87-
#pip install setuptools wheel twine cython numpy==1.14 pyyaml
90+
conda install wheel twine cython numpy pyyaml libpython m2w64-toolchain
91+
python -m pip install --upgrade build meson meson-python
92+
8893
- name: Build and publish
8994
env:
9095
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
9196
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
9297
run: |
93-
mv setup.cfg.win setup.cfg
94-
python setup.py bdist_wheel
98+
python -m build --wheel --no-isolation -Csetup-args="--native-file=mingw_native.ini"
9599
twine upload --skip-existing dist/*

meson.build

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
project(
2+
'pymecompress',
3+
'c', 'cython',
4+
# version: run_command(
5+
# # This should become `numpy/_version.py` in NumPy 2.0
6+
# ['numpy/_build_utils/gitversion.py'],
7+
# check: true).stdout().strip(),
8+
license: 'BSD-3',
9+
meson_version: '>=1.2.99', # version in vendored-meson is 1.2.99
10+
# default_options: [
11+
# 'buildtype=debugoptimized',
12+
# 'b_ndebug=if-release',
13+
# 'c_std=c11',
14+
# 'cpp_std=c++17',
15+
# 'pkgconfig.relocatable=true',
16+
# ],
17+
)
18+
19+
subdir('pymecompress')

mingw_native.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[binaries]
2+
c = 'gcc'
3+
cpp = 'g++'
4+
ar = 'ar'
5+
strip = 'strip'
6+
pkgconfig = 'pkg-config'

0 commit comments

Comments
 (0)