Skip to content

Commit

Permalink
fix paths in pre commit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikKaum committed Aug 22, 2024
1 parent ded1fd9 commit 70d7ba2
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 166 deletions.
320 changes: 160 additions & 160 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,169 +161,169 @@ jobs:
pip3 install outlines-core --find-links dist --force-reinstall
pytest
musllinux:
runs-on: ${{ matrix.platform.runner }}
defaults:
run:
working-directory: bindings/python
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: musllinux_1_2
working-directory: bindings/python
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: bindings/python/dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
options: -v ${{ github.workspace }}:/io -w /io/bindings/python
run: |
set -e
apk add py3-pip py3-virtualenv
python3 -m virtualenv .venv
source .venv/bin/activate
pip install outlines-core --no-index --find-links dist --force-reinstall
pip install pytest
pytest
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
distro: alpine_latest
githubToken: ${{ github.token }}
install: |
apk add py3-virtualenv
run: |
set -e
cd bindings/python
python3 -m virtualenv .venv
source .venv/bin/activate
pip install pytest
pip install outlines-core --find-links dist --force-reinstall
pytest
# musllinux:
# runs-on: ${{ matrix.platform.runner }}
# defaults:
# run:
# working-directory: bindings/python
# strategy:
# matrix:
# platform:
# - runner: ubuntu-latest
# target: x86_64
# - runner: ubuntu-latest
# target: x86
# - runner: ubuntu-latest
# target: aarch64
# - runner: ubuntu-latest
# target: armv7
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist --find-interpreter
# sccache: 'true'
# manylinux: musllinux_1_2
# working-directory: bindings/python
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-musllinux-${{ matrix.platform.target }}
# path: bindings/python/dist
# - name: pytest
# if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
# uses: addnab/docker-run-action@v3
# with:
# image: alpine:latest
# options: -v ${{ github.workspace }}:/io -w /io/bindings/python
# run: |
# set -e
# apk add py3-pip py3-virtualenv
# python3 -m virtualenv .venv
# source .venv/bin/activate
# pip install outlines-core --no-index --find-links dist --force-reinstall
# pip install pytest
# pytest
# - name: pytest
# if: ${{ !startsWith(matrix.platform.target, 'x86') }}
# uses: uraimo/run-on-arch-action@v2
# with:
# arch: ${{ matrix.platform.target }}
# distro: alpine_latest
# githubToken: ${{ github.token }}
# install: |
# apk add py3-virtualenv
# run: |
# set -e
# cd bindings/python
# python3 -m virtualenv .venv
# source .venv/bin/activate
# pip install pytest
# pip install outlines-core --find-links dist --force-reinstall
# pytest

windows:
runs-on: ${{ matrix.platform.runner }}
defaults:
run:
working-directory: bindings/python
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
working-directory: bindings/python
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: bindings/python/dist
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
run: |
set -e
python3 -m venv .venv
source .venv/Scripts/activate
pip install outlines-core --find-links dist --force-reinstall
pip install pytest
pytest
# windows:
# runs-on: ${{ matrix.platform.runner }}
# defaults:
# run:
# working-directory: bindings/python
# strategy:
# matrix:
# platform:
# - runner: windows-latest
# target: x64
# - runner: windows-latest
# target: x86
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.x
# architecture: ${{ matrix.platform.target }}
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist --find-interpreter
# sccache: 'true'
# working-directory: bindings/python
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-windows-${{ matrix.platform.target }}
# path: bindings/python/dist
# - name: pytest
# if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
# shell: bash
# run: |
# set -e
# python3 -m venv .venv
# source .venv/Scripts/activate
# pip install outlines-core --find-links dist --force-reinstall
# pip install pytest
# pytest

macos:
runs-on: ${{ matrix.platform.runner }}
defaults:
run:
working-directory: bindings/python
strategy:
matrix:
platform:
- runner: macos-12
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
working-directory: bindings/python
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: bindings/python/dist
- name: pytest
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install outlines-core --find-links dist --force-reinstall
pip install pytest
pytest
# macos:
# runs-on: ${{ matrix.platform.runner }}
# defaults:
# run:
# working-directory: bindings/python
# strategy:
# matrix:
# platform:
# - runner: macos-12
# target: x86_64
# - runner: macos-14
# target: aarch64
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist --find-interpreter
# sccache: 'true'
# working-directory: bindings/python
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-macos-${{ matrix.platform.target }}
# path: bindings/python/dist
# - name: pytest
# run: |
# set -e
# python3 -m venv .venv
# source .venv/bin/activate
# pip install outlines-core --find-links dist --force-reinstall
# pip install pytest
# pytest

sdist:
runs-on: ubuntu-latest
defaults:
run:
working-directory: bindings/python
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: bindings/python
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: bindings/python/dist
# sdist:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: bindings/python
# steps:
# - uses: actions/checkout@v4
# - name: Build sdist
# uses: PyO3/maturin-action@v1
# with:
# command: sdist
# args: --out dist
# working-directory: bindings/python
# - name: Upload sdist
# uses: actions/upload-artifact@v4
# with:
# name: wheels-sdist
# path: bindings/python/dist

# release:
# name: Release
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
rev: v1.2.0
hooks:
- id: mypy
args: [--allow-redefinition]
args: [--config-file=bindings/python/pyproject.toml, --allow-redefinition]
exclude: ^examples/
additional_dependencies: [types-tqdm, types-Pillow]
- repo: local
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/outlines_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Outlines is a Generative Model Programming Framework."""
import outlines_core.models
from _outlines_core_rs import __version__
import outlines_core.models # noqa: F401
from _outlines_core_rs import __version__ # type: ignore

__all__ = ["models", "__version__"]
7 changes: 6 additions & 1 deletion bindings/python/outlines_core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

from typing import Union

from .transformers import Transformers, TransformerTokenizer, mamba, transformers
from .transformers import ( # noqa: F401
Transformers,
TransformerTokenizer,
mamba,
transformers,
)

LogitsGenerator = Union[Transformers]
1 change: 1 addition & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module = [
"setuptools_rust.*",
# TODO: Add type info for the Rust extension
"outlines_core.fsm.outlines_core_rs.*",
"_outlines_core_rs.*",
]
ignore_missing_imports = true

Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ max-line-length = 88
select = C,E,F,W
ignore = E203,E231,E501,E741,W503,W504,C901,E731
per-file-ignores =
**/__init__.py:F401,F403
bindings/python/outlines_core/__init__.py:F401,F403
exclude =
outlines_core/_version.py
bindings/python/outlines_core/_version.py

0 comments on commit 70d7ba2

Please sign in to comment.