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

Rf/no fileno #118

Merged
merged 7 commits into from
Mar 30, 2023
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
5 changes: 5 additions & 0 deletions .ci/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -e

# prevent any prompts when
# apt/yum installing tzdata
export DEBIAN_FRONTEND="noninteractive"
export TZ="Europe/London"

# Make sure zlib headers are available on linux
export CIBW_BEFORE_ALL_LINUX="yum install -y zlib-devel || apt-get install -y zlib1g-dev || apk add zlib-dev || true"

Expand Down
4 changes: 2 additions & 2 deletions .ci/download_zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
set -e

curl -o zlib.tar.gz https://www.zlib.net/zlib-1.2.12.tar.gz
curl -o zlib.tar.gz https://www.zlib.net/zlib-1.2.13.tar.gz

tar -xzf zlib.tar.gz

ZLIB_HOME=$(pwd)/zlib-1.2.12
ZLIB_HOME=$(pwd)/zlib-1.2.13

# if windows, turn /drive/path/to/zlib into
# drive:/path/to/zlib.
Expand Down
5 changes: 5 additions & 0 deletions .ci/install_32bit_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

# prevent any prompts when
# apt/yum installing tzdata
export DEBIAN_FRONTEND="noninteractive"
export TZ="Europe/London"

apt-get install -y \
build-essential \
software-properties-common \
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]
python-version: ["2.7", "3.8", "3.9", "3.10", "3.11"]
extra-args: ["", "--concat"]
exclude:
- os: windows-latest
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10
architecture: x64
- name: Create test environment
run: bash ./.ci/create_test_env.sh "$ENV_DIR"
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10
architecture: x64
- name: Create test environment
run: bash ./.ci/create_test_env.sh "$ENV_DIR"
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:

env:
PLATFORM: ${{ matrix.os }}
PYTHON_VERSION: "3.8"
PYTHON_VERSION: "3.10"
TEST_SUITE: "zran_test"
TEST_PATTERN: ${{ matrix.test-pattern }}
EXTRA_ARGS: ${{ matrix.extra-args }}
Expand All @@ -264,8 +264,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
python-version: "3.10"
architecture: "x64"
- name: Create test environment
run: bash ./.ci/create_test_env.sh "$ENV_DIR"
- name: Log test environment
Expand All @@ -285,7 +285,7 @@ jobs:
container: i386/ubuntu:18.04
strategy:
matrix:
python-version: [2.7, 3.8]
python-version: ["2.7", "3.10"]
extra-args: ["", "--concat"]

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]
python-version: ["2.7", "3.8", "3.9", "3.10", "3.11"]
extra-args: ["", "--concat"]
exclude:
- os: windows-latest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.8"
python-version: "3.10"

- name: Build sdist
run: python setup.py sdist
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.8"
python-version: "3.10"

- name: Build wheels
run: bash ./.ci/build_wheels.sh
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.8"
python-version: "3.10"
- name: Download zlib
run: bash ./.ci/download_zlib.sh
- name: Build wheels
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.8"
python-version: "3.10"
- name: Set up QEMU for emulated (e.g. ARM) builds
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v1
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# `indexed_gzip` changelog


## 1.7.1 (March 30th 2023)


* Small change to the `IndexedGzipFile` class so that it accepts file-likes
which do not implement `fileno()` (#118).



## 1.7.0 (September 12th 2022)


Expand Down
2 changes: 1 addition & 1 deletion indexed_gzip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"""


__version__ = '1.7.0'
__version__ = '1.7.1'
7 changes: 6 additions & 1 deletion indexed_gzip/indexed_gzip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,14 @@ cdef class _IndexedGzipFile:
if not drop_handles:
if fileobj is None:
fileobj = builtin_open(filename, mode)
# Try to get a reference to the
# underlying file descriptor
try:
fd = fdopen(fileobj.fileno(), 'rb')
except io.UnsupportedOperation:
# If we can't get the file descriptor, fall
# back to using the python file-like
except Exception as e:
log.debug('Cannot get file descriptor (%s), using file-like', e)
fd = NULL

self.spacing = spacing
Expand Down