mirror of
https://github.com/google/pybadges.git
synced 2026-01-04 18:30:10 +01:00
@@ -2,59 +2,86 @@ version: 2
|
||||
jobs:
|
||||
Unit Test:
|
||||
docker:
|
||||
- image: circleci/python:3.7.1
|
||||
|
||||
- image: cimg/python:3.10.2
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
sudo pip install virtualenv
|
||||
sudo pip install nox
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s unit
|
||||
Compatibility Test:
|
||||
Compatibility Test 3.10:
|
||||
docker:
|
||||
- image: circleci/python:3.7.1
|
||||
|
||||
- image: cimg/python:3.10.2
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
sudo pip install virtualenv
|
||||
sudo pip install nox
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s compatibility
|
||||
Compatibility Test 3.9:
|
||||
docker:
|
||||
- image: cimg/python:3.9.10
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s compatibility
|
||||
Compatibility Test 3.8:
|
||||
docker:
|
||||
- image: cimg/python:3.8.12
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s compatibility
|
||||
Compatibility Test 3.7:
|
||||
docker:
|
||||
- image: cimg/python:3.7.12
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s compatibility
|
||||
Lint:
|
||||
docker:
|
||||
- image: circleci/python:3.7.1
|
||||
|
||||
- image: cimg/python:3.10.2
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
sudo pip install virtualenv
|
||||
sudo pip install nox
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s lint
|
||||
Type Check:
|
||||
docker:
|
||||
- image: circleci/python:3.7.1
|
||||
- image: cimg/python:3.7.12
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
sudo pip install virtualenv
|
||||
sudo pip install nox
|
||||
pip install virtualenv
|
||||
pip install nox
|
||||
nox -f noxfile.py -s type_check
|
||||
Release:
|
||||
docker:
|
||||
- image: circleci/python:3.7.1
|
||||
- image: cimg/python:3.10.2
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
sudo pip install --upgrade twine
|
||||
sudo pip install --upgrade wheel
|
||||
sudo pip install --upgrade setuptools
|
||||
pip install --upgrade twine
|
||||
pip install --upgrade wheel
|
||||
pip install --upgrade setuptools
|
||||
source twine_upload.sh
|
||||
|
||||
|
||||
@@ -65,7 +92,10 @@ workflows:
|
||||
- Lint
|
||||
- Unit Test
|
||||
- Type Check
|
||||
- Compatibility Test
|
||||
- Compatibility Test 3.10
|
||||
- Compatibility Test 3.9
|
||||
- Compatibility Test 3.8
|
||||
- Compatibility Test 3.7
|
||||
release:
|
||||
jobs:
|
||||
- Release:
|
||||
|
||||
24
noxfile.py
24
noxfile.py
@@ -14,6 +14,7 @@
|
||||
"""Nox config for running lint and unit tests."""
|
||||
|
||||
import nox
|
||||
import sys
|
||||
|
||||
|
||||
def _run_tests(session):
|
||||
@@ -28,34 +29,41 @@ def lint(session):
|
||||
serious code quality issues.
|
||||
"""
|
||||
session.install('yapf')
|
||||
session.run('python3', '-m', 'yapf', '--diff', '-r', '.')
|
||||
session.run('yapf', '--diff', '-r', '.')
|
||||
|
||||
|
||||
@nox.session
|
||||
def unit(session):
|
||||
"""Run the unit test suite."""
|
||||
session.install('-e', '.[dev]')
|
||||
session.install('-r', 'server-example/requirements-test.txt')
|
||||
session.install('flask')
|
||||
_run_tests(session)
|
||||
|
||||
|
||||
@nox.session(python=['3.4', '3.5', '3.6', '3.7', '3.8'])
|
||||
@nox.session
|
||||
@nox.parametrize(
|
||||
'install',
|
||||
['Jinja2==2.9.0', 'Pillow==5.0.0', 'requests==2.9.0', 'xmldiff==2.4'])
|
||||
[
|
||||
'Jinja2==3.0.0',
|
||||
'Pillow==8.3.2', # Oldest version that supports Python 3.7 to 3.10.
|
||||
'requests==2.22.0',
|
||||
'xmldiff==2.4'
|
||||
])
|
||||
def compatibility(session, install):
|
||||
"""Run the unit test suite with each support library and Python version."""
|
||||
|
||||
session.install('-e', '.[dev]')
|
||||
session.install('-r', 'server-example/requirements-test.txt')
|
||||
session.install(install)
|
||||
session.install('-r', 'server-example/requirements-test.txt')
|
||||
session.install('-e', '.[dev]')
|
||||
_run_tests(session)
|
||||
|
||||
|
||||
@nox.session(python=['3.6'])
|
||||
@nox.session(python=['3.7'])
|
||||
def type_check(session):
|
||||
"""Run type checking using pytype."""
|
||||
if sys.platform.startswith('win'):
|
||||
session.skip('pytype not supported on Windows')
|
||||
session.install('-e', '.[dev]')
|
||||
session.install('pytype')
|
||||
session.run('pytype', '--python-version=3.6', '--disable=pyi-error',
|
||||
session.run('pytype', '--python-version=3.7', '--disable=pyi-error',
|
||||
'pybadges')
|
||||
|
||||
@@ -104,10 +104,9 @@ def calculate_character_to_length_mapping(
|
||||
return char_to_length
|
||||
|
||||
|
||||
def calculate_pair_to_kern_mapping(
|
||||
measurer: text_measurer.TextMeasurer, char_to_length: Mapping[str,
|
||||
float],
|
||||
characters: Iterable[str]) -> Mapping[str, float]:
|
||||
def calculate_pair_to_kern_mapping(measurer: text_measurer.TextMeasurer,
|
||||
char_to_length: Mapping[str, float],
|
||||
characters: str) -> Mapping[str, float]:
|
||||
"""Returns a mapping between each *pair* of characters and their kerning.
|
||||
|
||||
Args:
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
__version__ = '2.3.0' # Also change in setup.py.
|
||||
__version__ = '3.0.0' # Also change in setup.py.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Flask>1.1
|
||||
Flask>=2.0
|
||||
pybadges
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"Tests for app"
|
||||
|
||||
import pytest
|
||||
|
||||
14
setup.py
14
setup.py
@@ -39,7 +39,7 @@ def get_long_description():
|
||||
|
||||
setup(
|
||||
name='pybadges',
|
||||
version='2.3.0', # Also change in version.py.
|
||||
version='3.0.0', # Also change in version.py.
|
||||
author='Brian Quinlan',
|
||||
author_email='brian@sweetapp.com',
|
||||
classifiers=[
|
||||
@@ -49,10 +49,10 @@ setup(
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Operating System :: OS Independent',
|
||||
],
|
||||
description='A library and command-line tool for generating Github-style ' +
|
||||
@@ -66,11 +66,9 @@ setup(
|
||||
long_description=get_long_description(),
|
||||
long_description_content_type='text/markdown',
|
||||
python_requires='>=3.4',
|
||||
install_requires=[
|
||||
'Jinja2>=2.9.0,<3', 'MarkupSafe<2.1.0', 'requests>=2.9.0,<3'
|
||||
],
|
||||
install_requires=['Jinja2>=3,<4', 'requests>=2.22.0,<3'],
|
||||
extras_require={
|
||||
'pil-measurement': ['Pillow>=5,<6'],
|
||||
'pil-measurement': ['Pillow>=6,<10'],
|
||||
'dev': [
|
||||
'fonttools>=3.26', 'nox', 'Pillow>=5', 'pytest>=3.6', 'xmldiff>=2.4'
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user