Skip to content

Commit 69a2628

Browse files
committed
chore: drop python 2 support
1 parent 5fb7a4b commit 69a2628

24 files changed

+80
-213
lines changed

.circleci/config.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ workflows:
6565
- linter/pre-commit:
6666
python_version: 3.7.5
6767

68-
- toxpy:
69-
name: test-py2.7
70-
docker_image: '2.7'
71-
tox_environment: py27
7268
- toxpy:
7369
name: test-py3.4
7470
docker_image: '3.4'
@@ -108,19 +104,6 @@ workflows:
108104
tox_environment: py38
109105
cov_version: '5'
110106

111-
- toxpypy:
112-
name: test-pypy2-5
113-
docker_image: 2-5
114-
tox_environment: pypy
115-
- toxpypy:
116-
name: test-pypy2-6
117-
docker_image: 2-6
118-
tox_environment: pypy
119-
- toxpypy:
120-
name: test-pypy2-7
121-
docker_image: 2-7
122-
tox_environment: pypy
123-
124107
- toxpypy:
125108
name: test-pypy3-5-cov4
126109
docker_image: 3-5

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
11+
python-version: [3.5, 3.6, 3.7, 3.8]
1212

1313
steps:
1414
- uses: actions/checkout@v1

.gitignore

Lines changed: 47 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,61 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
41
*$py.class
5-
6-
# C extensions
2+
*.cover
3+
*.egg
4+
*.egg-info/
5+
*.log
6+
*.manifest
7+
*.mo
8+
*.pot
9+
*.py[cod]
10+
*.sage.py
711
*.so
8-
9-
# Distribution / packaging
12+
*.spec
1013
.Python
14+
.cache
15+
.coverage
16+
.coverage.*
17+
.eggs/
18+
.env
19+
.hypothesis/
20+
.installed.cfg
21+
.ipynb_checkpoints
22+
.mypy_cache/
23+
.pytest_cache/
24+
.python-version
25+
.ropeproject
26+
.scrapy
27+
.spyderproject
28+
.spyproject
29+
.tox/
30+
.venv
31+
.webassets-cache
32+
/site
33+
ENV/
34+
MANIFEST
35+
__pycache__/
1136
build/
37+
celerybeat-schedule
38+
coverage.xml
39+
db.sqlite3
1240
develop-eggs/
1341
dist/
42+
docs/_build/
1443
downloads/
1544
eggs/
16-
.eggs/
45+
env.bak/
46+
env/
47+
htmlcov/
48+
instance/
1749
lib/
1850
lib64/
51+
local_settings.py
52+
nosetests.xml
1953
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
*.egg-info/
24-
.installed.cfg
25-
*.egg
26-
MANIFEST
27-
28-
# PyInstaller
29-
# Usually these files are written by a python script from a template
30-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31-
*.manifest
32-
*.spec
33-
34-
# Installer logs
35-
pip-log.txt
3654
pip-delete-this-directory.txt
37-
38-
# Unit test / coverage reports
39-
htmlcov/
40-
.tox/
41-
.coverage
42-
.coverage.*
43-
.cache
44-
nosetests.xml
45-
coverage.xml
46-
*.cover
47-
.hypothesis/
48-
.pytest_cache/
49-
50-
# Translations
51-
*.mo
52-
*.pot
53-
54-
# Django stuff:
55-
*.log
56-
local_settings.py
57-
db.sqlite3
58-
59-
# Flask stuff:
60-
instance/
61-
.webassets-cache
62-
63-
# Scrapy stuff:
64-
.scrapy
65-
66-
# Sphinx documentation
67-
docs/_build/
68-
69-
# PyBuilder
55+
pip-log.txt
56+
sdist/
7057
target/
71-
72-
# Jupyter Notebook
73-
.ipynb_checkpoints
74-
75-
# pyenv
76-
.python-version
77-
78-
# celery beat schedule file
79-
celerybeat-schedule
80-
81-
# SageMath parsed files
82-
*.sage.py
83-
84-
# Environments
85-
.env
86-
.venv
87-
env/
88-
venv/
89-
ENV/
90-
env.bak/
58+
var/
9159
venv.bak/
92-
93-
# Spyder project settings
94-
.spyderproject
95-
.spyproject
96-
97-
# Rope project settings
98-
.ropeproject
99-
100-
# mkdocs documentation
101-
/site
102-
103-
# mypy
104-
.mypy_cache/
60+
venv/
61+
wheels/

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ sudo: false
22

33
language: python
44
python:
5-
- 2.7
65
- 3.4
76
- 3.5
87
- 3.6
98
- 3.7
109
- 3.8
11-
- pypy
1210
- pypy3
1311

1412
install:

coveralls/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding: utf-8
21
from .api import Coveralls
32
from .version import __version__
43

coveralls/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding: utf-8
21
import codecs
32
import json
43
import logging

coveralls/reporter.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
# coding: utf-8
21
import logging
32
import os
4-
import sys
53

64
from coverage import __version__
75
from coverage.misc import NoSource
86
from coverage.misc import NotPython
9-
from coverage.phystokens import source_encoding
107

118
from .exception import CoverallsException
129

@@ -216,18 +213,6 @@ def parse_file(self, cu, analysis):
216213
source_lines = analysis.parser.lines
217214
with cu.source_file() as source_file:
218215
source = source_file.read()
219-
220-
try:
221-
if sys.version_info < (3, 0):
222-
encoding = source_encoding(source)
223-
if encoding != 'utf-8':
224-
source = source.decode(encoding).encode('utf-8')
225-
except UnicodeDecodeError:
226-
log.warning(
227-
'Source file %s can not be properly decoded, skipping. '
228-
'Please check if encoding declaration is ok',
229-
os.path.basename(cu.filename))
230-
return
231216
else:
232217
if hasattr(cu, 'relative_filename'):
233218
filename = cu.relative_filename()

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
32
from coveralls import __version__
43

54

6-
# -- General configuration ------------------------------------------------
75
extensions = [
86
'sphinx.ext.autodoc',
97
'sphinx.ext.githubpages',

docs/usage/tox.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Running coveralls-python from within a `tox`_ environment (v2.0 and above) requi
66
For example, on TravisCI::
77

88
[tox]
9-
envlist = py27,py34,py35,py36
9+
envlist = py34,py35,py36,py37,py38
1010

1111
[testenv]
1212
passenv = TRAVIS TRAVIS_*

example/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# coding: utf-8

example/project.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# coding: utf-8
2-
3-
41
def hello():
52
print('world')
63

@@ -16,4 +13,4 @@ def branch(cond1, cond2):
1613
if cond1:
1714
print('condition tested both ways')
1815
if cond2:
19-
print('condition not tested both ways')
16+
print('condition not tested both ways')

example/runtests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# coding: utf-8
21
from project import hello, branch
32

43
if __name__ == '__main__':
54
hello()
65
branch(False, True)
7-
branch(True, True)
6+
branch(True, True)

nonunicode/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# coding: utf-8

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
# N.B. PyYAML 5.3 dropped support for Python 3.4... which we should
4343
# also do...
4444
'yaml': ['PyYAML>=3.10,<5.3'],
45-
':python_version < "3"': ['urllib3[secure]'],
4645
},
4746
classifiers=[
4847
'Development Status :: 5 - Production/Stable',
@@ -51,7 +50,6 @@
5150
'License :: OSI Approved :: MIT License',
5251
'Operating System :: OS Independent',
5352
'Programming Language :: Python',
54-
'Programming Language :: Python :: 2.7',
5553
'Programming Language :: Python :: 3.4',
5654
'Programming Language :: Python :: 3.5',
5755
'Programming Language :: Python :: 3.6',

tests/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# coding: utf8

tests/api/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# coding: utf8

tests/api/configuration_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding: utf-8
21
# pylint: disable=no-self-use
32
import os
43
import shutil

tests/api/encoding_test.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# coding: utf-8
21
import json
3-
import logging
42
import os
53
import subprocess
6-
import sys
74

85
import coverage
96
import pytest
@@ -27,21 +24,6 @@ def test_non_unicode():
2724
assert expected_json_part in actual_json
2825

2926

30-
@pytest.mark.skipif(sys.version_info >= (3, 0), reason='python 3 not affected')
31-
@pytest.mark.skipif(coverage.__version__.startswith('4.'),
32-
reason='coverage 4 not affected')
33-
def test_malformed_encoding_declaration(capfd):
34-
os.chdir(NONUNICODE_DIR)
35-
subprocess.call(['coverage', 'run', 'malformed.py'], cwd=NONUNICODE_DIR)
36-
37-
logging.getLogger('coveralls').addHandler(logging.StreamHandler())
38-
assert Coveralls(repo_token='xxx').get_coverage() == []
39-
40-
_, err = capfd.readouterr()
41-
assert 'Source file malformed.py can not be properly decoded' in err
42-
43-
44-
@pytest.mark.skipif(sys.version_info < (3, 0), reason='python 2 fails')
4527
@pytest.mark.skipif(coverage.__version__.startswith('3.'),
4628
reason='coverage 3 fails')
4729
def test_malformed_encoding_declaration_py3_or_coverage4():

0 commit comments

Comments
 (0)