Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Commit f00944c

Browse files
authored
Merge pull request #33 from google/three
Update to version 3.
2 parents 5757edc + b1d299c commit f00944c

File tree

7 files changed

+78
-44
lines changed

7 files changed

+78
-44
lines changed

.circleci/config.yml

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,86 @@ version: 2
22
jobs:
33
Unit Test:
44
docker:
5-
- image: circleci/python:3.7.1
6-
5+
- image: cimg/python:3.10.2
76
steps:
87
- checkout
98
- run:
109
command: |
11-
sudo pip install virtualenv
12-
sudo pip install nox
10+
pip install virtualenv
11+
pip install nox
1312
nox -f noxfile.py -s unit
14-
Compatibility Test:
13+
Compatibility Test 3.10:
1514
docker:
16-
- image: circleci/python:3.7.1
17-
15+
- image: cimg/python:3.10.2
1816
steps:
1917
- checkout
2018
- run:
2119
command: |
22-
sudo pip install virtualenv
23-
sudo pip install nox
20+
pip install virtualenv
21+
pip install nox
22+
nox -f noxfile.py -s compatibility
23+
Compatibility Test 3.9:
24+
docker:
25+
- image: cimg/python:3.9.10
26+
steps:
27+
- checkout
28+
- run:
29+
command: |
30+
pip install virtualenv
31+
pip install nox
32+
nox -f noxfile.py -s compatibility
33+
Compatibility Test 3.8:
34+
docker:
35+
- image: cimg/python:3.8.12
36+
steps:
37+
- checkout
38+
- run:
39+
command: |
40+
pip install virtualenv
41+
pip install nox
42+
nox -f noxfile.py -s compatibility
43+
Compatibility Test 3.7:
44+
docker:
45+
- image: cimg/python:3.7.12
46+
steps:
47+
- checkout
48+
- run:
49+
command: |
50+
pip install virtualenv
51+
pip install nox
2452
nox -f noxfile.py -s compatibility
2553
Lint:
2654
docker:
27-
- image: circleci/python:3.7.1
28-
55+
- image: cimg/python:3.10.2
2956
steps:
3057
- checkout
3158
- run:
3259
command: |
33-
sudo pip install virtualenv
34-
sudo pip install nox
60+
pip install virtualenv
61+
pip install nox
3562
nox -f noxfile.py -s lint
3663
Type Check:
3764
docker:
38-
- image: circleci/python:3.7.1
65+
- image: cimg/python:3.7.12
3966

4067
steps:
4168
- checkout
4269
- run:
4370
command: |
44-
sudo pip install virtualenv
45-
sudo pip install nox
71+
pip install virtualenv
72+
pip install nox
4673
nox -f noxfile.py -s type_check
4774
Release:
4875
docker:
49-
- image: circleci/python:3.7.1
76+
- image: cimg/python:3.10.2
5077

5178
steps:
5279
- checkout
5380
- run:
5481
command: |
55-
sudo pip install --upgrade twine
56-
sudo pip install --upgrade wheel
57-
sudo pip install --upgrade setuptools
82+
pip install --upgrade twine
83+
pip install --upgrade wheel
84+
pip install --upgrade setuptools
5885
source twine_upload.sh
5986
6087
@@ -65,7 +92,10 @@ workflows:
6592
- Lint
6693
- Unit Test
6794
- Type Check
68-
- Compatibility Test
95+
- Compatibility Test 3.10
96+
- Compatibility Test 3.9
97+
- Compatibility Test 3.8
98+
- Compatibility Test 3.7
6999
release:
70100
jobs:
71101
- Release:

noxfile.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""Nox config for running lint and unit tests."""
1515

1616
import nox
17+
import sys
1718

1819

1920
def _run_tests(session):
@@ -28,34 +29,41 @@ def lint(session):
2829
serious code quality issues.
2930
"""
3031
session.install('yapf')
31-
session.run('python3', '-m', 'yapf', '--diff', '-r', '.')
32+
session.run('yapf', '--diff', '-r', '.')
3233

3334

3435
@nox.session
3536
def unit(session):
3637
"""Run the unit test suite."""
3738
session.install('-e', '.[dev]')
38-
session.install('-r', 'server-example/requirements-test.txt')
39+
session.install('flask')
3940
_run_tests(session)
4041

4142

42-
@nox.session(python=['3.4', '3.5', '3.6', '3.7', '3.8'])
43+
@nox.session
4344
@nox.parametrize(
4445
'install',
45-
['Jinja2==2.9.0', 'Pillow==5.0.0', 'requests==2.9.0', 'xmldiff==2.4'])
46+
[
47+
'Jinja2==3.0.0',
48+
'Pillow==8.3.2', # Oldest version that supports Python 3.7 to 3.10.
49+
'requests==2.22.0',
50+
'xmldiff==2.4'
51+
])
4652
def compatibility(session, install):
4753
"""Run the unit test suite with each support library and Python version."""
4854

49-
session.install('-e', '.[dev]')
50-
session.install('-r', 'server-example/requirements-test.txt')
5155
session.install(install)
56+
session.install('-r', 'server-example/requirements-test.txt')
57+
session.install('-e', '.[dev]')
5258
_run_tests(session)
5359

5460

55-
@nox.session(python=['3.6'])
61+
@nox.session(python=['3.7'])
5662
def type_check(session):
5763
"""Run type checking using pytype."""
64+
if sys.platform.startswith('win'):
65+
session.skip('pytype not supported on Windows')
5866
session.install('-e', '.[dev]')
5967
session.install('pytype')
60-
session.run('pytype', '--python-version=3.6', '--disable=pyi-error',
68+
session.run('pytype', '--python-version=3.7', '--disable=pyi-error',
6169
'pybadges')

pybadges/precalculate_text.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ def calculate_character_to_length_mapping(
104104
return char_to_length
105105

106106

107-
def calculate_pair_to_kern_mapping(
108-
measurer: text_measurer.TextMeasurer, char_to_length: Mapping[str,
109-
float],
110-
characters: Iterable[str]) -> Mapping[str, float]:
107+
def calculate_pair_to_kern_mapping(measurer: text_measurer.TextMeasurer,
108+
char_to_length: Mapping[str, float],
109+
characters: str) -> Mapping[str, float]:
111110
"""Returns a mapping between each *pair* of characters and their kerning.
112111
113112
Args:

pybadges/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '2.3.0' # Also change in setup.py.
15+
__version__ = '3.0.0' # Also change in setup.py.

server-example/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Flask>1.1
1+
Flask>=2.0
22
pybadges

server-example/test_app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"Tests for app"
1615

1716
import pytest

setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def replace_relative_with_absolute(match):
3939

4040
setup(
4141
name='pybadges',
42-
version='2.3.0', # Also change in version.py.
42+
version='3.0.0', # Also change in version.py.
4343
author='Brian Quinlan',
4444
author_email='brian@sweetapp.com',
4545
classifiers=[
@@ -49,10 +49,10 @@ def replace_relative_with_absolute(match):
4949
'License :: OSI Approved :: Apache Software License',
5050
'Programming Language :: Python',
5151
'Programming Language :: Python :: 3',
52-
'Programming Language :: Python :: 3.4',
53-
'Programming Language :: Python :: 3.5',
54-
'Programming Language :: Python :: 3.6',
5552
'Programming Language :: Python :: 3.7',
53+
'Programming Language :: Python :: 3.8',
54+
'Programming Language :: Python :: 3.9',
55+
'Programming Language :: Python :: 3.10',
5656
'Operating System :: OS Independent',
5757
],
5858
description='A library and command-line tool for generating Github-style ' +
@@ -66,11 +66,9 @@ def replace_relative_with_absolute(match):
6666
long_description=get_long_description(),
6767
long_description_content_type='text/markdown',
6868
python_requires='>=3.4',
69-
install_requires=[
70-
'Jinja2>=2.9.0,<3', 'MarkupSafe<2.1.0', 'requests>=2.9.0,<3'
71-
],
69+
install_requires=['Jinja2>=3,<4', 'requests>=2.22.0,<3'],
7270
extras_require={
73-
'pil-measurement': ['Pillow>=5,<6'],
71+
'pil-measurement': ['Pillow>=6,<10'],
7472
'dev': [
7573
'fonttools>=3.26', 'nox', 'Pillow>=5', 'pytest>=3.6', 'xmldiff>=2.4'
7674
],

0 commit comments

Comments
 (0)