-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made build system for creating wheels and published to pypi
- Loading branch information
1 parent
8ae6acf
commit a06f4c0
Showing
14 changed files
with
102 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# Script to build wheels for pypi | ||
# Note: Uses $(which pythonX.Y) to get the path to various python interpreters | ||
set -e | ||
|
||
pykingas_version="2.0.0" | ||
os_tag="macosx_11_0_arm64" | ||
py_versions=("3.8" "3.9" "3.10" "3.11") # Need to build different wheels for every python version, because pybind11. | ||
wheelhouse_dir="pypi_release/wheelhouse" | ||
for py_version in "${py_versions[@]}"; do | ||
|
||
echo "Building wheel for python version : ${py_version}" | ||
|
||
[ -f "pykingas/KineticGas_r.so" ] && rm pykingas/KineticGas_r.so | ||
[ -d "cpp/release" ] && rm -rf cpp/release | ||
|
||
bash cpp/build.sh -DPYTHON_EXECUTABLE="$(which "python${py_version}")" | ||
|
||
python -m pip wheel --wheel-dir=${wheelhouse_dir} . | ||
mv pypi_release/wheelhouse/pykingas-${pykingas_version}-py3-none-any.whl pypi_release/dist/pykingas-${pykingas_version}-cp"${py_version//.}"-none-${os_tag}.whl | ||
|
||
done | ||
|
||
# echo "Finished Building : Uploading test to testpypi" | ||
# twine upload -r testpypi pypi_release/dist/* | ||
|
||
exit 0 | ||
|
||
# Code to upload to PyPi : | ||
twine upload pypi_release/dist/* | ||
|
||
exit 0 | ||
|
||
#Code to Delocate wheels | ||
# It appears that there is nothing to delocate here (at least according to delocate-listdeps) | ||
|
||
cd pypi_release/wheelhouse | ||
delocate-wheel -w fixed_wheels -v pykingas-${pykingas_version}-py3-none-any.whl | ||
cd fixed_wheels | ||
mv pykingas-${pykingas_version}-py3-none-any.whl pykingas-${pykingas_version}-cp${py_version//.}-none-macosx_11_0_arm64.whl | ||
cd .. | ||
rm pykingas-${pykingas_version}-py3-none-any.whl # Preventing unintentionally overwriting the fixed wheel |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from pykingas.MieKinGas import MieKinGas | ||
|
||
print('\033[96mImported MieKinGas\033[0m') | ||
|
||
mie = MieKinGas('H2,C1') | ||
mie.viscosity(300, 0.02, [0.5, 0.5], N=1) | ||
|
||
print('\033[92mComputed Something!\033[0m') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
pykingas_version="2.0.5" | ||
py_versions=("3.8" "3.9" "3.10" "3.11") | ||
|
||
for py_version in "${py_versions[@]}"; do | ||
|
||
source venv"${py_version//.}"/bin/activate | ||
|
||
echo "Testing install for Python version $(python --version)" | ||
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pykingas==${pykingas_version} | ||
python pypi_release/test_import.py | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
import imp | ||
from setuptools import setup | ||
from pathlib import Path | ||
from glob import glob | ||
|
||
this_dir = Path(__file__).parent | ||
readme = (this_dir / 'pykingas/README.md').read_text() | ||
setup( | ||
name='pykingas', | ||
version='1.2.4', | ||
version='2.0.0', | ||
packages=['pykingas'], | ||
package_data={'pykingas': ['KineticGas*', 'fluids/*']}, | ||
description='Revised Chapman-Enskog solutions of the Boltzmann Equations ' | ||
'for diffusion, thermal diffusion and thermal conductivity. ' | ||
'Implemented for Hard spheres and Mie-fluids.', | ||
description='Revised Enskog theory for Mie fluids, and other spherical potentials. Allows prediction of transport ' | ||
'coefficients such as diffusion coefficients, viscosities, thermal diffusion coefficients' | ||
' and thermal conductivities. In dense, multicomponent gas mixtures and supercritical mixtures.', | ||
long_description=readme, | ||
long_description_content_type='text/markdown', | ||
author='Vegard Gjeldvik Jervell', | ||
author_email='[email protected]', | ||
url='https://github.com/vegardjervell/Kineticgas', | ||
install_requires=['numpy>=1.22.1', | ||
'scipy>=1.7.3', | ||
'thermopack>=2.1.0'] | ||
url='https://github.com/thermotools/KineticGas', | ||
install_requires=["numpy~=1.22", | ||
"scipy~=1.7", | ||
"thermopack~=2.1"] | ||
) |