-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add action to test with upstream linkml v2 #319
Changes from all commits
594d69e
979be67
35abb4c
a261607
0fc713c
df02094
5bca56c
6a5abf9
2b453e3
8a5dee2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ jobs: | |
- python-version: "3.10" | ||
pydantic-version: "1" | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
|
||
|
@@ -61,29 +64,40 @@ jobs: | |
path: linkml/.venv | ||
key: venv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
# make extra sure we're removing any old version of linkml-runtime that exists | ||
- name: uninstall potentially cached linkml-runtime | ||
working-directory: linkml | ||
run: poetry run pip uninstall linkml-runtime | ||
|
||
# we are not using linkml-runtime's lockfile, but simulating what will happen | ||
# when we merge this and update linkml's lockfile | ||
- name: add linkml-runtime to lockfile | ||
working-directory: linkml | ||
run: poetry add ../linkml-runtime | ||
|
||
# use correct pydantic version | ||
- name: install pydantic | ||
working-directory: linkml | ||
run: poetry add pydantic@^${{ matrix.pydantic-version }} | ||
|
||
- name: remove potentially cached linkml-runtime version | ||
working-directory: linkml | ||
run: poetry run pip uninstall linkml-runtime -y | ||
|
||
- name: get linkml-runtime short hash | ||
working-directory: linkml-runtime | ||
run: | | ||
LINKML_RUNTIME_COMMIT=$(git rev-parse --short HEAD) | ||
echo "LINKML_RUNTIME_COMMIT=$LINKML_RUNTIME_COMMIT" >> "$GITHUB_ENV" | ||
Comment on lines
+76
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this step can be replaced with running this in the
Using the dynamic versioning plugin via the CLI will modify the Then in the next step you should be able to just do the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will try that again, but iirc it doesn't work across directories? like dynamic versioning only works for the project you are currently modifying. but let me try again bc it also could have been that i didn't have the plugin installed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (agreed it's ugly and i hate it lol) |
||
|
||
# install the local version of linkml-runtime: | ||
# we do this vs. pip --force-reinstall so that we keep linkml's locked deps | ||
# and simulate what the lockfile will be after merging and relocking. | ||
# we override the linkml-runtime version here according to poetry-dynamic-versioning: | ||
# "The dynamic version is not available during poetry run or poetry shell because of a Poetry design choice that prevents the plugin from cleaning up after itself." | ||
# and since linkml depends on a specific version of linkml-runtime, this would always fail | ||
- name: add linkml-runtime to linkml's venv | ||
working-directory: linkml | ||
run: | | ||
poetry self add "poetry-dynamic-versioning[plugin]" | ||
POETRY_DYNAMIC_VERSIONING_OVERRIDE="linkml-runtime = 1.99.0+${{ env.LINKML_RUNTIME_COMMIT }}" poetry add ../linkml-runtime | ||
|
||
# note that we run the installation step always, even if we restore a venv, | ||
# the cache will restore the old version of linkml-runtime, but the lockfile | ||
# will only store the directory dependency (and thus will reinstall it) | ||
# the cache will still speedup the rest of the installation | ||
- name: install linkml | ||
working-directory: linkml | ||
run: poetry install --no-interaction -E tests | ||
run: poetry install --no-interaction --no-root -E tests | ||
|
||
- name: print linkml-runtime version | ||
working-directory: linkml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not even germane to the changes here but I recently simplified the testing matrix in the
linkml
repo (linkml/linkml#2041). It might be worth using the same matrix here. I wouldn't lose sleep at night if we didn't do a Pydantic v1 test in this upstream workflow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya ya good call, i wrote this before that got merged, and we were definitely thinking the same thing ;). so would b good to match.