-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mahiki/dev
I do not care about the failed style tests, some of them are on markdown files wth.
- Loading branch information
Showing
4 changed files
with
281 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,25 +8,17 @@ class Desertislandutils < Formula | |
license "MIT" | ||
|
||
depends_on "[email protected]" | ||
depends_on "poetry" | ||
Check failure on line 11 in Formula/desertislandutils.rb GitHub Actions / test-bot (macos-latest)
|
||
|
||
def install | ||
virtualenv_install_with_resources | ||
venv = virtualenv_create(libexec, "python3") | ||
ENV["VIRTUAL_ENV"] = libexec | ||
system "poetry", "install", "--no-root" | ||
venv.pip_install_and_link buildpath | ||
end | ||
|
||
test do | ||
# TODO: you should like test the brew install and function test of your cli things | ||
# `test do` will create, run in and delete a temporary directory. | ||
# | ||
# This test will fail and we won't accept that! For Homebrew/homebrew-core | ||
# this will need to be a test that verifies the functionality of the | ||
# software. Run the test with `brew test desertislandutils`. Options passed | ||
# to `brew install` such as `--HEAD` also need to be provided to `brew test`. | ||
# | ||
# The installed folder is not in the path, so use the entire path to any | ||
# executables being tested: `system "#{bin}/program", "do", "something"`. | ||
system "false" | ||
# TODO: basic test of built function | ||
# system "#{bin}/wn", "--help" | ||
# system "#{bin}/too", "--help" | ||
system "#{bin}/wn", "--help" | ||
system "#{bin}/too", "--help" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Demonstrates using poetry install to bring dependencies without | ||
# specifying every single resource URL and SHA like usual, which sucks. | ||
# author: mahiki with help from chatgpt4, a lot of back and forth. | ||
|
||
class YourPackage < Formula | ||
include Language::Python::Virtualenv | ||
|
||
desc "Description of your package" | ||
homepage "https://your.package.homepage" | ||
url "https://your.package.url/your_package-0.3.9.tar.gz" | ||
sha256 "SHA256_CHECKSUM_OF_YOUR_PACKAGE" | ||
Check failure on line 11 in notes/examples/desertislandutils.poetry-poc.rb GitHub Actions / test-bot (macos-latest)
|
||
|
||
depends_on "[email protected]" | ||
depends_on "poetry" | ||
|
||
def install | ||
# Create a virtual environment and folder | ||
venv = virtualenv_create(libexec, "python3") | ||
|
||
# Set the VIRTUAL_ENV, poetry uses this instead of generating a random path | ||
# libexec is a variable, the full path. | ||
# /opt/homebrew/Cellar/desertislandutils/0.3.10/libexec | ||
|
||
ENV["VIRTUAL_ENV"] = libexec | ||
|
||
# Install the package dependencies using poetry, not the package source | ||
system "poetry", "install", "--no-root" | ||
|
||
# Install the package itself using pip and create necessary symlinks | ||
venv.pip_install_and_link buildpath | ||
end | ||
|
||
test do | ||
# Test the installation | ||
system "#{bin}/your_executable", "--version" | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters