fix cli release (#13373)

My thought is that the ==version would prevent pip from finding the
package on regular [pypi.org](http://pypi.org/), so it would look at
[test.pypi.org](http://test.pypi.org/) for that. Otherwise it'll pull
package from [pypi.org](http://pypi.org/) (e.g. sub deps)

Right now, the cli release is failing because it's going to
test.pypi.org by default, so it finds this incorrect FASTAPI package
instead of the real one: https://test.pypi.org/project/FASTAPI/
This commit is contained in:
Erick Friis 2023-11-14 15:08:35 -08:00 committed by GitHub
parent 7c3066f9ec
commit 9545f0666d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,19 +97,18 @@ jobs:
env: env:
PKG_NAME: ${{ needs.build.outputs.pkg-name }} PKG_NAME: ${{ needs.build.outputs.pkg-name }}
VERSION: ${{ needs.build.outputs.version }} VERSION: ${{ needs.build.outputs.version }}
# Here we specify: # Here we use:
# - The test PyPI index as the *primary* index, meaning that it takes priority. # - The default regular PyPI index as the *primary* index, meaning
# - The regular PyPI index as an extra index, so that any dependencies that # that it takes priority (https://pypi.org/simple)
# - The test PyPI index as an extra index, so that any dependencies that
# are not found on test PyPI can be resolved and installed anyway. # are not found on test PyPI can be resolved and installed anyway.
# # (https://test.pypi.org/simple). This will include the PKG_NAME==VERSION
# Without the former, we might install the wrong langchain release. # package because VERSION will not have been uploaded to regular PyPI yet.
# Without the latter, we might not be able to install langchain's dependencies.
# #
# TODO: add more in-depth pre-publish tests after testing that importing works # TODO: add more in-depth pre-publish tests after testing that importing works
run: | run: |
pip install \ pip install \
--index-url https://test.pypi.org/simple/ \ --extra-index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
"$PKG_NAME==$VERSION" "$PKG_NAME==$VERSION"
# Replace all dashes in the package name with underscores, # Replace all dashes in the package name with underscores,