From 4b840f2020829ed342481a9c332b8f2f316b076b Mon Sep 17 00:00:00 2001 From: Theia Vogel Date: Mon, 4 Mar 2024 20:46:22 -0800 Subject: [PATCH] Python 3.10 support (#13) * step down to 3.10 * matrix test 3.10 * update changelog * add python version badge and some other badges to README --- .github/workflows/ci.yml | 2 +- CHANGELOG | 1 + README.md | 5 ++++- notebooks/vector_ops.ipynb | 2 +- poetry.lock | 33 +++++++++++++++++++++++++++++++-- pyproject.toml | 2 +- 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a91ec78..3043976 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG b/CHANGELOG index 373191c..5e1ba79 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ## Unreleased * Add GPT-2 support. (#12) +* Officially support Python 3.10 and 3.11. (#13) ## 0.2.0 - 2024-03-03 diff --git a/README.md b/README.md index 6c837d7..a672fc5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # repeng -[![PyPI version](https://badge.fury.io/py/repeng.svg)](https://badge.fury.io/py/repeng) +![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/vgel/repeng/ci.yml?label=ci) +![PyPI - Version](https://img.shields.io/pypi/v/repeng) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/repeng) +![GitHub License](https://img.shields.io/github/license/vgel/repeng) A Python library for generating control vectors with representation engineering. Train a vector in less than sixty seconds! diff --git a/notebooks/vector_ops.ipynb b/notebooks/vector_ops.ipynb index 611a78c..d1ed409 100644 --- a/notebooks/vector_ops.ipynb +++ b/notebooks/vector_ops.ipynb @@ -549,7 +549,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/poetry.lock b/poetry.lock index 55ee733..67de4cb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -67,6 +67,8 @@ mypy-extensions = ">=0.4.3" packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -209,6 +211,20 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "exceptiongroup" +version = "1.2.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, + {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, +] + +[package.extras] +test = ["pytest (>=6)"] + [[package]] name = "filelock" version = "3.13.1" @@ -751,9 +767,11 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=1.3.0,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] @@ -1308,6 +1326,17 @@ dev = ["tokenizers[testing]"] docs = ["setuptools_rust", "sphinx", "sphinx_rtd_theme"] testing = ["black (==22.3)", "datasets", "numpy", "pytest", "requests"] +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + [[package]] name = "torch" version = "2.2.1" @@ -1507,5 +1536,5 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" -python-versions = "^3.11" -content-hash = "68fe26d9f2233253db20535057f59a8233f0cb3a198a60f46f9ead9df5db989a" +python-versions = ">=3.10,<3.12" +content-hash = "849fe6d1a750f6b80428cbb8996b3d5451b855a757b8ba90600bbda2a37f2d64" diff --git a/pyproject.toml b/pyproject.toml index 67fe769..499dc03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Theia Vogel "] readme = "README.md" [tool.poetry.dependencies] -python = "^3.11" +python = ">=3.10,<3.12" # `accelerate` doesn't support 3.12 yet numpy = "^1.26.3" scikit-learn = "^1.4.0" torch = "^2.1.2"