Skip to content

Commit d9e7077

Browse files
authored
Merge pull request #58 from madig/update-packaging-py3-only
Make Python 3.6+ only, update packaging boilerplate
2 parents 00e4e2c + 25ffef0 commit d9e7077

File tree

15 files changed

+66
-90
lines changed

15 files changed

+66
-90
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ Lib/booleanOperations.egg-info
1212

1313
.tox/
1414
.cache/
15+
16+
_version.py

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ env:
77

88
matrix:
99
include:
10-
- python: 2.7
1110
- python: 3.6
1211
- python: 3.7
1312
# required to run python3.7 on Travis CI

Lib/booleanOperations/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
from __future__ import print_function, division, absolute_import
21
from .booleanOperationManager import BooleanOperationManager
32
from .exceptions import BooleanOperationsError
4-
from .version import __version__
3+
4+
try:
5+
from ._version import version as __version__
6+
except ImportError:
7+
__version__ = "0.0.0+unknown"
58

69
# export BooleanOperationManager static methods
710
union = BooleanOperationManager.union

Lib/booleanOperations/booleanGlyph.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, division, absolute_import
21
import weakref
32
from copy import deepcopy
43

@@ -61,7 +60,7 @@ def addComponent(self, baseGlyphName, transformation):
6160
self._glyph.components.append((baseGlyphName, transformation))
6261

6362

64-
class BooleanContour(object):
63+
class BooleanContour:
6564

6665
"""
6766
Contour like object.
@@ -107,7 +106,7 @@ def _get_bounds(self):
107106
bounds = property(_get_bounds)
108107

109108

110-
class BooleanGlyph(object):
109+
class BooleanGlyph:
111110

112111
"""
113112
Glyph like object handling boolean operations.

Lib/booleanOperations/booleanOperationManager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, division, absolute_import
21
from .flatten import InputContour, OutputContour
32
from .exceptions import (
43
InvalidSubjectContourError, InvalidClippingContourError, ExecutionError)
@@ -94,7 +93,7 @@ def _performOperation(operation, subjectContours, clipContours, outPen):
9493
return outputContours
9594

9695

97-
class BooleanOperationManager(object):
96+
class BooleanOperationManager:
9897

9998
@staticmethod
10099
def union(contours, outPen):

Lib/booleanOperations/exceptions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import print_function, division, absolute_import
2-
3-
41
class BooleanOperationsError(Exception):
52
"""Base BooleanOperations exception"""
63

Lib/booleanOperations/flatten.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, division, absolute_import
21
import math
32
from fontTools.misc import bezierTools
43
from fontTools.pens.basePen import decomposeQuadraticSegment
@@ -57,7 +56,7 @@
5756

5857
# Input
5958

60-
class InputContour(object):
59+
class InputContour:
6160

6261
def __init__(self, contour):
6362
# gather the point data
@@ -132,7 +131,7 @@ def hasOnCurve(self):
132131
return False
133132

134133

135-
class InputSegment(object):
134+
class InputSegment:
136135

137136
# __slots__ = ["points", "previousOnCurve", "scaledPreviousOnCurve", "flat", "used"]
138137

@@ -257,7 +256,7 @@ def tValueForPoint(self, point):
257256
raise NotImplementedError
258257

259258

260-
class InputPoint(object):
259+
class InputPoint:
261260

262261
__slots__ = ["coordinates", "segmentType", "smooth", "name", "kwargs"]
263262

@@ -283,7 +282,7 @@ def copy(self):
283282
return copy
284283

285284
def __str__(self):
286-
return "%s %s" % (self.segmentType, self.coordinates)
285+
return f"{self.segmentType} {self.coordinates}"
287286

288287
def __repr__(self):
289288
return self.__str__()
@@ -456,7 +455,7 @@ def _convertPointsToSegments(points, willBeReversed=False):
456455
# Output Objects
457456
# --------------
458457

459-
class OutputContour(object):
458+
class OutputContour:
460459

461460
def __init__(self, pointList):
462461
if pointList[0] == pointList[-1]:
@@ -932,7 +931,7 @@ def drawPoints(self, pointPen):
932931
pointPen.endPath()
933932

934933

935-
class OutputSegment(object):
934+
class OutputSegment:
936935

937936
__slots__ = ["segmentType", "points", "final"]
938937

Lib/booleanOperations/version.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,4 @@ List the **anchors** of the glyph.
195195
:target: https://travis-ci.org/typemytype/booleanOperations
196196
.. |PyPI| image:: https://img.shields.io/pypi/v/booleanOperations.svg
197197
:target: https://pypi.org/project/booleanOperations/
198-
.. |Python Versions| image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6-blue.svg
198+
.. |Python Versions| image:: https://img.shields.io/badge/python-3.6,%203.7-blue.svg

appveyor.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
environment:
22
matrix:
3-
- PYTHON: "C:\\Python27"
4-
PYTHON_VERSION: "2.7.x"
5-
PYTHON_ARCH: "32"
6-
73
- PYTHON: "C:\\Python36-x64"
84
PYTHON_VERSION: "3.6.x"
95
PYTHON_ARCH: "64"

0 commit comments

Comments
 (0)