Skip to content
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
39 changes: 39 additions & 0 deletions .github/actions/windows_actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Windows Specific steps
description: "Builds libiconv and zlib with MSVC for Windows"

runs:
using: "composite"
steps:
- name: Checkout libiconv
uses: actions/checkout@v4
with:
repository: kiyolee/libiconv-win-build
ref: dff1030d222ba934e0f4a9cdab9c34134f072f68 # v1.18
path: libiconv-win-build
persist-credentials: false

- name: Checkout zlib
uses: actions/checkout@v4
with:
repository: kiyolee/zlib-win-build
ref: 30623e05e64fe4b97f2073ddaf8d3ba0e99d7249
path: zlib-win-build
persist-credentials: false

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build libiconv
run: |
msbuild.exe libiconv-win-build/build-VS2022-MT/libiconv.sln /property:Configuration=Release;Platform=X64
copy libiconv-win-build\\include\\iconv.h win_libs\\64bit
copy libiconv-win-build\\build-VS2022-MT\\x64\\Release\\libiconv-static.lib win_libs\\64bit
shell: cmd

- name: Build zlib
run: |
msbuild.exe zlib-win-build/build-VS2022-MT/zlib.sln /property:Configuration=Release;Platform=X64
copy zlib-win-build\\zlib.h win_libs\\64bit
copy zlib-win-build\\zconf.h win_libs\\64bit
copy zlib-win-build\\build-VS2022-MT\\x64\\Release\\libz-static.lib win_libs\\64bit
shell: cmd
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI Tests

on: [push, pull_request]

jobs:
test:
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2022]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev

- name: Build Windows Libraries
if: runner.os == 'Windows'
uses: ./.github/actions/windows_actions

- name: Install Python dependencies
run: |
pip install cython setuptools numpy narwhals
pip install pandas polars
pip install pytest mypy pytest-mypy-plugins pandas-stubs

# The ReadStat C library (src/) contains strict-aliasing violations
# (e.g. void* <-> readstat_variable_t** casts in readstat_writer.c).
# gcc 13+ at -O2 exploits this UB and optimizes away value-label writes.
# -fno-strict-aliasing disables that assumption while keeping other -O2 opts.
- name: Install package
run: pip install .
env:
CFLAGS: ${{ runner.os == 'Linux' && '-O2 -fno-strict-aliasing' || '' }}

- name: Run basic tests
run: python tests/test_basic.py

- name: Run narwhals pandas tests
run: python tests/test_narwhalified.py --backend=pandas

- name: Run narwhals polars tests
run: python tests/test_narwhalified.py --backend=polars

- name: Run HTTP integration tests
run: python tests/test_http_integration.py

- name: Run runtime type tests
run: python tests/test_runtime_types.py

- name: Run typing tests
run: pytest tests/test_typing.yml --mypy-ini-file=tests/test_mypy_setup.ini
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: "Otto"
orcid: "https://orcid.org/0000-0002-3363-9287"
title: "Pyreadstat"
version: 1.3.3
version: 1.3.4
doi: 10.5281/zenodo.6612282
date-released: 2018-09-24
url: "https://github.com/Roche/pyreadstat"
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ include *.pyx
recursive-include pyreadstat *.pyx
include *.pxd
recursive-include pyreadstat *.pxd

recursive-include pyreadstat py.typed
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ pip install git+https://github.com/Roche/pyreadstat.git

You need a working C compiler and cython >=3.0.0.

On some Linux distributions (e.g. Ubuntu) iconv is part of glibc and does not need
to be linked explicitly, while on others it may require linking. Additionally,
conda/miniforge environments bundle their own iconv, so pyreadstat will automatically
link it when it detects a conda environment (Python 3.11-3.13, outside of conda-build).
If your setup needs iconv linking for a different reason, you can force it by setting
the environment variable PYREADSTAT_LINK_ICONV=1. Set it to 0 to disable.

### Compiling on Windows and Mac

Compiling on linux is very easy, but on windows you need some extra preparation.
Expand Down
5 changes: 5 additions & 0 deletions change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.3.4 (github, pypi and conda 2026.xx.xx)
* Refactored pyreadstat.pyx to pyreadstat.py solves #299
* Added env variable PYREADSTAT_LINK_ICONV to link iconv at compiling time
* Adding typing annotations solves #299

# 1.3.3 (github, pypi and conda 2026.01.23)
* bumped narwhals requirement version to 2.10.1
* Added reading from file handles, solves #308
Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a00fbade8350e617c6a624dde88d788b
config: 52108008ddbffab0993edd96bc05016e
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo.bak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 75a9de938a44ab293aeee5172fdca7b5
config: a00fbade8350e617c6a624dde88d788b
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.3.3',
VERSION: '1.3.4',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
30 changes: 25 additions & 5 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; pyreadstat 1.3.3 documentation</title>
<title>Index &mdash; pyreadstat 1.3.4 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/documentation_options.js?v=28d163b9"></script>
<script src="_static/documentation_options.js?v=e358f374"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down Expand Up @@ -66,12 +66,22 @@
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#M"><strong>M</strong></a>
<a href="#F"><strong>F</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#P"><strong>P</strong></a>
| <a href="#R"><strong>R</strong></a>
| <a href="#S"><strong>S</strong></a>
| <a href="#W"><strong>W</strong></a>

</div>
<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyreadstat.pyreadstat.FileLike">FileLike (class in pyreadstat.pyreadstat)</a>
</li>
</ul></td>
</tr></table>

<h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down Expand Up @@ -101,16 +111,18 @@ <h2 id="P">P</h2>
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyreadstat.pyreadstat.FileLike.read">read() (pyreadstat.pyreadstat.FileLike method)</a>
</li>
<li><a href="index.html#pyreadstat.pyreadstat.read_dta">read_dta() (in module pyreadstat.pyreadstat)</a>
</li>
<li><a href="index.html#pyreadstat.pyreadstat.read_file_in_chunks">read_file_in_chunks() (in module pyreadstat.pyreadstat)</a>
</li>
<li><a href="index.html#pyreadstat.pyreadstat.read_file_multiprocessing">read_file_multiprocessing() (in module pyreadstat.pyreadstat)</a>
</li>
<li><a href="index.html#pyreadstat.pyreadstat.read_por">read_por() (in module pyreadstat.pyreadstat)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyreadstat.pyreadstat.read_por">read_por() (in module pyreadstat.pyreadstat)</a>
</li>
<li><a href="index.html#pyreadstat.pyreadstat.read_sas7bcat">read_sas7bcat() (in module pyreadstat.pyreadstat)</a>
</li>
<li><a href="index.html#pyreadstat.pyreadstat.read_sas7bdat">read_sas7bdat() (in module pyreadstat.pyreadstat)</a>
Expand All @@ -122,6 +134,14 @@ <h2 id="R">R</h2>
</ul></td>
</tr></table>

<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyreadstat.pyreadstat.FileLike.seek">seek() (pyreadstat.pyreadstat.FileLike method)</a>
</li>
</ul></td>
</tr></table>

<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down
107 changes: 80 additions & 27 deletions docs/_build/html/index.html

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/_build/html/objects.inv
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
# Project: pyreadstat
# Version:
# The remainder of this file is compressed using zlib.
xÚ¥“MN1 …÷s
#ØÎˆ®zH•X°¥‰;‘?%tv\ƒëq2µJ§R¥¢tçØï{Ž­$L…J$¨ !„im½Êá´S¸ïF²æžsí´M¸ÄusÐ+³Á.;IÚ;X--®°;m°×®—cvïé6›é½Ä”´ªÍ‚Õléi+y£õê&ƒjv_F¯êü5aíC`¸rë WÍð?¦Ð2H­Ø¢vÇìAÏs؜dÊËY´P¼¡‘Þ"‡Ó%~¾¾m¶èʱ´¿kÊ¿»Ð.Lí±À~/üe¹ñ¢zÛL4–!Ïè„"Êñä3¯\߈›_ªúŽ–
xÚ¥”AjÃ0E÷>ŔvkÓ¬
9@¡ÐB ‹."MlaY¹w½F¯×“T²Hã@ µ²Ïü÷¿ÇȲ£C&È3_Ù¿ì¸îÂ#H-ðPµ¾W÷©W>@YØK\õ,¾Ê£WŒVsþ:XÅΏ¾5b1NˆÝr<µð,’ûAs/^ÄîC~-uÍÛAwt›M?(/­3‰¤n²Í¬qÙ,1zÚñtòÄMÙì!¬ž•üé¤Ç܃à̯žàÌ¥ü­ÔSȋµb;TP®à؝tðËâ$†GÑLñŽŠ›Á8½ÄÏ×7AÐ=êðâïŠp]\ˆ³cy$¿·tÓ¤àÙô
¶Ã/®ÏiBæx{¦^b¶i¾a¿+‰ÏÞ
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Python Module Index &mdash; pyreadstat 1.3.3 documentation</title>
<title>Python Module Index &mdash; pyreadstat 1.3.4 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/documentation_options.js?v=28d163b9"></script>
<script src="_static/documentation_options.js?v=e358f374"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &mdash; pyreadstat 1.3.3 documentation</title>
<title>Search &mdash; pyreadstat 1.3.4 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />



<script src="_static/documentation_options.js?v=28d163b9"></script>
<script src="_static/documentation_options.js?v=e358f374"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
Loading
Loading