Skip to content

Add support for Python 3.8 #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
# - https://circleci.com/docs/2.0/language-python/ for more details
# - https://circleci.com/docs/2.0/configuration-reference/
#
version: 2
version: "2.1"

jobs:
test-py37:
test:
parameters:
python_version:
type: string

docker:
- image: python:3.7.2
- image: python:<< parameters.python_version >>

working_directory: ~/repo

Expand All @@ -34,7 +39,14 @@ jobs:
command: |
. venv/bin/activate
make lint
tox -e py37

# Set Tox environment to the installed Python version.
TOXENV=$(
python -c 'import sys; v = sys.version_info; print("py{}{}".format(v.major, v.minor))'
)

tox -e "$TOXENV"

codecov
make test-coverage-report-console
make test-coverage-report-html
Expand Down Expand Up @@ -75,5 +87,11 @@ workflows:
version: 2
ci:
jobs:
- test-py37
- test:
matrix:
parameters:
python_version:
- "3.7.2"
- "3.7.6"
- "3.8.3"
- dist
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Status
Supported Python versions
-------------------------

Only Python 3.7. Python 3.6 and below will not work because we use some features introduced in
Python 3.7.
Only Python 3.7 and 3.8. Python 3.6 and below will not work because we use some features introduced
in Python 3.7.

Quickstart
----------
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def get_version(*file_paths: Sequence[str]) -> str:
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
description="""Python library for Servicio de Impuestos Internos (SII) of Chile.""",
extras_require=extras_requirements,
Expand All @@ -86,7 +87,7 @@ def get_version(*file_paths: Sequence[str]) -> str:
name='cl-sii',
package_data=_package_data,
packages=find_packages(exclude=['docs', 'tests*']),
python_requires='>=3.7, <3.8',
python_requires='>=3.7, <3.9',
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
Expand Down
8 changes: 6 additions & 2 deletions tests/test_libs_io_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import pathlib
import sys
import tempfile
import unittest

Expand Down Expand Up @@ -69,8 +70,11 @@ def test_with_encoding_utf8(self):

with tempfile.SpooledTemporaryFile(mode='rt', encoding='utf-8') as f:
self.assertTrue(isinstance(f, tempfile.SpooledTemporaryFile))
# note: this is a strange case.
self.assertFalse(with_encoding_utf8(f))
if sys.version_info[:3] >= (3, 7, 6):
self.assertTrue(with_encoding_utf8(f))
else:
# note: this is a strange case (Python 3.7).
self.assertFalse(with_encoding_utf8(f))

# Text mode - encoding 'latin1'

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist =
py37
py37,
py38,

[testenv]
setenv =
Expand All @@ -10,3 +11,4 @@ deps =
-r{toxinidir}/requirements/test.txt
basepython =
py37: python3.7
py38: python3.8