Skip to content

Commit

Permalink
Merge pull request #130 from pycompression/py312
Browse files Browse the repository at this point in the history
Drop Python 3.7 and add Python 3.12
  • Loading branch information
marcelm authored Oct 3, 2023
2 parents cc75cbc + 2861ab8 commit 8b1094e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
python-version: ["3.10"]
toxenv: [black, flake8, mypy]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -34,21 +34,21 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.7"]
optional-deps: [true]
include:
- os: macos-latest
python-version: 3.7
python-version: "3.10"
optional-deps: true
- os: ubuntu-20.04
python-version: 3.7
python-version: "3.10"
optional-deps: false
- os: ubuntu-20.04
python-version: 3.7
python-version: "3.10"
optional-deps: false
with-zstandard: true
- os: windows-latest
python-version: 3.7
python-version: "3.10"
steps:
- name: Install optional tools macOS
if: runner.os == 'macOS' && matrix.optional-deps
Expand All @@ -59,11 +59,11 @@ jobs:
- name: Remove xz
if: runner.os == 'Linux' && !matrix.optional-deps
run: while which xz; do sudo rm $(which xz); done
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -74,28 +74,28 @@ jobs:
if: matrix.with-zstandard
run: tox -e zstd
- name: Upload coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

deploy:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: [lint, test]
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for setuptools_scm
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: "3.10"
- name: Make distributions
run: |
python -m pip install build
python -m build
ls -l dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.1
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
12 changes: 12 additions & 0 deletions tests/test_piped.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ def test_piped_reader_iter(threads, threaded_reader):
assert lines[0] == CONTENT_LINES[0]


def test_writer(tmp_path, writer):
opener, extension = writer
print(opener, writer)
print(repr(opener))
path = tmp_path / f"out{extension}"
with opener(path, mode="wt") as f:
print(f)
f.write("hello")
with xopen(path, mode="rt") as f:
assert f.read() == "hello"


def test_writer_has_iter_method(tmp_path, writer):
opener, extension = writer
with opener(tmp_path / f"out.{extension}") as f:
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8,mypy,py37,py38,py39,py310,py311,pypy3
envlist = flake8,mypy,py38,py39,py310,py311,py312,pypy3
isolated_build = True

[testenv]
Expand All @@ -22,19 +22,19 @@ deps =
zstandard

[testenv:black]
basepython = python3.7
basepython = python3.10
deps = black==22.3.0
skip_install = true
commands = black --check src/ tests/

[testenv:flake8]
basepython = python3.7
basepython = python3.10
deps = flake8
commands = flake8 src/ tests/
skip_install = true

[testenv:mypy]
basepython = python3.7
basepython = python3.10
deps = mypy
commands = mypy src/

Expand Down

0 comments on commit 8b1094e

Please sign in to comment.