Skip to content

Commit befed0a

Browse files
committed
Update pyproject and add github action config
1 parent ff23cb0 commit befed0a

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

.github/workflows/wheels.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-20.04, macOS-11]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
submodules: recursive
17+
# Used to host cibuildwheel
18+
- uses: actions/setup-python@v3
19+
# Installs poetry
20+
- uses: Gr1N/setup-poetry@v8
21+
with:
22+
poetry-version: "1.4.0"
23+
- name: Install cibuildwheel
24+
run: python -m pip install cibuildwheel==2.12.1
25+
26+
- name: Build wheels
27+
run: python -m cibuildwheel --output-dir wheelhouse
28+
# to supply options, put them in 'env', like:
29+
# env:
30+
# CIBW_SOME_OPTION: value
31+
32+
- uses: actions/upload-artifact@v3
33+
with:
34+
path: ./wheelhouse/*.whl
35+
36+
# - name: Publish a Python distribution to PyPI
37+
# uses: pypa/gh-action-pypi-publish@release/v1
38+
# with:
39+
# password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ repository = "https://github.com/thomasantony/llamacpp-python"
1010
packages = [{ include = "llamacpp", from = "." }]
1111

1212
[tool.poetry.dependencies]
13-
python = "^3.10"
13+
python = "^3.6"
1414
torch = "^1.13.1"
1515
sentencepiece = "^0.1.97"
1616

17-
[tool.poetry.group.dev.dependencies]
18-
setuptools-cpp = "^0.1.0"
19-
setuptools = "^67.6.0"
20-
wheel = "^0.38.4"
21-
2217
[build-system]
2318
requires = ["poetry>=0.12", "setuptools", "wheel", "setuptools-cpp"]
2419
build-backend = "poetry.core.masonry.api"
@@ -32,3 +27,11 @@ llamacpp-convert = 'llamacpp.convert:main'
3227
llamacpp-quantize = 'llamacpp.quantize:main'
3328
llamacpp-cli = 'llamacpp.cli:run'
3429
llamacpp-chat = 'llamacpp.chat:run'
30+
31+
[tool.cibuildwheel]
32+
33+
# Install something required for the build
34+
# (you might want to use build-system.requires instead)
35+
before-build = "pip install -U \"pybind11[global]\""
36+
# Skip PyPy and 32-bit builds
37+
skip = ["pp*", "*-win32", "*-manylinux_i686", "*-musllinux_i686"]

0 commit comments

Comments
 (0)