diff -Nru fontpens-0.1.0/.codecov.yml fontpens-0.2.4/.codecov.yml --- fontpens-0.1.0/.codecov.yml 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.codecov.yml 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,8 @@ +comment: + layout: "diff, files" + behavior: default + require_changes: true +coverage: + status: + project: off + patch: off diff -Nru fontpens-0.1.0/.coveragerc fontpens-0.2.4/.coveragerc --- fontpens-0.1.0/.coveragerc 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.coveragerc 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,31 @@ +[run] +# measure 'branch' coverage in addition to 'statement' coverage +# See: http://coverage.readthedocs.io/en/coverage-4.5.1/branch.html +branch = True + +# list of directories or packages to measure +source = fontPens + +[paths] +source = + Lib/fontPens + .tox/*/lib/python*/site-packages/fontPens + .tox/pypy*/site-packages/fontPens + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # keywords to use in inline comments to skip coverage + pragma: no cover + + # don't complain if tests don't hit defensive assertion code + (raise|except)(\s)?NotImplementedError + + # don't complain if non-runnable code isn't run + if __name__ == .__main__.: + +# ignore source code that can’t be found +ignore_errors = True + +# when running a summary report, show missing lines +show_missing = True diff -Nru fontpens-0.1.0/debian/changelog fontpens-0.2.4/debian/changelog --- fontpens-0.1.0/debian/changelog 2018-09-02 17:22:09.000000000 +0000 +++ fontpens-0.2.4/debian/changelog 2018-12-15 19:49:33.000000000 +0000 @@ -1,3 +1,11 @@ +fontpens (0.2.4-1) unstable; urgency=medium + + * Team upload + * New upstream release + * Build-Depend on python3-fonttools (>= 3.32.0) + + -- Jeremy Bicha Sat, 15 Dec 2018 14:49:33 -0500 + fontpens (0.1.0-1) unstable; urgency=medium * Initial release. Closes: #895240 diff -Nru fontpens-0.1.0/debian/control fontpens-0.2.4/debian/control --- fontpens-0.1.0/debian/control 2018-09-02 17:22:09.000000000 +0000 +++ fontpens-0.2.4/debian/control 2018-12-15 19:49:33.000000000 +0000 @@ -6,6 +6,7 @@ Build-Depends: debhelper (>=11), dh-python, python3-all, + python3-fonttools (>= 3.32.0), python3-setuptools Standards-Version: 4.1.4 Homepage: https://github.com/robofab-developers/fontPens diff -Nru fontpens-0.1.0/debian/copyright fontpens-0.2.4/debian/copyright --- fontpens-0.1.0/debian/copyright 2018-09-02 17:22:09.000000000 +0000 +++ fontpens-0.2.4/debian/copyright 2018-12-15 19:49:33.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: fontPens Source: https://github.com/robofab-developers/fontPens diff -Nru fontpens-0.1.0/dev-requirements.txt fontpens-0.2.4/dev-requirements.txt --- fontpens-0.1.0/dev-requirements.txt 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/dev-requirements.txt 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,3 @@ +pytest>=3.0 +tox>=2.5 +fontParts>=0.8.4 diff -Nru fontpens-0.1.0/.gitignore fontpens-0.2.4/.gitignore --- fontpens-0.1.0/.gitignore 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/.gitignore 2018-12-15 18:52:53.000000000 +0000 @@ -5,6 +5,11 @@ .cache .eggs +.tox +.coverage +.coverage.* +.pytest_cache +htmlcov # OSX Finder .DS_Store diff -Nru fontpens-0.1.0/Lib/fontPens/angledMarginPen.py fontpens-0.2.4/Lib/fontPens/angledMarginPen.py --- fontpens-0.1.0/Lib/fontPens/angledMarginPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/angledMarginPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -123,7 +123,7 @@ def _makeTestGlyph(): # make a simple glyph that we can test the pens with. - from fontParts.nonelab import RGlyph + from fontParts.fontshell import RGlyph testGlyph = RGlyph() testGlyph.name = "testGlyph" testGlyph.width = 1000 diff -Nru fontpens-0.1.0/Lib/fontPens/digestPointPen.py fontpens-0.2.4/Lib/fontPens/digestPointPen.py --- fontpens-0.1.0/Lib/fontPens/digestPointPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/digestPointPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -1,6 +1,6 @@ from __future__ import absolute_import, print_function, division -from ufoLib.pointPen import AbstractPointPen +from fontTools.pens.pointPen import AbstractPointPen class DigestPointPen(AbstractPointPen): diff -Nru fontpens-0.1.0/Lib/fontPens/flattenPen.py fontpens-0.2.4/Lib/fontPens/flattenPen.py --- fontpens-0.1.0/Lib/fontPens/flattenPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/flattenPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -111,13 +111,94 @@ return aGlyph + +class SamplingPen(BasePen): + """ + This filter pen processes the contours into a series of straight lines by flattening the curves. + Unlike FlattenPen, SamplingPen draws each curve with the given number of steps. + + - otherPen: a different segment pen object this filter should draw the results with. + - steps: the number of steps for each curve segment. + - filterDoubles: don't draw if a segment goes to the same coordinate. + """ + + def __init__(self, otherPen, steps=10, filterDoubles=True): + BasePen.__init__(self, {}) + self.otherPen = otherPen + self.currentPt = None + self.firstPt = None + self.steps = steps + self.filterDoubles = filterDoubles + + def _moveTo(self, pt): + self.otherPen.moveTo(pt) + self.currentPt = pt + self.firstPt = pt + + def _lineTo(self, pt): + if self.filterDoubles: + if pt == self.currentPt: + return + self.otherPen.lineTo(pt) + self.currentPt = pt + return + + def _curveToOne(self, pt1, pt2, pt3): + falseCurve = (pt1 == self.currentPt) and (pt2 == pt3) + if falseCurve: + self._lineTo(pt3) + return + step = 1.0 / self.steps + for factor in range(1, self.steps + 1): + pt = getCubicPoint(factor * step, self.currentPt, pt1, pt2, pt3) + self.otherPen.lineTo(pt) + self.currentPt = pt3 + + def _qCurveToOne(self, pt1, pt2): + falseCurve = (pt1 == self.currentPt) or (pt1 == pt2) + if falseCurve: + self._lineTo(pt2) + return + step = 1.0 / self.steps + for factor in range(1, self.steps + 1): + pt = getQuadraticPoint(factor * step, self.currentPt, pt1, pt2) + self.otherPen.lineTo(pt) + self.currentPt = pt2 + + def _closePath(self): + self.lineTo(self.firstPt) + self.otherPen.closePath() + self.currentPt = None + + def _endPath(self): + self.otherPen.endPath() + self.currentPt = None + + def addComponent(self, glyphName, transformation): + self.otherPen.addComponent(glyphName, transformation) + + +def samplingGlyph(aGlyph, steps=10): + """ + Convenience function that applies the **SamplingPen** pen to a glyph in place. + """ + if len(aGlyph) == 0: + return aGlyph + from fontTools.pens.recordingPen import RecordingPen + recorder = RecordingPen() + filterpen = SamplingPen(recorder, steps=steps) + aGlyph.draw(filterpen) + aGlyph.clear() + recorder.replay(aGlyph.getPen()) + return aGlyph + # ========= # = tests = # ========= def _makeTestGlyph(): # make a simple glyph that we can test the pens with. - from fontParts.nonelab import RGlyph + from fontParts.fontshell import RGlyph testGlyph = RGlyph() testGlyph.name = "testGlyph" testGlyph.width = 500 @@ -168,6 +249,61 @@ """ +def _makeTestGlyphWithCurve(): + # make a simple glyph that we can test the pens with. + from fontParts.fontshell import RGlyph + testGlyph = RGlyph() + testGlyph.name = "testGlyph" + testGlyph.width = 500 + pen = testGlyph.getPen() + pen.moveTo((84, 37)) + pen.lineTo((348, 37)) + pen.lineTo((348, 300)) + pen.curveTo((265, 350.0), (177, 350.0), (84, 300)) + pen.closePath() + return testGlyph + + +def _testFlattenPen(): + """ + >>> from fontPens.printPen import PrintPen + >>> glyph = _makeTestGlyphWithCurve() + >>> pen = SamplingPen(PrintPen(), steps=2) + >>> glyph.draw(pen) + pen.moveTo((84, 37)) + pen.lineTo((348, 37)) + pen.lineTo((348, 300)) + pen.lineTo((219.75, 337.5)) + pen.lineTo((84, 300)) + pen.lineTo((84, 37)) + pen.closePath() + + """ + + +def _testFlattenGlyph(): + """ + >>> from fontPens.printPen import PrintPen + >>> glyph = _makeTestGlyphWithCurve() + >>> samplingGlyph(glyph) #doctest: +ELLIPSIS + >> glyph.draw(PrintPen()) + pen.moveTo((84, 37)) + pen.lineTo((348, 37)) + pen.lineTo((348, 300)) + pen.lineTo((322.95, 313.5)) + pen.lineTo((297.6, 324.0)) + pen.lineTo((271.95, 331.5)) + pen.lineTo((246.0, 336.0)) + pen.lineTo((219.75, 337.5)) + pen.lineTo((193.19999999999996, 336.0)) + pen.lineTo((166.35, 331.5)) + pen.lineTo((139.2, 324.0)) + pen.lineTo((111.75, 313.5)) + pen.lineTo((84, 300)) + pen.closePath() + """ + if __name__ == "__main__": import doctest doctest.testmod() diff -Nru fontpens-0.1.0/Lib/fontPens/guessSmoothPointPen.py fontpens-0.2.4/Lib/fontPens/guessSmoothPointPen.py --- fontpens-0.1.0/Lib/fontPens/guessSmoothPointPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/guessSmoothPointPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -1,7 +1,7 @@ from __future__ import absolute_import, print_function, division import math -from ufoLib.pointPen import AbstractPointPen +from fontTools.pens.pointPen import AbstractPointPen class GuessSmoothPointPen(AbstractPointPen): diff -Nru fontpens-0.1.0/Lib/fontPens/__init__.py fontpens-0.2.4/Lib/fontPens/__init__.py --- fontpens-0.1.0/Lib/fontPens/__init__.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/__init__.py 2018-12-15 18:52:53.000000000 +0000 @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.2.4" diff -Nru fontpens-0.1.0/Lib/fontPens/marginPen.py fontpens-0.2.4/Lib/fontPens/marginPen.py --- fontpens-0.1.0/Lib/fontPens/marginPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/marginPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -142,7 +142,7 @@ def _makeTestGlyph(): # make a simple glyph that we can test the pens with. - from fontParts.nonelab import RGlyph + from fontParts.fontshell import RGlyph testGlyph = RGlyph() testGlyph.name = "testGlyph" testGlyph.width = 1000 diff -Nru fontpens-0.1.0/Lib/fontPens/printPen.py fontpens-0.2.4/Lib/fontPens/printPen.py --- fontpens-0.1.0/Lib/fontPens/printPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/printPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -10,16 +10,18 @@ """ def moveTo(self, pt): - print("pen.moveTo(%s)" % (pt,)) + print("pen.moveTo(%s)" % (tuple(pt),)) def lineTo(self, pt): - print("pen.lineTo(%s)" % (pt,)) + print("pen.lineTo(%s)" % (tuple(pt),)) def curveTo(self, *pts): - print("pen.curveTo%s" % (pts,)) + args = self._pointArgsRepr(pts) + print("pen.curveTo(%s)" % args) def qCurveTo(self, *pts): - print("pen.qCurveTo%s" % (pts,)) + args = self._pointArgsRepr(pts) + print("pen.qCurveTo(%s)" % args) def closePath(self): print("pen.closePath()") @@ -30,6 +32,10 @@ def addComponent(self, baseGlyphName, transformation): print("pen.addComponent('%s', %s)" % (baseGlyphName, tuple(transformation))) + @staticmethod + def _pointArgsRepr(pts): + return ", ".join("None" if pt is None else str(tuple(pt)) for pt in pts) + def _testPrintPen(): """ @@ -42,12 +48,44 @@ pen.curveTo((1, 1), (2, 2), (3, 3)) >>> pen.qCurveTo((4, 4), (5, 5)) pen.qCurveTo((4, 4), (5, 5)) + >>> pen.qCurveTo((6, 6)) + pen.qCurveTo((6, 6)) >>> pen.closePath() pen.closePath() >>> pen.endPath() pen.endPath() >>> pen.addComponent("a", (1, 0, 0, 1, 10, 10)) pen.addComponent('a', (1, 0, 0, 1, 10, 10)) + >>> pen.curveTo((1, 1), (2, 2), (3, 3), None) + pen.curveTo((1, 1), (2, 2), (3, 3), None) + >>> pen.qCurveTo((1, 1), (2, 2), (3, 3), None) + pen.qCurveTo((1, 1), (2, 2), (3, 3), None) + """ + + +def _testPrintPen_nonTuplePoints(): + """ + >>> pen = PrintPen() + >>> pen.moveTo([10, 10]) + pen.moveTo((10, 10)) + >>> pen.lineTo([20, 20]) + pen.lineTo((20, 20)) + >>> pen.curveTo([1, 1], [2, 2], [3, 3]) + pen.curveTo((1, 1), (2, 2), (3, 3)) + >>> pen.qCurveTo([4, 4], [5, 5]) + pen.qCurveTo((4, 4), (5, 5)) + >>> pen.qCurveTo([6, 6]) + pen.qCurveTo((6, 6)) + >>> pen.closePath() + pen.closePath() + >>> pen.endPath() + pen.endPath() + >>> pen.addComponent("a", [1, 0, 0, 1, 10, 10]) + pen.addComponent('a', (1, 0, 0, 1, 10, 10)) + >>> pen.curveTo([1, 1], [2, 2], [3, 3], None) + pen.curveTo((1, 1), (2, 2), (3, 3), None) + >>> pen.qCurveTo([1, 1], [2, 2], [3, 3], None) + pen.qCurveTo((1, 1), (2, 2), (3, 3), None) """ diff -Nru fontpens-0.1.0/Lib/fontPens/printPointPen.py fontpens-0.2.4/Lib/fontPens/printPointPen.py --- fontpens-0.1.0/Lib/fontPens/printPointPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/printPointPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -1,7 +1,7 @@ from __future__ import absolute_import, print_function, division from fontTools.misc.py23 import * -from ufoLib.pointPen import AbstractPointPen +from fontTools.pens.pointPen import AbstractPointPen class PrintPointPen(AbstractPointPen): diff -Nru fontpens-0.1.0/Lib/fontPens/recordingPointPen.py fontpens-0.2.4/Lib/fontPens/recordingPointPen.py --- fontpens-0.1.0/Lib/fontPens/recordingPointPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/recordingPointPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -1,6 +1,6 @@ from __future__ import absolute_import, print_function, division -from ufoLib.pointPen import AbstractPointPen +from fontTools.pens.pointPen import AbstractPointPen def replayRecording(recording, pen): @@ -42,9 +42,9 @@ >>> pen.beginPath() >>> pen.addPoint((100, 200), smooth=False, segmentType="line") >>> pen.endPath() - >>> pen.beginPath() + >>> pen.beginPath(identifier="my_path_id") >>> pen.addPoint((200, 300), segmentType="line") - >>> pen.addPoint((200, 400), segmentType="line") + >>> pen.addPoint((200, 400), segmentType="line", identifier="my_point_id") >>> pen.endPath() >>> pen2 = RecordingPointPen() >>> pen.replay(pen2) @@ -54,9 +54,9 @@ pen.beginPath() pen.addPoint((100, 200), segmentType='line') pen.endPath() - pen.beginPath() + pen.beginPath(identifier='my_path_id') pen.addPoint((200, 300), segmentType='line') - pen.addPoint((200, 400), segmentType='line') + pen.addPoint((200, 400), segmentType='line', identifier='my_point_id') pen.endPath() """ diff -Nru fontpens-0.1.0/Lib/fontPens/thresholdPen.py fontpens-0.2.4/Lib/fontPens/thresholdPen.py --- fontpens-0.1.0/Lib/fontPens/thresholdPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/thresholdPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -66,7 +66,7 @@ def _makeTestGlyph(): # make a simple glyph that we can test the pens with. - from fontParts.nonelab import RGlyph + from fontParts.fontshell import RGlyph testGlyph = RGlyph() testGlyph.name = "testGlyph" testGlyph.width = 1000 diff -Nru fontpens-0.1.0/Lib/fontPens/thresholdPointPen.py fontpens-0.2.4/Lib/fontPens/thresholdPointPen.py --- fontpens-0.1.0/Lib/fontPens/thresholdPointPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/thresholdPointPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -1,6 +1,6 @@ from __future__ import absolute_import, print_function, division -from ufoLib.pointPen import AbstractPointPen +from fontTools.pens.pointPen import AbstractPointPen from fontPens.penTools import distance @@ -74,7 +74,7 @@ def _makeTestGlyph(): # make a simple glyph that we can test the pens with. - from fontParts.nonelab import RGlyph + from fontParts.fontshell import RGlyph testGlyph = RGlyph() testGlyph.name = "testGlyph" testGlyph.width = 1000 diff -Nru fontpens-0.1.0/Lib/fontPens/transformPointPen.py fontpens-0.2.4/Lib/fontPens/transformPointPen.py --- fontpens-0.1.0/Lib/fontPens/transformPointPen.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/Lib/fontPens/transformPointPen.py 2018-12-15 18:52:53.000000000 +0000 @@ -1,6 +1,6 @@ from __future__ import absolute_import, print_function, division -from ufoLib.pointPen import AbstractPointPen +from fontTools.pens.pointPen import AbstractPointPen class TransformPointPen(AbstractPointPen): @@ -49,4 +49,4 @@ if __name__ == "__main__": import doctest - doctest.testmod() \ No newline at end of file + doctest.testmod() diff -Nru fontpens-0.1.0/README.rst fontpens-0.2.4/README.rst --- fontpens-0.1.0/README.rst 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/README.rst 2018-12-15 18:52:53.000000000 +0000 @@ -1,4 +1,16 @@ +|Build Status| |Coverage| |PyPI| |Versions| + fontPens -------- A collection of classes implementing the pen protocol for manipulating glyphs. + + +.. |Build Status| image:: https://travis-ci.org/robofab-developers/fontPens.svg?branch=master + :target: https://travis-ci.org/robofab-developers/fontPens +.. |PyPI| image:: https://img.shields.io/pypi/v/fontPens.svg + :target: https://pypi.org/project/fontPens +.. |Versions| image:: https://img.shields.io/badge/python-2.7%2C%203.7-blue.svg + :alt: Python Versions +.. |Coverage| image:: https://codecov.io/gh/robofab-developers/fontPens/branch/master/graph/badge.svg + :target: https://codecov.io/gh/robofab-developers/fontPens diff -Nru fontpens-0.1.0/requirements.txt fontpens-0.2.4/requirements.txt --- fontpens-0.1.0/requirements.txt 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/requirements.txt 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1 @@ +FontTools>=3.32.0 diff -Nru fontpens-0.1.0/setup.cfg fontpens-0.2.4/setup.cfg --- fontpens-0.1.0/setup.cfg 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/setup.cfg 2018-12-15 18:52:53.000000000 +0000 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.0 +current_version = 0.2.4 commit = True tag = False tag_name = v{new_version} @@ -41,10 +41,7 @@ testpaths = Lib/fontPens addopts = - # run py.test in verbose mode -v - # show extra test summary info -r a - # run doctests in all .py modules --doctest-modules diff -Nru fontpens-0.1.0/setup.py fontpens-0.2.4/setup.py --- fontpens-0.1.0/setup.py 2018-02-01 17:48:36.000000000 +0000 +++ fontpens-0.2.4/setup.py 2018-12-15 18:52:53.000000000 +0000 @@ -143,7 +143,7 @@ setup_params = dict( name="fontPens", - version="0.1.0", + version="0.2.4", description=("A collection of classes implementing the pen " "protocol for manipulating glyphs."), author="Just van Rossum, Tal Leming, Erik van Blokland, others", @@ -160,10 +160,10 @@ setup_requires=pytest_runner + wheel + bump2version, tests_require=[ 'pytest', + 'fontParts>=0.8.1' ], install_requires=[ - "fonttools>=3.20.0", - "ufoLib>=2.0", + "FontTools>=3.32.0", ], cmdclass={ "release": release, diff -Nru fontpens-0.1.0/tox.ini fontpens-0.2.4/tox.ini --- fontpens-0.1.0/tox.ini 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/tox.ini 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,64 @@ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py{27,36,37}-cov, py{py}-nocov, htmlcov + +[testenv] +deps = + cov: coverage>=4.3 + pytest + fontparts>=0.8.1 + FontTools[ufo,lxml,unicode]>=3.32.0 +install_command = + pip install -v {opts} {packages} +commands = + cov: coverage run --parallel-mode -m pytest {posargs} + nocov: pytest {posargs} + +[testenv:htmlcov] +basepython = {env:TOXPYTHON:python3.6} +deps = + coverage>=4.3 +skip_install = true +commands = + coverage combine + coverage html + +[testenv:codecov] +passenv = * +basepython = {env:TOXPYTHON:python} +deps = + coverage>=4.3 + codecov +skip_install = true +ignore_outcome = true +commands = + coverage combine + codecov --env TOXENV + +[testenv:bdist] +basepython = {env:TOXPYTHON:python3.6} +deps = + pygments + docutils + setuptools + wheel +skip_install = true +install_command = + # make sure we use the latest setuptools and wheel + pip install --upgrade {opts} {packages} +whitelist_externals = + rm +commands = + # check metadata and rst long_description + python setup.py check --restructuredtext --strict + # clean up build/ and dist/ folders + rm -rf {toxinidir}/dist + python setup.py clean --all + # build sdist + python setup.py sdist --dist-dir {toxinidir}/dist + # build wheel from sdist + pip wheel -v --no-deps --no-index --wheel-dir {toxinidir}/dist --find-links {toxinidir}/dist fontPens diff -Nru fontpens-0.1.0/.travis/after_success.sh fontpens-0.2.4/.travis/after_success.sh --- fontpens-0.1.0/.travis/after_success.sh 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.travis/after_success.sh 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e +set -x + +if [ "$TRAVIS_OS_NAME" == "osx" ]; then + source .venv/bin/activate +fi + +# upload coverage data to Codecov.io +[[ ${TOXENV} == *"-cov"* ]] && tox -e codecov diff -Nru fontpens-0.1.0/.travis/before_deploy.sh fontpens-0.2.4/.travis/before_deploy.sh --- fontpens-0.1.0/.travis/before_deploy.sh 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.travis/before_deploy.sh 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e +set -x + +# build sdist and wheel distribution packages in ./dist folder. +# Travis runs the `before_deploy` stage before each deployment, but +# we only want to build them once, as we want to use the same +# files for both Github and PyPI +if $(ls ./dist/fontPens*.zip > /dev/null 2>&1) && \ + $(ls ./dist/fontPens*.whl > /dev/null 2>&1); then + echo "Distribution packages already exists; skipping" +else + tox -e bdist +fi diff -Nru fontpens-0.1.0/.travis/before_install.sh fontpens-0.2.4/.travis/before_install.sh --- fontpens-0.1.0/.travis/before_install.sh 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.travis/before_install.sh 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,6 @@ +#!/bin/bash + +if [[ -n "$PYENV_VERSION" ]]; then + wget https://github.com/praekeltfoundation/travis-pyenv/releases/download/${TRAVIS_PYENV_VERSION}/setup-pyenv.sh + source setup-pyenv.sh +fi diff -Nru fontpens-0.1.0/.travis/install.sh fontpens-0.2.4/.travis/install.sh --- fontpens-0.1.0/.travis/install.sh 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.travis/install.sh 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e +set -x + +ci_requirements="pip setuptools tox" + +if [ "$TRAVIS_OS_NAME" == "osx" ]; then + if [[ ${TOXENV} == *"py27"* ]]; then + # install pip on the system python + curl -O https://bootstrap.pypa.io/get-pip.py + python get-pip.py --user + # install virtualenv and create virtual environment + python -m pip install --user virtualenv + python -m virtualenv .venv/ + elif [[ ${TOXENV} == *"py3"* ]]; then + # install current python3 with homebrew + # NOTE: the formula is now named just "python" + brew install python + command -v python3 + python3 --version + python3 -m pip install virtualenv + python3 -m virtualenv .venv/ + else + echo "unsupported $TOXENV: "${TOXENV} + exit 1 + fi + # activate virtual environment + source .venv/bin/activate +fi + +python -m pip install $ci_requirements diff -Nru fontpens-0.1.0/.travis/run.sh fontpens-0.2.4/.travis/run.sh --- fontpens-0.1.0/.travis/run.sh 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.travis/run.sh 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e +set -x + +if [ "$TRAVIS_OS_NAME" == "osx" ]; then + source .venv/bin/activate +fi + +tox diff -Nru fontpens-0.1.0/.travis.yml fontpens-0.2.4/.travis.yml --- fontpens-0.1.0/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ fontpens-0.2.4/.travis.yml 2018-12-15 18:52:53.000000000 +0000 @@ -0,0 +1,97 @@ +sudo: false + +language: python +python: 3.6 + +# empty "env:" is needed for 'allow_failures' +# https://docs.travis-ci.com/user/customizing-the-build/#Rows-that-are-Allowed-to-Fail +env: + +matrix: + fast_finish: true + exclude: + - python: 3.6 + include: + - python: 2.7 + env: TOXENV=py27-cov + - python: 3.6 + env: + - TOXENV=py36-cov + - BUILD_DIST=true + - python: 3.7 + env: TOXENV=py37-cov + dist: xenial + sudo: true + - python: pypy + env: TOXENV=pypy-nocov + - language: generic + os: osx + env: TOXENV=py27-cov + - language: generic + os: osx + env: + - TOXENV=py3-cov + - HOMEBREW_NO_AUTO_UPDATE=1 + - env: + - TOXENV=py27-nocov + - PYENV_VERSION='2.7.6' + - PYENV_VERSION_STRING='Python 2.7.6' + - PYENV_ROOT=$HOME/.travis-pyenv + - TRAVIS_PYENV_VERSION='0.4.0' + allow_failures: + # We use fast_finish + allow_failures because OSX builds take forever + # https://blog.travis-ci.com/2013-11-27-fast-finishing-builds + - language: generic + os: osx + env: TOXENV=py27-cov + - language: generic + os: osx + env: + - TOXENV=py3-cov + - HOMEBREW_NO_AUTO_UPDATE=1 + +cache: + - pip + - directories: + - $HOME/.pyenv_cache + +before_install: + - source ./.travis/before_install.sh + +install: + - ./.travis/install.sh + +script: + - ./.travis/run.sh + +after_success: + - ./.travis/after_success.sh + +before_deploy: + - ./.travis/before_deploy.sh + +deploy: + # deploy to Github Releases on tags + - provider: releases + api_key: + secure: Kdf6HnU4mm0UK+yd+ywpN87IcUbhQ2ShjEMwenIBnrvBd2tD1hzHWrfKJVpSnVBy8QEtOcEqdRsSL4NGq/3qgp5cAxkf8hLtNChaVACeQsmQA8SLauipFPukCtkrpNdOlSDZLNHoGcIcVVPyTEkLVUpt68BxBpX8M859pA9KZ7KqFnAQFiCH06Qi5NZNHYzFBFeEcpFZyeo+3BAMEMWNfHRfkebC7BIim4de79tCui7F3C54vcGug/CuGKGU8Pbd7nfYXwEtibCDV9uOKF+kW5m7923fAvhJILrzDe3/C9KjaqtH/HQiiTNMlJ1TK1R9rodP3UUu2fN0oPpe/bMQvJUzllHMeHRB4luuaYMriRDtcCmZwCCOFeeHo3QxK8zfjv/v1lcVivPuhJiFXvx+1mU9ktSnQ5iD9QU0Si97ctJPypLaUeZq1WoluaKDv8Yw0Lmq7mZPo+rByikcGwTX7nx/LJYGlw9gtIdXSLVpsglPilM+2jVDOo7h+8oslD/AKs1S3ujDAFOeogL3SylSyswDHr4GLQMZBf/NrPBQHJge3uMYaldwKcT8xzu3LpkyCazYvt4f+Mh3RYfmE06rk86+R3luk5NNHjIJvFm0I4j+I7PtjpQYCnx6vtkH4rR0FBuE2/T0V8BBxp2UbIZF/wztBtV89oiO6yBGOauwkTM= + skip_cleanup: true + file_glob: true + file: "dist/*" + on: + tags: true + repo: robofab-developers/fontPens + all_branches: true + condition: "$BUILD_DIST == true" + # deploy to PyPI on tags + - provider: pypi + user: benkiel + password: + secure: "dQmUNMwDeq7162p3IE3M9d9BW3lfk/chaW8SY605YikW7J56bfT1CQFaOiYumdvMF/eWBrVxbQbdwdupL2sDm1dSgYKWu0ite1jePaoTkMhEKFr+XW7GogcX+LOiFa7FITscnWgV02XwijStbklQmZ2beBe/tjB5Ug/Swx6CVCsTN/j1n0+r3UjtHcsnVgN+XAhpC0+ewoyKkoKP/aalb2gGFwsRDh2SzJZ/sOICHmmjJUGDB6/vS8tGgnI1arDSpSH7KDNB1dVAfDvjK9yXFEDPkYO5vEU//vZWP9yKTqXPmDiv+SMg959UcdgCUnNPSv44/VDtqv9kNhG4t3Ye4bjV/WBnyZ3SiWF8XHI+r3nk6x6Swjhq8ZRPk861JhDPK67kCJHdmMjOfaKy+MoTWscDqLlzxxAABSv+HkgQ3LiHKqBbvJVBbuhbmFdo8qtmZXKl4z8LlUcTHskMAioEMbueKRW/+jEDN5xm0h7c4W2mfHyrnn3Td5hWpmXZKe7ZKqbU8koBruGJpnC6miE689nO6HLpQbW8AjYy6ZOkz4HbkZCAYh0NqYe7qwgFKx8+iYy5smWyiqAS7A4D1kyFzaXV5jEe87jddDc/wMofgcKSUBOGe9eM/w4FKVRCW8jAMkjMiZKVMzHE2f9nk9q4A8bU++Da/AgIw3JKOVnWAPg=" + skip_cleanup: true + distributions: "sdist bdist_wheel" + on: + tags: true + repo: robofab-developers/fontPens + all_branches: true + condition: "$BUILD_DIST == true"