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 pre- and post-build script to work around Poetry bug #868

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

RobbeSneyders
Copy link
Member

The new packaging strategy introduced in #849 doesn't work correctly for wheels due to a bug in poetry (python-poetry/poetry#8994), which breaks installing both from Github and PyPi. This PR introduces a workaround.

Since the bug is related to the src directory, this workaround adds a pre-build/sh script which unpacks the src directory before building, and a post-build.sh script which moves the package back into the src directory afterwards.

This leads to the following result:

  • Installing from Github leads to an installation including all component files
  • Installing locally without running the build script leads to an installation including all component files
  • Installing from PyPi leads to an installation with only the fondant_component.yaml files for each component

In the ideal case, we get the same result for all installation methods, but this already at least leads to a working result for each method.

@RobbeSneyders RobbeSneyders force-pushed the bugfix/install-from-git branch from 3a93905 to fff4071 Compare February 20, 2024 15:54
Copy link
Collaborator

@GeorgesLorre GeorgesLorre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we open a ticket on our board to make sure we remove this workaround later?

@@ -75,6 +75,9 @@ vertex = ["docker", "kfp", "google-cloud-aiplatform"]
sagemaker = ["sagemaker", "boto3"]
docker = ["docker"]

all = ["dask", "dask-cuda", "s3fs", "adlfs", "gcsfs", "docker", "kfp", "google-cloud-aiplatform",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess this is useful for local development in case you want to install all dependencies. Should we adjust the readme?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For local development, this can still be done with poetry install --all-extras. I just needed this to install all extras when installing from the wheel, which I think is only needed in our CI/CD.

@RobbeSneyders
Copy link
Member Author

can we open a ticket on our board to make sure we remove this workaround later?

Based on the response of the Poetry issue, I'm not sure if we will be able to :) I would follow up on that one instead of having a blocked issue on our repo.

@RobbeSneyders RobbeSneyders merged commit a172ab3 into main Feb 20, 2024
9 checks passed
@RobbeSneyders RobbeSneyders deleted the bugfix/install-from-git branch February 20, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants