Skip to content

Commit e9bd4e0

Browse files
Added namespace package style to release yml (#16)
Co-authored-by: Steven Silvester <[email protected]>
1 parent 0b6f498 commit e9bd4e0

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/_release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ on:
1111
inputs:
1212
working-directory:
1313
required: true
14-
type: string
15-
default: 'libs/mongodb'
14+
options:
15+
- libs/mongodb
16+
- langgraph-checkpoint-mongodb
17+
default: libs/mongodb
1618

1719
env:
1820
PYTHON_VERSION: "3.11"
@@ -131,9 +133,10 @@ jobs:
131133
"$PKG_NAME==$VERSION" \
132134
)
133135
134-
# Replace all dashes in the package name with underscores,
135-
# since that's how Python imports packages with dashes in the name.
136-
IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)"
136+
# For langchain-mongodb, replace dashes in the package name with underscores.
137+
IMPORT_NAME="${PKG_NAME//-/_}"
138+
# If "langgraph-checkpoint-mongodb", it's a namespace package => /-/.
139+
[[ "$PKG_NAME" == "langgraph-checkpoint-mongodb" ]] && IMPORT_NAME="${PKG_NAME//-/.}"
137140
138141
poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
139142

libs/langgraph-checkpoint-mongodb/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
# TESTING AND COVERAGE
55
######################
66

7-
test tests:
8-
poetry run pytest tests
7+
# Define a variable for the test file path.
8+
TEST_FILE ?= tests/unit_tests/
9+
integration_test integration_tests: TEST_FILE=tests/integration_tests/
10+
11+
12+
test tests integration_test integration_tests:
13+
poetry run pytest $(TEST_FILE)
914

1015
######################
1116
# LINTING AND FORMATTING
@@ -40,3 +45,5 @@ help:
4045
@echo 'format - run code formatters'
4146
@echo 'lint - run linters'
4247
@echo 'test - run unit tests'
48+
@echo 'integration_test - run integration tests'
49+
@echo 'test TEST_FILE=<test_file> - run all tests in file'

0 commit comments

Comments
 (0)