Skip to content

Commit

Permalink
cibuildwheels build process
Browse files Browse the repository at this point in the history
  • Loading branch information
mtasic85 committed Jul 9, 2024
1 parent d8dca51 commit 62dd8be
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# llama.cpp
wheelhouse/
llama.cpp/
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,36 @@ authors = ["Marko Tasic <mtasic85@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [{include = "llama"}]
include = [{path = "llama/libllama-cli.so"}]
include = [{path = "llama/*.so"}]

[tool.poetry.dependencies]
python = "^3.10"
attrs = "^23.2.0"
huggingface-hub = "^0.23.4"
cffi = "^1.16.0"
setuptools = "^70.2.0"

[tool.poetry.scripts]
build-all = "scripts.build_all:build"
build-clean = "scripts.build_clean:clean"
build-libllama-cli = "scripts.build_libllama_cli:build"
build-llama-cli-cffi = "scripts.build_llama_cli_cffi:build"

# [tool.poetry.build]
# generate-setup-file = true

[tool.poetry.group.dev.dependencies]
setuptools = "^70.2.0"
cibuildwheel = "^2.19.2"

[tool.poetry.build]
script = "scripts/build_all.py"

[tool.cibuildwheel]
# environment = { "CRYPTOGRAPHY_DONT_BUILD_RUST"=1, "CIBW_BUILD_VERBOSITY"=3 }
# before-build = "yum install -y libffi-devel openssl-devel ; curl https://sh.rustup.rs -sSf | sh -s -- -y ; source $HOME/.cargo/env ; pip install poetry"
before-build = "pip install poetry ; poetry install"
skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp*", "*-win32", "*i686"]
build-verbosity=3

[tool.cibuildwheel.pyodide]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
7 changes: 6 additions & 1 deletion scripts/build_all.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import subprocess


def build():
def build(*args, **kwargs):
print(f'build {args = }, {kwargs = }')
subprocess.run(['poetry', 'run', 'build-clean'])
subprocess.run(['poetry', 'run', 'build-libllama-cli'])
subprocess.run(['poetry', 'run', 'build-llama-cli-cffi'])


if __name__ == '__main__':
build()

0 comments on commit 62dd8be

Please sign in to comment.