Skip to content

Commit 4a1245a

Browse files
set minimum python version to 3.8
a bit of formatting cleanup
1 parent 7046874 commit 4a1245a

File tree

7 files changed

+142
-80
lines changed

7 files changed

+142
-80
lines changed

conda_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
python>=3.6
1+
python>=3.8
22
cython
33
numpy
44
libgd

py_gd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414
import os
1515

16-
__version__ = "2.0.0"
16+
__version__ = "2.0.1"
1717

1818
if sys.platform.startswith('win'):
1919
# This only works for Anaconda / miniconda

py_gd/_cm_listed.py

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,52 @@
11
"""
22
Colormap data borrowed from matplotlib
33
4-
1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and otherwise using matplotlib software in source or binary form and its associated documentation.
4+
1. This LICENSE AGREEMENT is between the Matplotlib Development Team
5+
("MDT"), and the Individual or Organization ("Licensee") accessing and
6+
otherwise using matplotlib software in source or binary form and its
7+
associated documentation.
58
6-
2. Subject to the terms and conditions of this License Agreement, MDT hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 3.2.2 alone or in any derivative version, provided, however, that MDT's License Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012-2013 Matplotlib Development Team; All Rights Reserved" are retained in matplotlib 3.2.2 alone or in any derivative version prepared by Licensee.
9+
2. Subject to the terms and conditions of this License Agreement, MDT
10+
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
11+
to reproduce, analyze, test, perform and/or display publicly, prepare
12+
derivative works, distribute, and otherwise use matplotlib 3.2.2 alone
13+
or in any derivative version, provided, however, that MDT's License
14+
Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012-2013
15+
Matplotlib Development Team; All Rights Reserved" are retained in
16+
matplotlib 3.2.2 alone or in any derivative version prepared by
17+
Licensee.
718
8-
3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 3.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 3.2.2.
19+
3. In the event Licensee prepares a derivative work that is based on or
20+
incorporates matplotlib 3.2.2 or any part thereof, and wants to make
21+
the derivative work available to others as provided herein, then
22+
Licensee hereby agrees to include in any such work a brief summary of
23+
the changes made to matplotlib 3.2.2.
924
10-
4. MDT is making matplotlib 3.2.2 available to Licensee on an "AS IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 3.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
25+
4. MDT is making matplotlib 3.2.2 available to Licensee on an "AS IS"
26+
basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
27+
BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY
28+
REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
29+
PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 3.2.2 WILL NOT
30+
INFRINGE ANY THIRD PARTY RIGHTS.
1131
12-
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 3.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 3.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
32+
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
33+
3.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
34+
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB
35+
3.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY
36+
THEREOF.
1337
14-
6. This License Agreement will automatically terminate upon a material breach of its terms and conditions.
38+
6. This License Agreement will automatically terminate upon a material
39+
breach of its terms and conditions.
1540
16-
7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between MDT and Licensee. This License Agreement does not grant permission to use MDT trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party.
41+
7. Nothing in this License Agreement shall be deemed to create any
42+
relationship of agency, partnership, or joint venture between MDT and
43+
Licensee. This License Agreement does not grant permission to use MDT
44+
trademarks or trade name in a trademark sense to endorse or promote
45+
products or services of Licensee, or any third party.
1746
18-
8. By copying, installing or otherwise using matplotlib 3.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement.
47+
8. By copying, installing or otherwise using matplotlib 3.2.2, Licensee
48+
agrees to be bound by the terms and conditions of this License
49+
Agreement.
1950
"""
2051

2152

py_gd/_color_data.py

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,52 @@
11
"""
22
named color data borrowed from matplotlib
33
4-
1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and otherwise using matplotlib software in source or binary form and its associated documentation.
4+
1. This LICENSE AGREEMENT is between the Matplotlib Development Team
5+
("MDT"), and the Individual or Organization ("Licensee") accessing and
6+
otherwise using matplotlib software in source or binary form and its
7+
associated documentation.
58
6-
2. Subject to the terms and conditions of this License Agreement, MDT hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 3.2.2 alone or in any derivative version, provided, however, that MDT's License Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012-2013 Matplotlib Development Team; All Rights Reserved" are retained in matplotlib 3.2.2 alone or in any derivative version prepared by Licensee.
9+
2. Subject to the terms and conditions of this License Agreement, MDT
10+
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
11+
to reproduce, analyze, test, perform and/or display publicly, prepare
12+
derivative works, distribute, and otherwise use matplotlib 3.2.2 alone
13+
or in any derivative version, provided, however, that MDT's License
14+
Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012-2013
15+
Matplotlib Development Team; All Rights Reserved" are retained in
16+
matplotlib 3.2.2 alone or in any derivative version prepared by
17+
Licensee.
718
8-
3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 3.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 3.2.2.
19+
3. In the event Licensee prepares a derivative work that is based on or
20+
incorporates matplotlib 3.2.2 or any part thereof, and wants to make
21+
the derivative work available to others as provided herein, then
22+
Licensee hereby agrees to include in any such work a brief summary of
23+
the changes made to matplotlib 3.2.2.
924
10-
4. MDT is making matplotlib 3.2.2 available to Licensee on an "AS IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 3.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
25+
4. MDT is making matplotlib 3.2.2 available to Licensee on an "AS IS"
26+
basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
27+
BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY
28+
REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
29+
PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 3.2.2 WILL NOT
30+
INFRINGE ANY THIRD PARTY RIGHTS.
1131
12-
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 3.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 3.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
32+
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
33+
3.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
34+
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB
35+
3.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY
36+
THEREOF.
1337
14-
6. This License Agreement will automatically terminate upon a material breach of its terms and conditions.
38+
6. This License Agreement will automatically terminate upon a material
39+
breach of its terms and conditions.
1540
16-
7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between MDT and Licensee. This License Agreement does not grant permission to use MDT trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party.
41+
7. Nothing in this License Agreement shall be deemed to create any
42+
relationship of agency, partnership, or joint venture between MDT and
43+
Licensee. This License Agreement does not grant permission to use MDT
44+
trademarks or trade name in a trademark sense to endorse or promote
45+
products or services of Licensee, or any third party.
1746
18-
8. By copying, installing or otherwise using matplotlib 3.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement.
47+
8. By copying, installing or otherwise using matplotlib 3.2.2, Licensee
48+
agrees to be bound by the terms and conditions of this License
49+
Agreement.
1950
"""
2051

2152

py_gd/colors.py

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,55 @@
33
44
Assorted colormaps you can use with py_gd
55
6-
These have (so far) been borrowed from the Matplotlib project, so are licensed as MPL is:
7-
8-
1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and otherwise using matplotlib software in source or binary form and its associated documentation.
9-
10-
2. Subject to the terms and conditions of this License Agreement, MDT hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 3.2.2 alone or in any derivative version, provided, however, that MDT's License Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012-2013 Matplotlib Development Team; All Rights Reserved" are retained in matplotlib 3.2.2 alone or in any derivative version prepared by Licensee.
11-
12-
3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 3.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 3.2.2.
13-
14-
4. MDT is making matplotlib 3.2.2 available to Licensee on an "AS IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 3.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
15-
16-
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 3.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 3.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
17-
18-
6. This License Agreement will automatically terminate upon a material breach of its terms and conditions.
19-
20-
7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between MDT and Licensee. This License Agreement does not grant permission to use MDT trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party.
21-
22-
8. By copying, installing or otherwise using matplotlib 3.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement.
6+
These have (so far) been borrowed from the Matplotlib project, so are
7+
licensed as MPL is:
8+
9+
1. This LICENSE AGREEMENT is between the Matplotlib Development Team
10+
("MDT"), and the Individual or Organization ("Licensee") accessing and
11+
otherwise using matplotlib software in source or binary form and its
12+
associated documentation.
13+
14+
2. Subject to the terms and conditions of this License Agreement, MDT
15+
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
16+
to reproduce, analyze, test, perform and/or display publicly, prepare
17+
derivative works, distribute, and otherwise use matplotlib 3.2.2 alone
18+
or in any derivative version, provided, however, that MDT's License
19+
Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012-2013
20+
Matplotlib Development Team; All Rights Reserved" are retained in
21+
matplotlib 3.2.2 alone or in any derivative version prepared by
22+
Licensee.
23+
24+
3. In the event Licensee prepares a derivative work that is based on or
25+
incorporates matplotlib 3.2.2 or any part thereof, and wants to make
26+
the derivative work available to others as provided herein, then
27+
Licensee hereby agrees to include in any such work a brief summary of
28+
the changes made to matplotlib 3.2.2.
29+
30+
4. MDT is making matplotlib 3.2.2 available to Licensee on an "AS IS"
31+
basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
32+
BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY
33+
REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
34+
PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 3.2.2 WILL NOT
35+
INFRINGE ANY THIRD PARTY RIGHTS.
36+
37+
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
38+
3.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
39+
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB
40+
3.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY
41+
THEREOF.
42+
43+
6. This License Agreement will automatically terminate upon a material
44+
breach of its terms and conditions.
45+
46+
7. Nothing in this License Agreement shall be deemed to create any
47+
relationship of agency, partnership, or joint venture between MDT and
48+
Licensee. This License Agreement does not grant permission to use MDT
49+
trademarks or trade name in a trademark sense to endorse or promote
50+
products or services of Licensee, or any third party.
51+
52+
8. By copying, installing or otherwise using matplotlib 3.2.2, Licensee
53+
agrees to be bound by the terms and conditions of this License
54+
Agreement.
2355
"""
2456

2557
from itertools import islice

py_gd/py_gd.pyx

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ Cython wrapper around the gd drawing lib
44
Provides an OO interface -- at least to the limited functionality wrapped
55
66
NOTE: pixel coordinates are defined as c ints -- if you pass in values
7-
larger than a c int can take (usually +- 2**31 - 1), it will overflow,
7+
larger than a c int can take (usually ~ 2**31 - 1), it will overflow,
88
and who knows what you'll get.
99
"""
1010

11-
#cython: language_level=3
12-
1311
import cython
1412
from cython cimport view
1513

@@ -30,30 +28,10 @@ from py_gd.colors import colorschemes
3028
__gd_version__ = gdVersionString().decode('ascii')
3129

3230

33-
# transparent_colors = [('transparent', (0, 0, 0, 127))]
34-
35-
# BW_colors = transparent_colors + [('black', (0, 0, 0)),
36-
# ('white', (255, 255, 255))]
37-
38-
# web_colors = BW_colors + [('silver', (191, 191, 191)),
39-
# ('gray', (127, 127, 127)),
40-
# ('red', (255, 0, 0)),
41-
# ('maroon', (127, 0, 0)),
42-
# ('yellow', (255, 255, 0)),
43-
# ('olive', (127, 127, 0)),
44-
# ('lime', (0, 255, 0)),
45-
# ('green', (0, 127, 0)),
46-
# ('aqua', (0, 255, 255)),
47-
# ('teal', (0, 127, 127)),
48-
# ('blue', (0, 0, 255)),
49-
# ('navy', (0, 0, 127)),
50-
# ('fuchsia', (255, 0, 255)),
51-
# ('purple', (127, 0, 127))]
52-
53-
# note that the 1GB max is arbitrary -- you can change it after import,
54-
# before initializing an Image. On my system going bigger than this brings
55-
# the system to an almost halt before raising a memory error, so I set
56-
# a limit here.
31+
# Note that the default 1GB max is arbitrary -- you can change it after
32+
# import, before initializing an Image. On my system (as of 2012 or
33+
# so)going bigger than this brings the system to an almost halt before
34+
# raising a memory error, so I set a limit here.
5735

5836
MAX_IMAGE_SIZE = 2 ** 30 # 1 GB limit
5937

setup.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,16 @@
44
setup.py script for the py_gd package
55
66
Tested with:
7-
Anaconda on OS_X
8-
Anaconda on Win64
7+
conda (with conda-forge libgd) on OS_X
98
10-
Python 2.7.5 on CentOS 7
11-
Python 2.7.10
9+
On Windows, MacOS and Linux (CentoOS 7)
1210
1311
libgd is assumed to be installed (and its dependencies) already.
14-
The Anaconda package at:
15-
http://anaconda.org/noaa-orr-erd/libgd
16-
is a good way to get it
12+
The conda package on conda-forge is a good way to get it:
1713
18-
"""
14+
https://anaconda.org/conda-forge/libgd
1915
20-
# it seems some build systems may run this wtih py3, even for a py2 build
21-
from __future__ import print_function
16+
"""
2217

2318
import sys
2419
import os
@@ -102,7 +97,7 @@ def run(self):
10297

10398
# This setup requires libgd and its dependent libs
10499
# It expects to find them in the "usual" locations
105-
# or where Anaconda put it...
100+
# or where conda puts it...
106101

107102
ext_modules = [Extension("py_gd.py_gd",
108103
["py_gd/py_gd.pyx"],
@@ -113,16 +108,10 @@ def run(self):
113108
extra_link_args=link_args,
114109
)]
115110

116-
# py_ver = sys.version_info[0]
117-
# ext_modules = cythonize(
118-
# ext_modules,
119-
# compiler_directives={'language_level': py_ver})
120-
121111
ext_modules = cythonize(
122112
ext_modules,
123113
compiler_directives={'language_level': 3})
124114

125-
126115
def get_version():
127116
"""
128117
get version from __init__.py
@@ -148,13 +137,14 @@ def get_version():
148137
ext_modules=cythonize(ext_modules),
149138
zip_safe=False, # dont want a compiled extension in a zipfile...
150139
packages=['py_gd', 'py_gd.test'],
140+
python_requires='>=3.8',
151141
classifiers=["Development Status :: 2 - Pre-Alpha",
152142
"Topic :: Utilities",
153143
"License :: Public Domain",
154144
"Intended Audience :: Developers",
155145
"Operating System :: OS Independent",
156146
"Programming Language :: Cython",
157-
"Programming Language :: Python :: 2 :: Only",
147+
"Programming Language :: Python :: 3 :: Only",
158148
"Programming Language :: Python :: Implementation :: CPython",
159149
"Topic :: Multimedia :: Graphics",
160150
],

0 commit comments

Comments
 (0)