From 760a939e7d809f3bc357d65c0f430da81946b464 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 10 Mar 2017 16:53:35 -0800 Subject: [PATCH] Further autobrew tweaks --- .travis.yml | 2 +- .travis/autobrew.py | 13 +++++++------ .travis/osx_before_deploy.sh | 8 -------- 3 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 .travis/osx_before_deploy.sh diff --git a/.travis.yml b/.travis.yml index 20c24056..d3b328ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ script: - mv dont_import_this_ocrmypdf ocrmypdf after_success: -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash .travis/osx_before_deploy.sh ; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash .travis/osx_brew.sh ; fi # See https://www.appneta.com/blog/pypi-deployment-with-travis-ci/ for # steps to set up testpypi deploy for untagged builds if desired diff --git a/.travis/autobrew.py b/.travis/autobrew.py index 749f95ee..de149b2b 100644 --- a/.travis/autobrew.py +++ b/.travis/autobrew.py @@ -17,7 +17,7 @@ class Ocrmypdf < Formula depends_on "unpaper" depends_on "qpdf" -${poet_resources} +${resources} def install ENV.append ["SETUPTOOLS_SCM_PRETEND_VERSION"], "v${ocrmypdf_version}" @@ -30,11 +30,6 @@ ${poet_resources} test do # `test do` will create, run in and delete a temporary directory. # - # This test will fail and we won't accept that! It's enough to just replace - # "false" with the main program this formula installs, but it'd be nice if you - # were more thorough. Run the test with `brew test OCRmyPDF`. 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 "#{bin}/ocrmypdf", "--version" @@ -58,6 +53,12 @@ def main(): encoding='utf-8', stdout=PIPE, check=True) poet_resources = p.stdout + + # Remove the duplicate "ocrmypdf" resource block + all_resources = poet_resources.split('resource') + kept_resources = [block for block in resources if 'ocrmypdf' not in block] + resources = 'resource'.join(kept_resources) + with open('ocrmypdf.rb', 'w') as out: out.write(recipe_template.substitute(**locals())) diff --git a/.travis/osx_before_deploy.sh b/.travis/osx_before_deploy.sh deleted file mode 100644 index a9edc459..00000000 --- a/.travis/osx_before_deploy.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -euo pipefail -set -x - -pip3 install homebrew-pypi-poet -python3 .travis/autobrew.py -brew audit ocrmypdf.rb -cat ocrmypdf.rb