Skip to content

Commit

Permalink
Cleanup main pyproject and relax minor versions (#1494)
Browse files Browse the repository at this point in the history
* cleanup main pyproject and relax minor versions

* install dev group in precommit pipeline

* fix typo
  • Loading branch information
sfc-gh-chu authored Sep 25, 2024
1 parent e56d2c3 commit 59f9b4c
Show file tree
Hide file tree
Showing 22 changed files with 2,274 additions and 3,909 deletions.
2 changes: 1 addition & 1 deletion .azure_pipelines/templates/run-precommits.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- bash: |
set -e
poetry install --only tests --sync
poetry install --only dev --sync
make run-precommit
condition: eq(variables['python-version'], 3.11)
displayName: Run Pre-commit hooks
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ env:
env-%:
poetry install --with $*

env-required:
poetry install --only required,tests --sync
env-tests:
poetry run pip install pytest nbconvert nbformat pytest-subtests pytest-azurepipelines ruff pre-commit pytest-cov jsondiff

env-optional:
poetry install --with tests,tests-optional --sync --verbose
env-tests-required:
poetry install --only required
make env-tests

env-tests-optional: env env-tests
poetry run pip install llama-index-embeddings-huggingface llama-index-embeddings-openai

env-tests-db: env-tests
poetry run pip install cryptography psycopg2-binary pymysql

env-tests-notebook: env-tests
poetry run pip install faiss-cpu ipytree chromadb unstructured llama-index-readers-web

# Lock the poetry dependencies for all the subprojects.
lock: $(POETRY_DIRS)
Expand Down Expand Up @@ -156,15 +165,15 @@ test-optional-file-%: tests/unit/static/%
TEST_OPTIONAL=true $(PYTEST) tests/unit/static/$*

# Runs required tests
test-%-required: env-required
test-%-required: env-tests-required
make test-$*

# Runs required tests, but allows optional dependencies to be installed.
test-%-allow-optional: env
ALLOW_OPTIONALS=true make test-$*

# Requires the full optional environment to be set up.
test-%-optional: env-optional
test-%-optional: env-tests-optional
TEST_OPTIONAL=true make test-$*

# Run the unit tests, those in the tests/unit. They are run in the CI pipeline
Expand Down
2,666 changes: 516 additions & 2,150 deletions poetry.lock

Large diffs are not rendered by default.

61 changes: 8 additions & 53 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,31 @@ trulens_eval = { version = "^1.0.0" }
[tool.poetry.group.benchmark.dependencies]
trulens-benchmark = { path = "src/benchmark", develop = true }

[tool.poetry.group.tests-db]
optional = true

[tool.poetry.group.tests-db.dependencies]
psycopg2-binary = "^2.9"
pymysql = "^1.1"
cryptography = "^41.0"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.7"
ruff = "^0.5"
ruff = ">=0.5"
mypy = "^1.11"
build = "^1.2"
twine = "^5.1"
codespell = "^2.3"
snowflake-cli-labs = "^2.8.1" # NOTE: used to run zip_wheels.sh

[tool.poetry.group.docs.dependencies]
mkdocs = ">=1.6"
mkdocstrings-python = "^1.10"
mkdocstrings = "^0.26.1"
mkdocstrings = ">=0.26.1"
mkdocs-material = "^9.5"
mkdocs-material-extensions = "^1.3"
mkdocs-autorefs = "^1.0"
mkdocs-redirects = "^1.2"
mkdocs-jupyter = "^0.24"
mkdocs-jupyter = ">=0.24"
mkdocs-include-markdown-plugin = "^6.2"
python-markdown-math = "^0.8"
markdown-include = "^0.8"
python-markdown-math = ">=0.8"
markdown-include = ">=0.8"
notebook = "^7.2"
black = "^24.4"
mkdocs-gen-files = "^0.5"
mkdocs-literate-nav = "^0.6"
mkdocs-section-index = "^0.3"
mkdocs-gen-files = ">=0.5"
mkdocs-literate-nav = ">=0.6"
mkdocs-section-index = ">=0.3"

[tool.poetry.group.apps.dependencies]
trulens-apps-langchain = { path = "src/apps/langchain", develop = true, python = "<3.13" }
Expand All @@ -89,48 +80,12 @@ trulens-providers-litellm = { path = "src/providers/litellm", develop = true }
trulens-connectors-snowflake = { path = "src/connectors/snowflake", develop = true, python = "<3.12" }

[tool.poetry.group.required.dependencies]
python = "^3.9,!=3.9.7"
trulens-core = { path = "src/core", develop = true }
trulens-feedback = { path = "src/feedback", develop = true }
trulens-dashboard = { path = "src/dashboard", develop = true, python = "!=3.9.7" }
# Remove after deprecation period.
trulens_eval = { path = "src/trulens_eval", develop = true, python = "!=3.9.7" }

[tool.poetry.group.tests]
optional = true

[tool.poetry.group.tests.dependencies]
pytest = "^8.3"
nbconvert = "^7.16"
nbformat = "^5.10"
pytest-subtests = "^0.13"
pytest-azurepipelines = "^1.0"
ruff = "^0.5"
pre-commit = "^3.7"
pytest-cov = "^5.0"
frozendict = "^2.4"
jsondiff = "^2.2"

[tool.poetry.group.tests-optional]
optional = true

[tool.poetry.group.tests-optional.dependencies]
llama-index-embeddings-huggingface = "^0.3"

faiss-cpu = "^1.7" # langchain notebooks
ipytree = "^0.2" # notebooks

# test_tru_llama.py and notebooks:
llama-index-readers-web = "^0.2"
llama-index = "^0.11"
llama-index-llms-openai = "^0.2"
llama-index-embeddings-openai = "^0.2"

# test_tru_chain.py and notebooks
langchain-openai = "^0.0"
unstructured = "^0.10"
chromadb = "^0.4"

[tool.ruff]
line-length = 80
extend-exclude = [
Expand Down
230 changes: 125 additions & 105 deletions src/apps/langchain/poetry.lock

Large diffs are not rendered by default.

252 changes: 136 additions & 116 deletions src/apps/llamaindex/poetry.lock

Large diffs are not rendered by default.

222 changes: 121 additions & 101 deletions src/apps/nemo/poetry.lock

Large diffs are not rendered by default.

216 changes: 118 additions & 98 deletions src/benchmark/poetry.lock

Large diffs are not rendered by default.

225 changes: 123 additions & 102 deletions src/connectors/snowflake/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/connectors/snowflake/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ classifiers = [
[tool.poetry.dependencies]
python = "^3.9"
trulens-core = { version = "^1.0.0" }
snowflake-core = { version = "^0.8.0", python = "<3.12" }
snowflake-core = { version = ">=0.8.0", python = "<3.12" }
snowflake-connector-python = { version = "^3.11", python = "<3.12" }
snowflake-snowpark-python = { version = "^1.18", python = "<3.12" }
snowflake-sqlalchemy = { version = "^1.6", python = "<3.12" }
Expand Down
Loading

0 comments on commit 59f9b4c

Please sign in to comment.