From 1107fe3646591e3a89905167c4765dc871cf89cc Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 14:31:08 +0100 Subject: [PATCH 01/16] Try application on CI --- .travis.yml | 18 ++++++++++++++++++ scripts/before_script.sh | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 .travis.yml create mode 100644 scripts/before_script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ee8a0b6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +language: python +python: "3.6" + +addons: + apt: + packages: + - pandoc + - pandoc-citeproc + +before_install: + - bash scripts/before_script.sh + +install: + - python3 setup.py install + +script: + - cd test-files && mdp -vvv diff --git a/scripts/before_script.sh b/scripts/before_script.sh new file mode 100644 index 0000000..961302b --- /dev/null +++ b/scripts/before_script.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +sudo apt-get install -y openssl build-essential xorg libssl-dev +wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz +tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz +cd wkhtmltox +sudo chown root:root bin/wkhtmltopdf +sudo cp -r * /usr/ From 0e963d6f642fff4c3dfc1ca8f6b98550f365ff20 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 14:38:11 +0100 Subject: [PATCH 02/16] Use apt-get instead --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee8a0b6..327015e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,8 @@ sudo: false language: python python: "3.6" -addons: - apt: - packages: - - pandoc - - pandoc-citeproc - before_install: + - sudo apt-get install pandoc pandoc-citeproc - bash scripts/before_script.sh install: From 345f8194164b4c81809a085f738439b3acebb199 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 14:42:43 +0100 Subject: [PATCH 03/16] Require sudo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 327015e..2086c9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: false +sudo: required language: python python: "3.6" From fee06def44082a2d21100a23a6ce0f7262296c87 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 14:50:17 +0100 Subject: [PATCH 04/16] Try on circle --- .travis.yml | 13 ------------- circle.yml | 4 ++++ 2 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2086c9e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -sudo: required -language: python -python: "3.6" - -before_install: - - sudo apt-get install pandoc pandoc-citeproc - - bash scripts/before_script.sh - -install: - - python3 setup.py install - -script: - - cd test-files && mdp -vvv diff --git a/circle.yml b/circle.yml index c0e9715..eb99db8 100644 --- a/circle.yml +++ b/circle.yml @@ -6,6 +6,10 @@ machine: dependencies: + pre: + - sudo apt update && sudo apt install pandoc pandoc-citeproc + - bash scripts/before_script.sh + post: - pip install -r dev-requirements.txt From 13006922d70acea80316497563e3fc3bfd055d6e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 14:54:20 +0100 Subject: [PATCH 05/16] Actually run the application --- circle.yml | 1 + scripts/before_script.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/circle.yml b/circle.yml index eb99db8..be33e7e 100644 --- a/circle.yml +++ b/circle.yml @@ -19,3 +19,4 @@ test: - flake8 md_pdf/ --ignore=E128,E501 - safety check - bandit -r md_pdf/ + - cd test-files && mdp -vvv diff --git a/scripts/before_script.sh b/scripts/before_script.sh index 961302b..6c08cfa 100644 --- a/scripts/before_script.sh +++ b/scripts/before_script.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + sudo apt-get install -y openssl build-essential xorg libssl-dev wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz From 48108295d854f04c09dd799007fda6cb892e23df Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 14:58:04 +0100 Subject: [PATCH 06/16] Actually install project globally --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index be33e7e..57d1486 100644 --- a/circle.yml +++ b/circle.yml @@ -12,6 +12,7 @@ dependencies: post: - pip install -r dev-requirements.txt + - pip install -e . test: From 2d16066cb29405589aa96bcbc512a1654f43e267 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 15:01:51 +0100 Subject: [PATCH 07/16] if in doubt, sudo --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 57d1486..9eece2e 100644 --- a/circle.yml +++ b/circle.yml @@ -12,7 +12,7 @@ dependencies: post: - pip install -r dev-requirements.txt - - pip install -e . + - sudo pip install -e . test: From 1dd401ad63096cc9d48dd17efdd1717ccbf568a8 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 15:14:55 +0100 Subject: [PATCH 08/16] install python dev stuff --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 9eece2e..816a7b2 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,7 @@ machine: dependencies: pre: - - sudo apt update && sudo apt install pandoc pandoc-citeproc + - sudo apt update && sudo apt install pandoc pandoc-citeproc python-dev python3 - bash scripts/before_script.sh post: From e0b12530a4092b06b68337abc064da7c37d2a5c0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Apr 2017 15:17:53 +0100 Subject: [PATCH 09/16] Actually i meant dev --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 816a7b2..a6da124 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,7 @@ machine: dependencies: pre: - - sudo apt update && sudo apt install pandoc pandoc-citeproc python-dev python3 + - sudo apt update && sudo apt install pandoc pandoc-citeproc python-dev python3-dev - bash scripts/before_script.sh post: From 477dd5e693f869c0d11f205186ffd68b844baac8 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 13:18:32 +0100 Subject: [PATCH 10/16] Specify packages --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a357cdc..a350150 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup +from setuptools import setup, find_packages setup( @@ -13,6 +13,7 @@ setup( "pyscss==1.3.5", "PyYAML==3.12" ], + packages=find_packages(), entry_points=""" [console_scripts] mdp=md_pdf.cli:cli From 4e80c75085dfe0e0c982170d96a811775959503a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 13:27:37 +0100 Subject: [PATCH 11/16] Give config an init.py --- md_pdf/config/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 md_pdf/config/__init__.py diff --git a/md_pdf/config/__init__.py b/md_pdf/config/__init__.py new file mode 100644 index 0000000..e69de29 From 994c6175099a9591e9293be4fbb9a7ef7bad33c2 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 19:15:24 +0100 Subject: [PATCH 12/16] include package data --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index a350150..ec9d32c 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ setup( "PyYAML==3.12" ], packages=find_packages(), + include_package_data=True, entry_points=""" [console_scripts] mdp=md_pdf.cli:cli From 844ba479f061c28e5cc777062c47271c2bd220b8 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 19:16:20 +0100 Subject: [PATCH 13/16] Test the program is executable on install --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index c0e9715..64638e0 100644 --- a/circle.yml +++ b/circle.yml @@ -15,3 +15,4 @@ test: - flake8 md_pdf/ --ignore=E128,E501 - safety check - bandit -r md_pdf/ + - mdp --help From 7b44ec5718588fc522a33ea41b1d2444956ad33e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 19:30:05 +0100 Subject: [PATCH 14/16] No need for second install --- circle.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 9a12d11..ee32115 100644 --- a/circle.yml +++ b/circle.yml @@ -7,12 +7,11 @@ machine: dependencies: pre: - - sudo apt update && sudo apt install pandoc pandoc-citeproc python-dev python3-dev + - sudo apt update && sudo apt install pandoc pandoc-citeproc - bash scripts/before_script.sh post: - pip install -r dev-requirements.txt - - sudo pip install -e . test: From be58629611ab0cb8bc6247fa93575500e6f13928 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 19:30:20 +0100 Subject: [PATCH 15/16] dont waste time updating --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index ee32115..f321653 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,7 @@ machine: dependencies: pre: - - sudo apt update && sudo apt install pandoc pandoc-citeproc + - sudo apt install pandoc pandoc-citeproc - bash scripts/before_script.sh post: From c6b387be686f2621e01612da4da0dae68ca7b73b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 27 Apr 2017 19:36:46 +0100 Subject: [PATCH 16/16] Add helper script source --- scripts/before_script.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/before_script.sh b/scripts/before_script.sh index 6c08cfa..1d1adaa 100644 --- a/scripts/before_script.sh +++ b/scripts/before_script.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# 'stolen' from https://github.com/JazzCore/python-pdfkit/blob/master/travis/before-script.sh + set -e sudo apt-get install -y openssl build-essential xorg libssl-dev