2020
2121env :
2222 PYTHON_VERSION : " 3.11"
23- POETRY_VERSION : " 1.7.1"
2423
2524jobs :
2625 build :
@@ -34,13 +33,12 @@ jobs:
3433 steps :
3534 - uses : actions/checkout@v4
3635
37- - name : Set up Python + Poetry ${{ env.POETRY_VERSION }}
38- uses : " ./.github/actions/poetry_setup "
36+ - name : Install uv
37+ uses : astral-sh/setup-uv@v5
3938 with :
39+ enable-cache : true
4040 python-version : ${{ env.PYTHON_VERSION }}
41- poetry-version : ${{ env.POETRY_VERSION }}
42- working-directory : ${{ inputs.working-directory }}
43- cache-key : release
41+ cache-dependency-glob : " ${{ inputs.working-directory }}/uv.lock"
4442
4543 # We want to keep this build stage *separate* from the release stage,
4644 # so that there's no sharing of permissions between them.
5452 # > from the publish job.
5553 # https://github.com/pypa/gh-action-pypi-publish#non-goals
5654 - name : Build project for distribution
57- run : poetry build
55+ run : uv build
5856 working-directory : ${{ inputs.working-directory }}
5957
6058 - name : Upload build
6866 shell : bash
6967 working-directory : ${{ inputs.working-directory }}
7068 run : |
71- echo pkg-name="$(poetry version | cut -d ' ' -f 1 )" >> $GITHUB_OUTPUT
72- echo version="$(poetry version --short )" >> $GITHUB_OUTPUT
69+ echo pkg-name="$(hatch project metadata | jq -r .name )" >> $GITHUB_OUTPUT
70+ echo version="$(hatch version)" >> $GITHUB_OUTPUT
7371
7472 test-pypi-publish :
7573 needs :
@@ -102,12 +100,10 @@ jobs:
102100 # - The package is published, and it breaks on the missing dependency when
103101 # used in the real world.
104102
105- - name : Set up Python + Poetry ${{ env.POETRY_VERSION }}
106- uses : " ./.github/actions/poetry_setup "
103+ - name : Install uv
104+ uses : astral-sh/setup-uv@v5
107105 with :
108106 python-version : ${{ env.PYTHON_VERSION }}
109- poetry-version : ${{ env.POETRY_VERSION }}
110- working-directory : ${{ inputs.working-directory }}
111107
112108 - name : Import published package
113109 shell : bash
@@ -125,12 +121,12 @@ jobs:
125121 # - attempt install again after 5 seconds if it fails because there is
126122 # sometimes a delay in availability on test pypi
127123 run : |
128- poetry run pip install \
124+ uv run pip install \
129125 --extra-index-url https://test.pypi.org/simple/ \
130126 "$PKG_NAME==$VERSION" || \
131127 ( \
132128 sleep 5 && \
133- poetry run pip install \
129+ uv run pip install \
134130 --extra-index-url https://test.pypi.org/simple/ \
135131 "$PKG_NAME==$VERSION" \
136132 )
@@ -140,7 +136,7 @@ jobs:
140136 # If "langgraph-checkpoint-mongodb", it's a namespace package => /-/.
141137 [[ "$PKG_NAME" == "langgraph-checkpoint-mongodb" ]] && IMPORT_NAME="${PKG_NAME//-/.}"
142138
143- poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
139+ uv run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
144140
145141 - uses : extractions/setup-just@v2
146142
@@ -156,23 +152,17 @@ jobs:
156152 PKG_NAME : ${{ needs.build.outputs.pkg-name }}
157153 VERSION : ${{ needs.build.outputs.version }}
158154 run : |
159- poetry run pip install \
155+ uv run pip install \
160156 --extra-index-url https://test.pypi.org/simple/ \
161157 "$PKG_NAME==$VERSION"
162158
163- - name : Start MongoDB
164- uses :
supercharge/[email protected] 165-
166159 - name : Run unit tests
167160 run : just tests
168161 working-directory : ${{ inputs.working-directory }}
169162
170163 - name : Start local Atlas
171164 run : bash scripts/start_local_atlas.sh
172165
173- - name : Get MongoDB URI
174- run : cat .local_atlas_uri >> $GITHUB_ENV
175-
176166 - name : Install Ollama
177167 run : curl -fsSL https://ollama.com/install.sh | sh
178168
@@ -186,22 +176,11 @@ jobs:
186176 run : just integration_tests
187177 working-directory : ${{ inputs.working-directory }}
188178
189- - name : Get minimum versions
190- working-directory : ${{ inputs.working-directory }}
191- id : min-version
192- run : |
193- poetry run pip install packaging
194- min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml)"
195- echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
196- echo "min-versions=$min_versions"
197-
198179 - name : Run unit tests with minimum dependency versions
199- if : ${{ steps.min-version.outputs.min-versions != '' }}
200- env :
201- MIN_VERSIONS : ${{ steps.min-version.outputs.min-versions }}
202180 run : |
203- poetry run pip install $MIN_VERSIONS
204- just tests
181+ uv sync --python=${{ matrix.python-version }} --resolution=lowest-direct
182+ just test || git checkout uv.lock
183+ git checkout uv.lock
205184 working-directory : ${{ inputs.working-directory }}
206185
207186 publish :
@@ -225,13 +204,12 @@ jobs:
225204 steps :
226205 - uses : actions/checkout@v4
227206
228- - name : Set up Python + Poetry ${{ env.POETRY_VERSION }}
229- uses : " ./.github/actions/poetry_setup "
207+ - name : Install uv
208+ uses : astral-sh/setup-uv@v5
230209 with :
210+ enable-cache : true
231211 python-version : ${{ env.PYTHON_VERSION }}
232- poetry-version : ${{ env.POETRY_VERSION }}
233- working-directory : ${{ inputs.working-directory }}
234- cache-key : release
212+ cache-dependency-glob : " ${{ inputs.working-directory }}/uv.lock"
235213
236214 - uses : actions/download-artifact@v4
237215 with :
@@ -266,13 +244,12 @@ jobs:
266244 steps :
267245 - uses : actions/checkout@v4
268246
269- - name : Set up Python + Poetry ${{ env.POETRY_VERSION }}
270- uses : " ./.github/actions/poetry_setup "
247+ - name : Install uv
248+ uses : astral-sh/setup-uv@v5
271249 with :
250+ enable-cache : true
272251 python-version : ${{ env.PYTHON_VERSION }}
273- poetry-version : ${{ env.POETRY_VERSION }}
274- working-directory : ${{ inputs.working-directory }}
275- cache-key : releaseartifact@v4
252+ cache-dependency-glob : " ${{ inputs.working-directory }}/uv.lock"
276253
277254 - uses : actions/download-artifact@v4
278255 with :
0 commit comments