Skip to content

Commit 6f93bfa

Browse files
Make repo release ready (#5)
* Update project artifacts * Add a license file * Update dependencies and use black for code formatting * Rename docs to examples * Add other github actions artifacts * Add isort dependency * Skip test batch order test for now
1 parent 7bd0eb9 commit 6f93bfa

36 files changed

+803
-571
lines changed

.github/release-drafter-config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name-template: '$NEXT_MINOR_VERSION'
2+
tag-template: 'v$NEXT_MINOR_VERSION'
3+
autolabeler:
4+
- label: 'maintenance'
5+
files:
6+
- '*.md'
7+
- '.github/*'
8+
- label: 'bug'
9+
branch:
10+
- '/bug-.+'
11+
- label: 'maintenance'
12+
branch:
13+
- '/maintenance-.+'
14+
- label: 'feature'
15+
branch:
16+
- '/feature-.+'
17+
categories:
18+
- title: 'Breaking Changes'
19+
labels:
20+
- 'breakingchange'
21+
- title: '🧪 Experimental Features'
22+
labels:
23+
- 'experimental'
24+
- title: '🚀 New Features'
25+
labels:
26+
- 'feature'
27+
- 'enhancement'
28+
- title: '🐛 Bug Fixes'
29+
labels:
30+
- 'fix'
31+
- 'bugfix'
32+
- 'bug'
33+
- 'BUG'
34+
- title: '🧰 Maintenance'
35+
label: 'maintenance'
36+
change-template: '- $TITLE (#$NUMBER)'
37+
exclude-labels:
38+
- 'skip-changelog'
39+
template: |
40+
# Changes
41+
42+
$CHANGES
43+
44+
## Contributors
45+
We'd like to thank all the contributors who worked on this release!
46+
47+
$CONTRIBUTORS
48+

.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/release-drafter.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- main
8+
9+
permissions: {}
10+
jobs:
11+
update_release_draft:
12+
permissions:
13+
pull-requests: write # to add label to PR (release-drafter/release-drafter)
14+
contents: write # to create a github release (release-drafter/release-drafter)
15+
16+
runs-on: ubuntu-latest
17+
steps:
18+
# Drafts your next Release notes as Pull Requests are merged into "master"
19+
- uses: release-drafter/release-drafter@v5
20+
with:
21+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
22+
config-name: release-drafter-config.yml
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
PYTHON_VERSION: "3.11"
9+
POETRY_VERSION: "1.8.3"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ env.PYTHON_VERSION }}
22+
23+
- name: Install Poetry
24+
uses: snok/install-poetry@v1
25+
with:
26+
version: ${{ env.POETRY_VERSION }}
27+
28+
- name: Build package
29+
run: poetry build
30+
31+
- name: Upload build
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: dist
35+
path: dist/
36+
37+
publish:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ env.PYTHON_VERSION }}
48+
49+
- name: Install Poetry
50+
uses: snok/install-poetry@v1
51+
with:
52+
version: ${{ env.POETRY_VERSION }}
53+
54+
- uses: actions/download-artifact@v4
55+
with:
56+
name: dist
57+
path: dist/
58+
59+
- name: Publish to PyPI
60+
env:
61+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
62+
run: poetry publish

.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

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Redis, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

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 {} +
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)