Skip to content

Commit

Permalink
feat: add python3.11, drop python3.6 (#38)
Browse files Browse the repository at this point in the history
* fix remove py36

* fix add py311

* revert change to lint extra

* remove lint extras from testenv

* restore lint extras to latest, development

---------

Co-authored-by: pigooosuke <[email protected]>
  • Loading branch information
toslunar and pigooosuke authored Jul 24, 2023
1 parent 4bb4c85 commit 2560ef8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
16 changes: 8 additions & 8 deletions assets/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Dockerfile for pysen-test
FROM alpine:3.14.6
FROM alpine:3.17

COPY --from=python:3.6.13-alpine3.14 /usr/local/ /usr/local/
COPY --from=python:3.7.10-alpine3.14 /usr/local/ /usr/local/
COPY --from=python:3.8.13-alpine3.14 /usr/local/ /usr/local/
COPY --from=python:3.9.12-alpine3.14 /usr/local/ /usr/local/
COPY --from=python:3.10.4-alpine3.14 /usr/local/ /usr/local/
COPY --from=python:3.7.16-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.8.16-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.9.16-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.10.11-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.11.3-alpine3.17 /usr/local/ /usr/local/

RUN apk add --no-cache expat gcc libffi musl-dev \
&& for MINOR in 6 7 8 9 10; do \
&& for MINOR in 7 8 9 10 11; do \
sed "s|^#!/usr/local/bin/python$|#!/usr/local/bin/python3.${MINOR}|" \
-i /usr/local/bin/*3.${MINOR}; done

RUN apk add --no-cache bash git \
&& pip3.10 install --no-cache-dir tox==3.15.0
&& pip3.11 install --no-cache-dir tox==3.15.0
ENV TOX_PARALLEL_NO_SPINNER 1
2 changes: 1 addition & 1 deletion pysen/py_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def parse_short_representation(value: str) -> "PythonVersion":
# NOTE(igarashi): PythonVersion class is immutable
_PythonVersions = {
"PY27": PythonVersion(2, 7),
"PY36": PythonVersion(3, 6),
"PY37": PythonVersion(3, 7),
"PY38": PythonVersion(3, 8),
"PY39": PythonVersion(3, 9),
"PY310": PythonVersion(3, 10),
"PY311": PythonVersion(3, 11),
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
url="https://github.com/pfnet/pysen",
license="MIT License",
classifiers=[
"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",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
Expand Down
26 changes: 13 additions & 13 deletions tests/test_py_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@


def test_python_version() -> None:
py36 = PythonVersion(3, 6)
py37 = PythonVersion(3, 7)

assert py36 == PythonVersion(3, 6)
assert py36 != PythonVersion(3, 7)
assert py37 == PythonVersion(3, 7)
assert py37 != PythonVersion(3, 8)

assert py36.version == "3.6"
assert py36.full_representation == "Python3.6"
assert py36.short_representation == "py36"
assert py37.version == "3.7"
assert py37.full_representation == "Python3.7"
assert py37.short_representation == "py37"

py368 = PythonVersion(3, 6, 8)
py378 = PythonVersion(3, 7, 8)

assert py368 == PythonVersion(3, 6, 8)
assert py368 != PythonVersion(3, 6, 9)
assert py368 != py36
assert py378 == PythonVersion(3, 7, 8)
assert py378 != PythonVersion(3, 7, 9)
assert py378 != py37

assert py368.version == "3.6.8"
assert py368.full_representation == "Python3.6.8"
assert py368.short_representation == "py36"
assert py378.version == "3.7.8"
assert py378.full_representation == "Python3.7.8"
assert py378.short_representation == "py37"


def test_version_ops() -> None:
Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37}-dacite{110,120,150}-isort43-black20, py37-dacite150-isort{43,50,51}-black{19,20}, py{38,39,310}-dacite150-isort51-black{20,22}, development, latest
envlist = py37-dacite{110,120,150}-isort43-black20-mypy078, py37-dacite150-isort{43,50,51}-black{19,20}-mypy078, py{38,39,310}-dacite150-isort51-black{20,22}-mypy078, py311-dacite150-isort51-black22-mypy099, development, latest

[testenv]
deps =
Expand All @@ -13,11 +13,11 @@ deps =
black19: black==19.10b0
black20: black==20.8b1
black22: black==22.10.0
mypy078: mypy==0.782
mypy099: mypy==0.991
flake8==4.0.1
flake8-bugbear==21.9.2
mypy==0.782

extras = lint
commands =
pytest -m "not examples"

Expand All @@ -28,6 +28,7 @@ setenv =
basepython = python3.9
deps =
pipenv==2022.9.8
extras = lint
commands =
pipenv sync --system
pip install .
Expand All @@ -38,6 +39,7 @@ commands =
basepython = python3.9
deps =
pipenv==2022.9.8
extras = lint
commands =
pipenv sync --system
pip install .
Expand Down

0 comments on commit 2560ef8

Please sign in to comment.