From 65376013136e0eb30939c323eaff00574fcd29e1 Mon Sep 17 00:00:00 2001 From: Pierce Kelaita Date: Sun, 30 Jun 2024 00:22:57 -0700 Subject: [PATCH] [fix] typing_extensions --- CHANGELOG.md | 12 +++++++++++- Makefile | 11 +++++++++-- README.md | 5 +++-- l2m2/__init__.py | 2 +- requirements.txt | 3 ++- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 766a920..c02b4ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,19 @@ # Changelog -_Current version: 0.0.22_ +_Current version: 0.0.23_ [PyPi link](https://pypi.org/project/l2m2/) +### 0.0.23 - June 30, 2024 + +#### Fixed + +- Major bug where l2m2 would cause environments without `typing_extensions` installed to crash due to it not being listed as an external dependency. This has been fixed by adding `typing_extensions` as an external dependency. + +#### Changed + +- This bug wasn't caught becuase integration tests were not running in a clean environment – (i.e., `typing_extensions` was already installed from one of the dev dependencies). To prevent this from happening again, I made `make itest` uninstall all Python dependencies before running. + ### 0.0.22 - June 22, 2024 #### Fixed diff --git a/Makefile b/Makefile index 74afdd2..d16bf84 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,17 @@ init: test: pytest -v --cov=l2m2 --cov-report=term-missing --failed-first --durations=0 -itest: +clear-deps: + @pip uninstall -y l2m2 > /dev/null 2>&1 + @pip freeze | xargs pip uninstall -y > /dev/null + +itest-run: @pip install dist/l2m2-$(VERSION)-py3-none-any.whl > /dev/null + @pip install python-dotenv > /dev/null python integration_tests/itests.py - @pip uninstall -y l2m2 > /dev/null + +itest: clear-deps itest-run clear-deps + coverage: pytest --cov=l2m2 --cov-report=html diff --git a/README.md b/README.md index 3346139..ddcf2c8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ### Advantages - **Simple:** Completely unified interface – just swap out the model name -- **Tiny:** only one external dependency (httpx) +- **Tiny:** only two external dependencies (httpx and typing_extensions) - **Fast**: Fully asynchronous if concurrent calls are needed ### Supported Models @@ -579,8 +579,9 @@ Contributions are welcome! Contributing requires Python >= 3.9 and [GNU Make](ht - Create a `.env` file with your API keys, and copy `itests.example.py` to `itests.py`. - Write your integration tests in `itests.py`. - Run locally with `python itests.py -l`. - - Make sure to pass the `-l` flag or else it will look for an L2M2 distribution. Additionally, make sure l2m2 is not installed with pip when running the integration tests locally. + - _Note: make sure to pass the `-l` flag or else it will look for an L2M2 distribution. Additionally, make sure l2m2 is not installed with pip when running the integration tests locally._ - Once your changes are ready, from the top-level directory run `make build` to create the distribution and `make itest` to run your integration tests against the distribution. + - _Note: in order to ensure a clean test environment, `make itest` uninstalls all third-party Python packages before running the tests, so make sure to run `make init` when you're done working on integration tests._ - **Contribute** - Create a PR and ping me for a review. - Merge! diff --git a/l2m2/__init__.py b/l2m2/__init__.py index 479dad0..40b07ef 100644 --- a/l2m2/__init__.py +++ b/l2m2/__init__.py @@ -1 +1 @@ -__version__ = "0.0.22" +__version__ = "0.0.23" diff --git a/requirements.txt b/requirements.txt index 0d769c7..c1ad553 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -httpx>=0.27.0 \ No newline at end of file +httpx>=0.27.0 +typing_extensions>=4.12.2 \ No newline at end of file