Skip to content

Commit

Permalink
Update build files and version number
Browse files Browse the repository at this point in the history
  • Loading branch information
zoj613 committed Apr 4, 2021
1 parent f967c51 commit 41d8369
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: htnorm
Version: 0.2.0
Version: 1.0.0
Title: Fast Simulation of Hyperplane-Truncated Multivariate Normal Distributions
Author: Zolisa Bleki
Maintainer: Zolisa Bleki <[email protected]>
Expand Down
29 changes: 16 additions & 13 deletions build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,38 @@ set -e -u -x
cd $(dirname $0)

bin_arr=(
/opt/python/cp36-cp36m/bin
/opt/python/cp37-cp37m/bin
#/opt/python/cp37-cp37m/bin
/opt/python/cp38-cp38/bin
/opt/python/cp39-cp39/bin
#/opt/python/cp39-cp39/bin
)

# add python to image's path
export PATH=/opt/python/cp38-cp38/bin/:$PATH
export PATH=/opt/python/cp37-cp37m/bin/:$PATH
# download install script
curl -#sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py
# install using local archive
python get-poetry.py -y --file poetry-1.1.4-linux.tar.gz
python get-poetry.py -y --file poetry-1.1.5-linux.tar.gz
# install openblas
yum install -y openblas-devel

function build_poetry_wheels
{
# build wheels for 3.6-3.9 with poetry
# build wheels for 3.7-3.9 with poetry
for BIN in "${bin_arr[@]}"; do
rm -Rf build/*
# install build deps
"${BIN}/python" ${HOME}/.poetry/bin/poetry run pip install numpy
"${BIN}/python" ${HOME}/.poetry/bin/poetry run pip install numpy==1.18.1
BUILD_WHEELS=1 "${BIN}/python" ${HOME}/.poetry/bin/poetry build -f wheel
auditwheel repair dist/*.whl --plat $1
whl="$(basename dist/*.whl)"
"${BIN}/python" -m pip install wheelhouse/"$whl"
# test if installed wheel imports correctly
"${BIN}/python" -c "from pyhtnorm import *"
rm dist/*.whl
mkdir -p ./tmp
for whl in dist/*.whl; do
auditwheel repair "$whl" --plat $1 -w "./tmp"
whlname="$(basename "$(echo ./tmp/*.whl)")"
"${BIN}/python" -m pip install ./tmp/"$whlname"
# test if installed wheel imports correctly
"${BIN}/python" -c "from pyhtnorm import *"
mv ./tmp/*.whl wheelhouse/
rm "$whl"
done
done
}

Expand Down
12 changes: 5 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyhtnorm"
version = "1.0.0"
version = "2.0.0"
description = "Fast Simulation of Hyperplane-Truncated Multivatiate Normal Distributions"
authors = ["Zolisa Bleki"]
license = "BSD-3-Clause"
Expand All @@ -20,23 +20,21 @@ include = [
{path = "include", format = "sdist"},
{path = "src/*.c", format = "sdist"},
{path = "src/*.h", format = "sdist"},
{path = "src/*.txt", format = "sdist"},

{path = "pyhtnorm/*.pxd"}
{path = "third_party_licenses"},
]

[tool.poetry.build]
script = "build.py"

[tool.poetry.dependencies]
python = "^3.6.1"
numpy = "^1.17.0"
python = "^3.7.0"
numpy = "^1.18.1"

[tool.poetry.dev-dependencies]
Cython = "^0.29.20"
pytest = "*"
toml = "^0.10.2"

[build-system]
requires = ["poetry-core>=1.0.0a9", "wheel", "setuptools", "numpy>=1.17"]
requires = ["poetry-core>=1.0.0a9", "wheel", "setuptools", "numpy==1.18.1"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 41d8369

Please sign in to comment.