Add update_python_resources parameter to build python resources#56
Conversation
464424e to
c58f684
Compare
|
Awesome, thanks for the PR! I have yet to release my own Python packages via Homebrew but this is probably a great reason to get me to do it! After reading the docs, I'm still a bit unclear, does this just automatically populate the Also, I'm a bit worried about this section from the docs, thoughts on how to ensure we can handle this edge case? I'll approve the workflow to see if your lint/tests pass, but I think we'll want to address the above and some clarity on my question would be great. Thanks! |
c58f684 to
e8fa5f5
Compare
|
@Justintime50 I just pushed some lint and test fixes to this branch. Could you please re-approve the GitHub action? As for
What I'm currently doing manually is:
Here’s an example of what a properly structured formula should look like for a Python package. Pay attention to the class Foo < Formula
include Language::Python::Virtualenv
desc "Description"
homepage "https://example.com"
url "..."
resource "six" do
url "https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz"
sha256 "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"
end
resource "parsedatetime" do
url "https://files.pythonhosted.org/packages/a8/20/cb587f6672dbe585d101f590c3871d16e7aec5a576a1694997a3777312ac/parsedatetime-2.6.tar.gz"
sha256 "4cb368fbb18a0b7231f4d76119165451c8d2e35951455dfee97c62a87b04d455"
end
def install
virtualenv_install_with_resources
end
end |
Justintime50
left a comment
There was a problem hiding this comment.
Thanks for the response! I have a few thoughts now that I've been able to trace through it all.
I would also recommend not squashing and force pushing for open source - it hides the intermediary commits which can be super helpful during code review. Code owners can determine when merging if they'd like to squash or keep all the commits on master. Thanks!
2eddb4c to
1e8e38b
Compare
|
Ok, this PR is ready to go with the exception of getting brew into the docker image. We use an alpine image so it may provide challenging. I'll work on that since it may alter the base setup of this action. |
|
@akopdev wanna take one last look at this PR now that I added that test and corrected the Docker setup? I ran end-to-end tests with Docker and it builds correctly as we need. If you're good with these changes or I don't hear from ya in a day or so, I'll ship them and make a new release. Thanks again for this PR! I'm excited to give it a whirl and release my own Python packages with it. |
|
Thank you @Justintime50, I'm good to go. |
|
Hey @akopdev, I dropped some details on #60 about additional findings after releasing. Apparently that build on Docker was super broken (worked great locally, once in GitHub Actions it didn't work) but I believe I was able to fix it; however, this feature doesn't seem to work for private repos. If you'd like, I wouldn't turn down some extra eyes on seeing if we can't get it working for both public and private repos. The extra details are on that issue. Thanks again for this PR! |
|
@Justintime50 Thank you! I have a few repos for experimentation and testing. I'll check as well. Honestly, I didn’t like the solution from the beginning and thought it might be a good quick fix while working on the Python implementation of the feature for direct embedding. If it turns out to be too painful, we can roll it back, and I’ll work on generating the resources in Python instead. What do you think? |
Hi @Justintime50,
Thanks for the great tool! I was recently using it to release my Python package and encountered an issue related to missing Python dependencies. According to Homebrew guidelines, all dependencies should be defined in the resource section and we shouldn't rely on pip to install them at runtime.
That's how I came across Homebrew's command for generating the resource blocks automatically. I decided to put together this small PR and would love to get your thoughts on it.