Skip to content

Commit 2d21b5a

Browse files
Update project artifacts
1 parent 7bd0eb9 commit 2d21b5a

File tree

5 files changed

+112
-53
lines changed

5 files changed

+112
-53
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
- name: Install dependencies
4343
run: |
4444
poetry install --all-extras
45-
- name: run lint
45+
- name: lint
4646
run: |
4747
make lint

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
5757
- name: Run tests
5858
run: |
59-
make ci_test
59+
make test

Makefile

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
1-
.PHONY: test test_watch lint format
1+
.PHONY: install format lint test clean redis-start redis-stop check-types check
22

3-
######################
4-
# TESTING AND COVERAGE
5-
######################
3+
install:
4+
poetry install --all-extras
65

7-
test:
8-
poetry run pytest tests --run-api-tests
6+
redis-start:
7+
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
8+
9+
redis-stop:
10+
docker stop redis-stack
11+
12+
format:
13+
poetry run format
14+
poetry run sort-imports
15+
16+
check-types:
17+
poetry run check-mypy
918

10-
test_watch:
11-
poetry run ptw .
19+
lint: format check-types
1220

13-
ci_test:
14-
poetry run pytest tests
15-
16-
######################
17-
# LINTING AND FORMATTING
18-
######################
19-
20-
# Define a variable for Python and notebook files.
21-
PYTHON_FILES=.
22-
MYPY_CACHE=.mypy_cache
23-
lint format: PYTHON_FILES=.
24-
lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --relative --diff-filter=d main . | grep -E '\.py$$|\.ipynb$$')
25-
lint_package: PYTHON_FILES=langgraph
26-
lint_tests: PYTHON_FILES=tests
27-
lint_tests: MYPY_CACHE=.mypy_cache_test
28-
29-
lint lint_diff lint_package lint_tests:
30-
poetry run ruff check .
31-
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff
32-
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check --select I $(PYTHON_FILES)
33-
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE)
34-
[ "$(PYTHON_FILES)" = "" ] || poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
35-
36-
format format_diff:
37-
poetry run ruff format $(PYTHON_FILES)
38-
poetry run ruff check --select I --fix $(PYTHON_FILES)
21+
test:
22+
poetry run test-verbose
23+
24+
check: lint test
25+
26+
clean:
27+
find . -type d -name "__pycache__" -exec rm -rf {} +
28+
find . -type d -name ".pytest_cache" -exec rm -rf {} +
29+
find . -type d -name ".mypy_cache" -exec rm -rf {} +
30+
find . -type d -name ".coverage" -delete
31+
find . -type d -name "htmlcov" -exec rm -rf {} +
32+
find . -type d -name "dist" -exec rm -rf {} +
33+
find . -type d -name "build" -exec rm -rf {} +
34+
find . -type d -name "*.egg-info" -exec rm -rf {} +
35+
find . -type d -name "_build" -exec rm -rf {} +

pyproject.toml

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,36 @@
22
name = "langgraph-checkpoint-redis"
33
version = "0.0.1"
44
description = "Library with a Redis implementation of LangGraph checkpoint saver."
5-
authors = []
5+
authors = ["Redis Inc. <[email protected]>"]
66
license = "MIT"
77
readme = "README.md"
8-
repository = "https://www.github.com/langchain-ai/langgraph"
8+
repository = "https://www.github.com/redis-developer/langgraph-redis"
9+
keywords = ["ai", "redis", "redis-client", "vector-database", "vector-search"]
10+
classifiers = [
11+
"Programming Language :: Python :: 3.9",
12+
"Programming Language :: Python :: 3.10",
13+
"Programming Language :: Python :: 3.11",
14+
"Programming Language :: Python :: 3.12",
15+
"License :: OSI Approved :: MIT License",
16+
]
917
packages = [{ include = "langgraph" }]
1018

1119
[tool.poetry.dependencies]
1220
python = ">=3.9,<3.13"
1321
langgraph-checkpoint = "^2.0.10"
14-
redisvl = "^0.3.7"
22+
redisvl = "^0.3.9"
1523
redis = "^5.2.1"
1624

1725
[tool.poetry.group.dev.dependencies]
18-
ruff = "^0.6.2"
26+
black = "^25.1.0"
1927
codespell = "^2.2.0"
2028
pytest = "^7.2.1"
2129
anyio = "^4.4.0"
2230
pytest-asyncio = "^0.21.1"
31+
pytest-xdist = {extras = ["psutil"], version = "^3.6.1"}
2332
pytest-mock = "^3.11.1"
24-
pytest-watch = "^4.2.0"
33+
#pytest-watch = "^4.2.0"
2534
mypy = "^1.10.0"
26-
psycopg = {extras = ["binary"], version = ">=3.0.0"}
27-
# langgraph-checkpoint = {path = "../checkpoint", develop = true}
2835
types-redis = "^4.6.0.20241004"
2936
aioconsole = "^0.8.1"
3037
langchain-openai = "^0.3.2"
@@ -42,20 +49,37 @@ langchain-anthropic = "^0.3.5"
4249
addopts = "--strict-markers --strict-config --durations=5 -vv"
4350
asyncio_mode = "auto"
4451

52+
[tool.poetry.scripts]
53+
format = "scripts:format"
54+
check-format = "scripts:check_format"
55+
sort-imports = "scripts:sort_imports"
56+
check-sort-imports = "scripts:check_sort_imports"
57+
check-lint = "scripts:check_lint"
58+
check-mypy = "scripts:check_mypy"
59+
test = "scripts:test"
60+
test-verbose = "scripts:test_verbose"
4561

4662
[build-system]
47-
requires = ["poetry-core"]
63+
requires = ["poetry-core>=1.0.0"]
4864
build-backend = "poetry.core.masonry.api"
4965

50-
[tool.ruff]
51-
lint.select = [
52-
"E", # pycodestyle
53-
"F", # Pyflakes
54-
"UP", # pyupgrade
55-
"B", # flake8-bugbear
56-
"I", # isort
57-
]
58-
lint.ignore = ["E501", "B008", "UP007", "UP006"]
66+
[tool.black]
67+
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
68+
exclude = '''
69+
(
70+
| \.egg
71+
| \.git
72+
| \.hg
73+
| \.mypy_cache
74+
| \.nox
75+
| \.tox
76+
| \.venv
77+
| _build
78+
| build
79+
| dist
80+
| setup.py
81+
)
82+
'''
5983

6084
[tool.mypy]
6185
# https://mypy.readthedocs.io/en/stable/config_file.html

scripts.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import subprocess
2+
3+
4+
def format():
5+
subprocess.run(["isort", "./langgraph", "./tests/", "--profile", "black"], check=True)
6+
subprocess.run(["black", "./langgraph", "./tests/"], check=True)
7+
8+
9+
def check_format():
10+
subprocess.run(["black", "--check", "./langgraph"], check=True)
11+
12+
13+
def sort_imports():
14+
subprocess.run(["isort", "./langgraph", "./tests/", "--profile", "black"], check=True)
15+
16+
17+
def check_sort_imports():
18+
subprocess.run(
19+
["isort", "./langgraph", "--check-only", "--profile", "black"], check=True
20+
)
21+
22+
23+
def check_lint():
24+
subprocess.run(["pylint", "--rcfile=.pylintrc", "./langgraph"], check=True)
25+
26+
27+
def check_mypy():
28+
subprocess.run(["python", "-m", "mypy", "./langgraph"], check=True)
29+
30+
31+
def test():
32+
subprocess.run(["python", "-m", "pytest", "-n", "auto", "--log-level=CRITICAL"], check=True)
33+
34+
35+
def test_verbose():
36+
subprocess.run(
37+
["python", "-m", "pytest", "-n", "auto", "-vv", "-s", "--log-level=CRITICAL"], check=True
38+
)

0 commit comments

Comments
 (0)