| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,14 +22,15 @@ jobs: | |||
| 22 | 22 | - uses: actions/setup-python@v3 | |
| 23 | 23 | ||
| 24 | 24 | - name: Install cibuildwheel | |
| 25 | - run: python -m pip install cibuildwheel==2.12.1 | ||
| 25 | + run: python3 -m pip install cibuildwheel==2.12.1 | ||
| 26 | 26 | ||
| 27 | 27 | - name: Install dependencies | |
| 28 | 28 | run: | | |
| 29 | - python -m pip install --upgrade pip pytest cmake scikit-build setuptools | ||
| 29 | + python3 -m pip install --upgrade pip | ||
| 30 | + python3 -m pip install --verbose --editable . | ||
| 30 | 31 | ||
| 31 | 32 | - name: Build wheels | |
| 32 | - run: python -m cibuildwheel --output-dir wheelhouse | ||
| 33 | + run: python3 -m cibuildwheel --output-dir wheelhouse | ||
| 33 | 34 | ||
| 34 | 35 | - uses: actions/upload-artifact@v3 | |
| 35 | 36 | with: | |
@@ -46,10 +47,11 @@ jobs: | |||
| 46 | 47 | - uses: actions/setup-python@v3 | |
| 47 | 48 | - name: Install dependencies | |
| 48 | 49 | run: | | |
| 49 | - python -m pip install --upgrade pip pytest cmake scikit-build setuptools | ||
| 50 | + python3 -m pip install --upgrade pip build | ||
| 51 | + python3 -m pip install --verbose --editable . | ||
| 50 | 52 | - name: Build source distribution | |
| 51 | 53 | run: | | |
| 52 | - python setup.py sdist | ||
| 54 | + python3 -m build --sdist | ||
| 53 | 55 | - uses: actions/upload-artifact@v3 | |
| 54 | 56 | with: | |
| 55 | 57 | path: ./dist/*.tar.gz | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,10 +19,10 @@ jobs: | |||
| 19 | 19 | python-version: "3.8" | |
| 20 | 20 | - name: Install dependencies | |
| 21 | 21 | run: | | |
| 22 | - python -m pip install --upgrade pip pytest cmake scikit-build setuptools | ||
| 22 | + python3 -m pip install --upgrade pip build | ||
| 23 | 23 | - name: Build source distribution | |
| 24 | 24 | run: | | |
| 25 | - python setup.py sdist | ||
| 25 | + python3 -m build --sdist | ||
| 26 | 26 | - name: Publish distribution to PyPI | |
| 27 | 27 | # TODO: move to tag based releases | |
| 28 | 28 | # if: startsWith(github.ref, 'refs/tags') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,11 +26,11 @@ jobs: | |||
| 26 | 26 | python-version: ${{ matrix.python-version }} | |
| 27 | 27 | - name: Install dependencies | |
| 28 | 28 | run: | | |
| 29 | - python -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi sse-starlette httpx uvicorn | ||
| 30 | - pip install . -v | ||
| 29 | + python3 -m pip install --upgrade pip | ||
| 30 | + python3 -m pip install --verbose --editable .[server,test] | ||
| 31 | 31 | - name: Test with pytest | |
| 32 | 32 | run: | | |
| 33 | - pytest | ||
| 33 | + python3 -m pytest | ||
| 34 | 34 | ||
| 35 | 35 | build-windows: | |
| 36 | 36 | ||
@@ -49,11 +49,11 @@ jobs: | |||
| 49 | 49 | python-version: ${{ matrix.python-version }} | |
| 50 | 50 | - name: Install dependencies | |
| 51 | 51 | run: | | |
| 52 | - python -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi sse-starlette httpx uvicorn | ||
| 53 | - pip install . -v | ||
| 52 | + python3 -m pip install --upgrade pip | ||
| 53 | + python3 -m pip install --verbose --editable .[server,test] | ||
| 54 | 54 | - name: Test with pytest | |
| 55 | 55 | run: | | |
| 56 | - pytest | ||
| 56 | + python3 -m pytest | ||
| 57 | 57 | ||
| 58 | 58 | build-macos: | |
| 59 | 59 | ||
@@ -72,8 +72,8 @@ jobs: | |||
| 72 | 72 | python-version: ${{ matrix.python-version }} | |
| 73 | 73 | - name: Install dependencies | |
| 74 | 74 | run: | | |
| 75 | - python -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi sse-starlette httpx uvicorn | ||
| 76 | - pip install . -v | ||
| 75 | + python3 -m pip install --upgrade pip | ||
| 76 | + python3 -m pip install --verbose --editable .[server,test] | ||
| 77 | 77 | - name: Test with pytest | |
| 78 | 78 | run: | | |
| 79 | - pytest | ||
| 79 | + python3 -m pytest | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ if (UNIX AND NOT FORCE_CMAKE) | |||
| 18 | 18 | ) | |
| 19 | 19 | install( | |
| 20 | 20 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so | |
| 21 | - DESTINATION llama_cpp | ||
| 21 | + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp | ||
| 22 | 22 | ) | |
| 23 | 23 | else() | |
| 24 | 24 | set(BUILD_SHARED_LIBS "On") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,30 +1,38 @@ | |||
| 1 | 1 | update: | |
| 2 | 2 | poetry install | |
| 3 | + python3 -m pip install --upgrade pip | ||
| 3 | 4 | git submodule update --init --recursive | |
| 4 | 5 | ||
| 5 | 6 | update.vendor: | |
| 6 | 7 | cd vendor/llama.cpp && git pull origin master | |
| 7 | 8 | ||
| 8 | 9 | build: | |
| 9 | - python3 setup.py develop | ||
| 10 | + python3 -m pip install --upgrade pip | ||
| 11 | + python3 -m pip install --verbose --editable . | ||
| 10 | 12 | ||
| 11 | 13 | build.cuda: | |
| 12 | - CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 python3 setup.py develop | ||
| 14 | + python3 -m pip install --upgrade pip | ||
| 15 | + CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 python3 -m pip install --verbose --editable . | ||
| 13 | 16 | ||
| 14 | 17 | build.opencl: | |
| 15 | - CMAKE_ARGS="-DLLAMA_CLBLAST=on" FORCE_CMAKE=1 python3 setup.py develop | ||
| 18 | + python3 -m pip install --upgrade pip | ||
| 19 | + CMAKE_ARGS="-DLLAMA_CLBLAST=on" FORCE_CMAKE=1 python3 -m pip install --verbose --editable . | ||
| 16 | 20 | ||
| 17 | 21 | build.openblas: | |
| 18 | - CMAKE_ARGS="-DLLAMA_OPENBLAS=on" FORCE_CMAKE=1 python3 setup.py develop | ||
| 22 | + python3 -m pip install --upgrade pip | ||
| 23 | + CMAKE_ARGS="-DLLAMA_OPENBLAS=on" FORCE_CMAKE=1 python3 -m pip install --verbose --editable . | ||
| 19 | 24 | ||
| 20 | 25 | build.blis: | |
| 21 | - CMAKE_ARGS="-DLLAMA_OPENBLAS=on -DLLAMA_OPENBLAS_VENDOR=blis" FORCE_CMAKE=1 python3 setup.py develop | ||
| 26 | + python3 -m pip install --upgrade pip | ||
| 27 | + CMAKE_ARGS="-DLLAMA_OPENBLAS=on -DLLAMA_OPENBLAS_VENDOR=blis" FORCE_CMAKE=1 python3 -m pip install --verbose --editable . | ||
| 22 | 28 | ||
| 23 | 29 | build.metal: | |
| 24 | - CMAKE_ARGS="-DLLAMA_METAL=on" FORCE_CMAKE=1 python3 setup.py develop | ||
| 30 | + python3 -m pip install --upgrade pip | ||
| 31 | + CMAKE_ARGS="-DLLAMA_METAL=on" FORCE_CMAKE=1 python3 -m pip install --verbose --editable . | ||
| 25 | 32 | ||
| 26 | 33 | build.sdist: | |
| 27 | - python3 setup.py sdist | ||
| 34 | + python3 -m pip install --upgrade pip build | ||
| 35 | + python3 -m build --sdist | ||
| 28 | 36 | ||
| 29 | 37 | deploy.pypi: | |
| 30 | 38 | python3 -m twine upload dist/* | |
@@ -36,7 +44,6 @@ deploy.gh-docs: | |||
| 36 | 44 | clean: | |
| 37 | 45 | - cd vendor/llama.cpp && make clean | |
| 38 | 46 | - cd vendor/llama.cpp && rm libllama.so | |
| 39 | - - rm -rf _skbuild | ||
| 40 | 47 | - rm llama_cpp/*.so | |
| 41 | 48 | - rm llama_cpp/*.dylib | |
| 42 | 49 | - rm llama_cpp/*.dll | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,16 +1,47 @@ | |||
| 1 | - [tool.poetry] | ||
| 1 | + [build-system] | ||
| 2 | + requires = [ | ||
| 3 | + "scikit-build-core>=0.4.4", | ||
| 4 | + "cmake>=3.18", | ||
| 5 | + "ninja", | ||
| 6 | + ] | ||
| 7 | + build-backend = "scikit_build_core.build" | ||
| 8 | + | ||
| 9 | + [project] | ||
| 2 | 10 | name = "llama_cpp_python" | |
| 3 | 11 | version = "0.1.59" | |
| 4 | 12 | description = "Python bindings for the llama.cpp library" | |
| 5 | - authors = ["Andrei Betlen <abetlen@gmail.com>"] | ||
| 6 | - license = "MIT" | ||
| 7 | 13 | readme = "README.md" | |
| 8 | - homepage = "https://github.com/abetlen/llama-cpp-python" | ||
| 9 | - repository = "https://github.com/abetlen/llama-cpp-python" | ||
| 10 | - packages = [{include = "llama_cpp"}] | ||
| 11 | - include = [ | ||
| 12 | - "LICENSE.md", | ||
| 14 | + license = { text = "MIT" } | ||
| 15 | + authors = [ | ||
| 16 | + { name = "Andrei Betlen", email = "abetlen@gmail.com" }, | ||
| 17 | + ] | ||
| 18 | + requires-python = ">=3.7" | ||
| 19 | + dependencies = [ | ||
| 20 | + "typing-extensions>=4.5.0", | ||
| 21 | + "numpy>=1.20.0", | ||
| 22 | + "diskcache>=5.6.1", | ||
| 13 | 23 | ] | |
| 24 | + classifiers = [ | ||
| 25 | + "Programming Language :: Python :: 3", | ||
| 26 | + "Programming Language :: Python :: 3.7", | ||
| 27 | + "Programming Language :: Python :: 3.8", | ||
| 28 | + "Programming Language :: Python :: 3.9", | ||
| 29 | + "Programming Language :: Python :: 3.10", | ||
| 30 | + "Programming Language :: Python :: 3.11", | ||
| 31 | + ] | ||
| 32 | + | ||
| 33 | + [tool.scikit-build] | ||
| 34 | + wheel.packages = ["llama_cpp", "llama_cpp.server"] | ||
| 35 | + wheel.expand-macos-universal-tags = true | ||
| 36 | + cmake.verbose = true | ||
| 37 | + | ||
| 38 | + [project.optional-dependencies] | ||
| 39 | + server = [ | ||
| 40 | + "uvicorn>=0.21.1", | ||
| 41 | + "fastapi>=0.95.0", | ||
| 42 | + "sse-starlette>=1.3.3", | ||
| 43 | + ] | ||
| 44 | + test = ["pytest"] | ||
| 14 | 45 | ||
| 15 | 46 | [tool.poetry.dependencies] | |
| 16 | 47 | python = "^3.8.1" | |
@@ -33,12 +64,3 @@ scikit-build = "0.17.6" | |||
| 33 | 64 | ||
| 34 | 65 | [tool.poetry.extras] | |
| 35 | 66 | server = ["uvicorn", "fastapi", "sse-starlette"] | |
| 36 | - | ||
| 37 | - [build-system] | ||
| 38 | - requires = [ | ||
| 39 | - "setuptools>=42", | ||
| 40 | - "scikit-build>=0.13", | ||
| 41 | - "cmake>=3.18", | ||
| 42 | - "ninja", | ||
| 43 | - ] | ||
| 44 | - build-backend = "setuptools.build_meta" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments