Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Gather shared Python dependencies #544

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gather shared dev and test deps to monorepo root
  • Loading branch information
dlqqq committed Dec 26, 2023
commit c40ee8ee72cd32e304fa95be5678d0eab73309e7
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jupyter-ai/monorepo",
"version": "2.7.1",
"description": "A generative AI extension for JupyterLab",
"description": "The top-level monorepo package. Should only be locally installed by developers.",
"private": true,
"keywords": [
"jupyter",
Expand Down Expand Up @@ -29,7 +29,7 @@
"clean": "lerna run clean",
"clean:all": "lerna run clean:all",
"dev": "jupyter lab --config playground/config.py",
"dev-install": "lerna run dev-install --stream",
"dev-install": "pip install \".[dev-shared,test-shared]\" && lerna run dev-install --stream",
"dev-uninstall": "lerna run dev-uninstall --stream",
"lint": "jlpm && lerna run prettier && lerna run eslint",
"lint:check": "lerna run prettier:check && lerna run eslint:check",
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai-magics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"url": "https://github.com/jupyterlab/jupyter-ai.git"
},
"scripts": {
"dev-install": "pip install -e \".[dev,all]\"",
"dev-install": "pip install -e \".[all]\"",
"dev-uninstall": "pip uninstall jupyter_ai_magics -y"
}
}
13 changes: 1 addition & 12 deletions packages/jupyter-ai-magics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ dependencies = [
]

[project.optional-dependencies]
dev = [
"pre-commit>=3.3.3,<4"
]

test = [
"coverage",
"pytest",
"pytest-asyncio",
"pytest-cov"
]

all = [
"ai21",
"anthropic~=0.3.0",
Expand All @@ -51,7 +40,7 @@ all = [
"pillow",
"openai",
"boto3",
"qianfan"
"qianfan",
]

[project.entry-points."jupyter_ai.model_providers"]
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w",
"watch:labextension": "jupyter labextension watch .",
"dev-install": "pip install -e \".[dev,all,test]\" && jupyter labextension develop . --overwrite && jupyter server extension enable jupyter_ai",
"dev-install": "pip install -e \".[all]\" && jupyter labextension develop . --overwrite && jupyter server extension enable jupyter_ai",
"dev-uninstall": "pip uninstall jupyter_ai -y"
},
"dependencies": {
Expand Down
25 changes: 4 additions & 21 deletions packages/jupyter-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ dependencies = [
"aiosqlite>=0.18",
"importlib_metadata>=5.2.0",
"langchain==0.0.350",
"tiktoken", # required for OpenAIEmbeddings
"tiktoken", # required for OpenAIEmbeddings
"jupyter_ai_magics",
"dask[distributed]",
"faiss-cpu", # Not distributed by official repo
"faiss-cpu", # Not distributed by official repo
"typing_extensions>=4.5.0",
"traitlets>=5.0",
"deepmerge>=1.0"
"deepmerge>=1.0",
]

dynamic = ["version", "description", "authors", "urls", "keywords"]
Expand All @@ -43,24 +43,7 @@ dynamic = ["version", "description", "authors", "urls", "keywords"]
core_default_tasks = "jupyter_ai:tasks"

[project.optional-dependencies]
test = [
"jupyter-server[test]>=1.6,<3",
"coverage",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-tornasync",
"pytest-jupyter",
"syrupy~=4.0.8"
]

dev = [
"jupyter_ai_magics[dev]"
]

all = [
"jupyter_ai_magics[all]"
]
all = ["jupyter_ai_magics[all]"]

[tool.hatch.version]
source = "nodejs"
Expand Down
42 changes: 34 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
# This is a top-level monorepo package that is never installed by users. This
# file, along with the root `package.json` file, exist mainly for build tools
# which need extra configuration to work with monorepo projects like ours.

# We use setuptools instead of hatch here for simplicity. We only install this
# package to install the shared dev and test dependencies declared here.
[build-system]
requires = ["hatchling>=1.4.0", "jupyterlab~=4.0", "hatch-nodejs-version"]
build-backend = "hatchling.build"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "jupyter_ai_monorepo"
dynamic = ["version", "description", "authors", "urls", "keywords"]
description = "The top-level monorepo package. Should only be locally installed by developers."
requires-python = ">=3.8"
dependencies = []

# The version declared in `package.json` is used by Jupyter Releaser to build
# the changelogs. That version (not this) is bumped by `scripts/bump-version.sh`
# every release.
version = "0.0.0"

[project.optional-dependencies]
build = []
# dev dependencies shared by all packages. should be installed by developers
# working on Jupyter AI via `jlpm dev-install`.
dev-shared = ["import-linter", "pre-commit>=3.3.3,<4"]

# test dependencies shared by all packages, ditto above.
test-shared = [
"jupyter-server[test]>=1.6,<3",
"coverage",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-tornasync",
"pytest-jupyter",
"syrupy~=4.0.8",
]

[project.readme]
file = "README.md"
Expand All @@ -18,12 +43,13 @@ content-type = "text/markdown"
[project.license]
text = "BSD 3-Clause License"

[tool.hatch.version]
source = "nodejs"
path = "package.json"

[tool.check-manifest]
ignore = [".*"]

[tool.check-wheel-contents]
ignore = ["W002"]

# minimal configuration to allow this package to be installed
[tool.setuptools.packages.find]
where = ["."]
include = ["README.md"]