Skip to content
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

fix: python3.12 testing and linting #48

Merged
merged 8 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
14 changes: 12 additions & 2 deletions .github/workflows/ci_static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow runs static analysis checks on pull requests.
# This workflow runs static analysis checks on pull requests.l
texastony marked this conversation as resolved.
Show resolved Hide resolved
texastony marked this conversation as resolved.
Show resolved Hide resolved
name: static analysis

on:
Expand All @@ -15,12 +15,22 @@ jobs:
fail-fast: false
matrix:
category:
- mypy-py3
- bandit
- doc8
- readme
- docs
- flake8
- pylint
- flake8-tests
- pylint-tests
- black-check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
python-version: 3.11
# Python 3.12 has pip issues, use 3.11
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,27 @@ jobs:
architecture: x86
- os: macos-latest
architecture: x64
python:
- 3.8
- 3.9
- "3.10"
- "3.11"
major:
- 3
minor:
- 8
- 9
- 10
- 11
- 12
category:
# Runs the base test environment
- py
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
python-version: '${{ matrix.major }}.${{ matrix.minor }}'
architecture: ${{ matrix.platform.architecture }}
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
TOXENV: '${{ matrix.category }}${{ matrix.major }}${{ matrix.minor }}'
run: tox -- -vv
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Getting Started
:class:`base64io.Base64IO` has no dependencies other than the standard library and and should
work with any version of Python greater than 2.6.
We test it on CPython 3.8, 3.9, 3.10, & 3.11.
texastony marked this conversation as resolved.
Show resolved Hide resolved

Installation
============

Expand Down
1 change: 1 addition & 0 deletions ci-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
setuptools
tox==3.24.5
3 changes: 1 addition & 2 deletions src/base64io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ def _passthrough_interactive_check(self, method_name, mode):
):
return True
return False
else:
return method()
return method()

def writable(self):
# type: () -> bool
Expand Down
1 change: 1 addition & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
setuptools
hypothesis>=3.56.0
mock
pytest>=3.3.1
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_base64_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_base64io_always_false_methods(method_name):
assert not getattr(test, method_name)()


@pytest.mark.parametrize("method_name, args", (("fileno", ()), ("seek", (None,)), ("tell", ()), ("truncate", ())))
@pytest.mark.parametrize("method_name, args", (("fileno", ()), ("seek", (4,)), ("tell", ()), ("truncate", ())))
def test_unsupported_methods(method_name, args):
test = Base64IO(io.BytesIO())

Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{38,39,310,311},
py{38,39,310,311,312},
bandit, doc8, readme,
mypy-py3,
flake8, pylint,
Expand All @@ -13,7 +13,8 @@ envlist =
# linters-tests :: Runs all linters over all tests.

[testenv:default-python]
basepython = python3
# 3.12 has pip issues, default to 3.11
basepython = python3.11

[testenv:base-command]
commands = pytest --basetemp={envtmpdir} -l --cov base64io {posargs}
Expand All @@ -26,7 +27,9 @@ passenv =
# Pass through twine password -- remove this once secrets-helper is fixed
# https://github.com/awslabs/secrets-helper/issues/15
TWINE_PASSWORD
deps = -rtest/requirements.txt
deps =
-rtest/requirements.txt
py312: pip>=23.3.1
commands = pytest --basetemp={envtmpdir} -l --cov base64io {posargs}

# mypy
Expand Down