Skip to content

Commit 3c0de79

Browse files
CI build wheels and upload (#146)
* build wheels * should work for linux and maybe macos * remove windows for now * only linux for now * test upload to pypi (test) * add build dependencies * add back macos * trying something else for macos * don't build for python 3.10 for now * forgot to add to commit * switching to oldest_supported_numpy * skip pypy builds because of numpy issues * getting started with windows build * trying escaped double quotes * try to install with conda * forgot pyproject * fix lib dir for windows * clean up macos with symlinks * another try * back to what works * Addressing Uwe's comments * trying new windows formatting * trying CXX flags * jemalloc-local for linux and new syntax for windows * using include for windows instead of CFLAGS * focus on windows for now * double backslash? * backslash... * now taking care of macos * jemalloc cannot build docs when prefixed * fix read-only error on macos and re-enable linux wheel build * missed a comma * new path for included headers * use older linux image to improve compatibility * added changelog and testpypi step before sending to pypi
1 parent 0620786 commit 3c0de79

File tree

4 files changed

+139
-2
lines changed

4 files changed

+139
-2
lines changed

.github/workflows/build_wheels.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build and upload to PyPI
2+
3+
on:
4+
pull_request:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-20.04, macos-10.15, windows-2019]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Build wheels
21+
uses: pypa/[email protected]
22+
23+
- uses: actions/upload-artifact@v2
24+
with:
25+
path: ./wheelhouse/*.whl
26+
27+
build_sdist:
28+
name: Build source distribution
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- uses: actions/setup-python@v2
34+
name: Install Python
35+
with:
36+
python-version: '3.8'
37+
38+
- name: Install build dependencies
39+
run: python -m pip install setuptools setuptools-scm wheel mako numpy Cython
40+
41+
- name: Build sdist
42+
run: python setup.py sdist
43+
44+
- uses: actions/upload-artifact@v2
45+
with:
46+
path: dist/*.tar.gz
47+
48+
upload_testpypi:
49+
needs: [build_wheels, build_sdist]
50+
runs-on: ubuntu-latest
51+
if: github.event_name == 'release' && github.event.action == 'published'
52+
steps:
53+
- uses: actions/download-artifact@v2
54+
with:
55+
name: artifact
56+
path: dist
57+
58+
- uses: pypa/[email protected]
59+
with:
60+
user: __token__
61+
password: ${{ secrets.GH_TESTPYPI_UPLOAD }}
62+
repository_url: https://test.pypi.org/legacy/
63+
64+
upload_pypi:
65+
needs: [build_wheels, build_sdist, upload_testpypi]
66+
runs-on: ubuntu-latest
67+
if: github.event_name == 'release' && github.event.action == 'published'
68+
steps:
69+
- uses: actions/download-artifact@v2
70+
with:
71+
name: artifact
72+
path: dist
73+
74+
- uses: pypa/[email protected]
75+
with:
76+
user: __token__
77+
password: ${{ secrets.GH_PYPI_UPLOAD }}
78+
repository_url: https://pypi.org/legacy/

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
Changelog
88
=========
99

10+
3.0.4 - 2021-11-03
11+
------------------
12+
13+
**Other changes**
14+
15+
- tabmat is now available on PyPI and will be automatically updated when a new release is published.
16+
1017
3.0.3 - 2021-10-15
1118
------------------
1219

pyproject.toml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [
44
'setuptools-scm',
55
'wheel',
66
'mako',
7-
'numpy',
7+
'oldest-supported-numpy',
88
'Cython',
99
]
1010

@@ -27,3 +27,56 @@ line_length = 88
2727
known_first_party = "tabmat"
2828
skip_glob = '\.eggs/*,\.git/*,\.venv/*,build/*,dist/*'
2929
default_section = 'THIRDPARTY'
30+
31+
[tool.cibuildwheel]
32+
skip = ["cp310-*", "pp*"]
33+
test-requires = ["pytest", "pytest-xdist"]
34+
35+
[tool.cibuildwheel.macos]
36+
before-all = [
37+
"brew install llvm libomp",
38+
"cd ~/",
39+
"git clone --branch 5.2.1 https://github.com/jemalloc/jemalloc.git",
40+
"cd jemalloc",
41+
"./autogen.sh --disable-cxx --with-jemalloc-prefix=local --with-install-suffix=local",
42+
"make",
43+
"make install_bin install_include install_lib",
44+
"cd ~/",
45+
"git clone --branch 7.6.0 https://github.com/xtensor-stack/xsimd.git",
46+
"cd xsimd",
47+
"mkdir build",
48+
"cd build",
49+
"cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..",
50+
"make install"
51+
]
52+
53+
[tool.cibuildwheel.macos.environment]
54+
LDFLAGS="-L/usr/local/lib"
55+
CFLAGS="-I/usr/local/include"
56+
CXX="/usr/local/opt/llvm/bin/clang++"
57+
CC="/usr/local/opt/llvm/bin/clang"
58+
59+
[tool.cibuildwheel.windows]
60+
before-all = [
61+
"C:\\Miniconda\\condabin\\conda install -c conda-forge xsimd",
62+
]
63+
64+
[tool.cibuildwheel.windows.environment]
65+
INCLUDE="C:\\\\Miniconda\\\\Library\\\\include"
66+
67+
[tool.cibuildwheel.linux]
68+
before-all = [
69+
"cd ~/",
70+
"git clone --branch 5.2.1 https://github.com/jemalloc/jemalloc.git",
71+
"cd jemalloc",
72+
"./autogen.sh --disable-cxx --with-jemalloc-prefix=local --with-install-suffix=local",
73+
"make",
74+
"make install_bin install_include install_lib",
75+
"cd ~/",
76+
"git clone --branch 7.6.0 https://github.com/xtensor-stack/xsimd.git",
77+
"cd xsimd",
78+
"mkdir build",
79+
"cd build",
80+
"cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..",
81+
"make install"
82+
]

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
]
8080
extra_link_args = ["-fopenmp"]
8181

82-
8382
architecture = os.environ.get("GLM_ARCHITECTURE", "native")
8483
if architecture != "default":
8584
# Don't set "-march=native" on macOS arm64 as this doesn't exist there.

0 commit comments

Comments
 (0)