Skip to content
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 check for prefect-client version in prefect-client workflow #15624

Merged
merged 18 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/prefect-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- requirements.txt
- requirements-client.txt
- setup.cfg
- .github/workflows/prefect-client.yaml
push:
branches:
- main
Expand All @@ -19,6 +20,7 @@ on:
- requirements.txt
- requirements-client.txt
- setup.cfg
- .github/workflows/prefect-client.yaml
workflow_call:
inputs:
upload-artifacts:
Expand Down Expand Up @@ -56,6 +58,10 @@ jobs:
env:
TMPDIR: ${{ env.TMPDIR }}

- name: (DEBUG) Print versioneer output
run: python -c "import versioneer; print(versioneer.get_version())"
working-directory: ${{ env.TMPDIR }}
desertaxle marked this conversation as resolved.
Show resolved Hide resolved

- name: Build a binary wheel and a source tarball
run: pip install wheel && python setup.py sdist bdist_wheel
working-directory: ${{ env.TMPDIR }}
Expand All @@ -64,6 +70,13 @@ jobs:
run: pip install dist/*.tar.gz
working-directory: ${{ env.TMPDIR }}

- name: Get the version of built `prefect-client`
run: |
prefect_client_version=$(python -c "import prefect; print(prefect.__version__)")
echo "prefect_client_version=$prefect_client_version" >> $GITHUB_OUTPUT
working-directory: ${{ env.TMPDIR }}
id: prefect_client_version

- name: Run the smoke test flow using the built client
run: python client/client_flow.py
working-directory: ${{ env.TMPDIR }}
Expand All @@ -74,8 +87,18 @@ jobs:
- name: Install prefect from source
run: pip install .

- name: (DEBUG) Check that prefect and prefect-client are installed
run: pip list | grep prefect
- name: Get the version of built `prefect`
run: |
prefect_version=$(prefect --version)
echo "prefect_version=$prefect_version" >> $GITHUB_OUTPUT
id: prefect_version

- name: Verify that the built `prefect` and `prefect-client` versions are the same
run: |
if [ "${{ steps.prefect_version.outputs.prefect_version }}" != "${{ steps.prefect_client_version.outputs.prefect_client_version }}" ]; then
echo "The built versions of prefect and prefect-client are not the same."
exit 1
fi

- name: Run the smoke test flow again with prefect and prefect-client installed
run: python client/client_flow.py
Expand Down
7 changes: 2 additions & 5 deletions client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

install_requires = open("requirements-client.txt").read().strip().split("\n")

# grab and use the first three version digits (the generated tag)
_version = versioneer.get_version().split(".")
client_version = ".".join(_version[:3]).split("+")[0]

setup(
# Package metadata
name="prefect-client",
Expand All @@ -23,7 +19,8 @@
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
# Versioning
version=client_version,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
# Package setup
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ignore_missing_imports = True

[versioneer]
VCS = git
style = pep440
style = pep440-pre
versionfile_source = src/prefect/_version.py
versionfile_build = prefect/_version.py
version_regex = ^(\d+\.\d+\.\d+(?:[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?)$
Expand Down
Loading