Repository: martinellimarco/indexed_zstd (language: python)

Issue:
Not compiling on MacOSX
Your package is a dependency of https://github.com/mxmlnkn/ratarmount, which may become a dependency of https://github.com/yt-project/yt (if https://github.com/yt-project/yt/pull/3443 is merged). In the process of testing yt, we discovered that `indexed_zstd` does not compile on Mac-OSX (nor on Windows, but that is to be expected, isn't it?).

Unfortunately, I don't have access to a MacOS machine so I cannot debug it myself :(

# Steps to reproduce
```bash
# On MacOSX
pip install indexed_zstd
```
Actual error at build stage
```
[...]/indexed_zstd/libzstd-seek/zstd-seek.o -std=c++11 -O3 -DNDEBUG
    error: invalid argument '-std=c++11' not allowed with 'C'
    error: command '/usr/bin/clang' failed with exit code 1
```


Discussion / hints:
Thank you for reporting this.

I never tested this on MacOS X before.
I did now and I confirm it's not working, but I get different error message.

I will work to fix this within the next week, in the meantime for completeness I'm adding the output I got.

Tested on Catalina 10.15.7, I will test on MacOS 11 later.

```
$ pip install indexed_zstd
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
Collecting indexed_zstd
  Downloading https://files.pythonhosted.org/packages/f0/8f/97b8e250af5c2a41b0f0bc81ccc7399964f274026e5f93579f03a25dba8a/indexed_zstd-1.2.2.tar.gz (60kB)
     |████████████████████████████████| 450kB 22.0MB/s 
Building wheels for collected packages: indexed-zstd
  WARNING: Building wheel for indexed-zstd failed: [Errno 13] Permission denied: '/Users/imac/Library/Caches/pip/wheels/dd'
Failed to build indexed-zstd
Installing collected packages: indexed-zstd
  Running setup.py install for indexed-zstd ... error
    ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.4/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/t5/dz9b_c0s0cl6nd_tk8c2zrpw0000gn/T/pip-install-omxydj81/indexed-zstd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/t5/dz9b_c0s0cl6nd_tk8c2zrpw0000gn/T/pip-record-0ufzjkkc/install-record.txt --single-version-externally-managed --compile:
    ERROR: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    running install
    running build
    running build_py
    file indexed_zstd.py (for module indexed_zstd) not found
    file indexed_zstd.py (for module indexed_zstd) not found
    running build_ext
    building 'indexed_zstd' extension
    creating build
    creating build/temp.macosx-10.6-intel-3.4
    creating build/temp.macosx-10.6-intel-3.4/indexed_zstd
    creating build/temp.macosx-10.6-intel-3.4/indexed_zstd/libzstd-seek
    /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I. -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c indexed_zstd/indexed_zstd.cpp -o build/temp.macosx-10.6-intel-3.4/indexed_zstd/indexed_zstd.o -std=c++11 -O3 -DNDEBUG
    clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    indexed_zstd/indexed_zstd.cpp:655:10: fatal error: 'ios' file not found
    #include "ios"
             ^~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
    ----------------------------------------
ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/t5/dz9b_c0s0cl6nd_tk8c2zrpw0000gn/T/pip-install-omxydj81/indexed-zstd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/t5/dz9b_c0s0cl6nd_tk8c2zrpw0000gn/T/pip-record-0ufzjkkc/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/t5/dz9b_c0s0cl6nd_tk8c2zrpw0000gn/T/pip-install-omxydj81/indexed-zstd/
```
I can also test this on Windows if it's needed but for me it's a low priority at the moment.
Fixed in version 1.3.1, tested on Catalina 10.11.7 and Big Sur 11.2.3

```
$ pip3 install indexed_zstd --user
Collecting indexed_zstd
  Using cached https://files.pythonhosted.org/packages/d2/43/bd769e9207faa984362b39a2d1b7148f96c2e99a4473c6965c8618f86f4b/indexed_zstd-1.3.1.tar.gz
Building wheels for collected packages: indexed-zstd
  Building wheel for indexed-zstd (setup.py) ... done
  Created wheel for indexed-zstd: filename=indexed_zstd-1.3.1-cp38-cp38-macosx_10_14_6_x86_64.whl size=77046 sha256=5e84cd3d556b8a2fa0e61d4282ec2ed769e4096ad6ba49d8dbd5ac390125a8a3
  Stored in directory: /Users/imac/Library/Caches/pip/wheels/b2/79/d2/603d15751b915fed81135fd6cd2b3a496ecf7d7c79ce21e981
Successfully built indexed-zstd
Installing collected packages: indexed-zstd
Successfully installed indexed-zstd-1.3.1
```


Fix patch:
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..c12074b
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,82 @@
+name: Publish to PyPI
+
+on:
+  push:
+    tags:
+      - 'v*.*.*'
+
+jobs:
+  Deploy-Wheels:
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      matrix:
+#        os: [macos-latest, ubuntu-latest, windows-latest]
+        os: [macos-latest, ubuntu-latest]
+        manylinux-image: [manylinux2014]
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: '3.10'
+
+    - name: Install Dependencies
+      run: |
+        python3 -m pip install --upgrade pip
+        python3 -m pip install --upgrade-strategy eager --upgrade cython twine cibuildwheel
+
+    - name: Build Tarball
+      if: matrix.os == 'ubuntu-latest'
+      run: python3 setup.py sdist
+
+    - name: Build Wheels
+      env:
+        CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }}
+        CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
+        CIBW_ARCHS: auto64
+        CIBW_BEFORE_ALL_LINUX: yum install -y libzstd-devel || apk add zstd-dev
+        CIBW_BEFORE_ALL_MACOS: brew install zstd
+        CIBW_BEFORE_ALL_WINDOWS: choco install zstandard
+      run: python -m cibuildwheel --output-dir dist
+
+    - name: Check Wheels
+      run: twine check dist/*
+
+    - name: Publish to PyPI
+      env:
+        TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
+      run: twine upload --skip-existing -u __token__ dist/*
+
+
+  Deploy-Tarball:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: '3.10'
+
+    - name: Install Dependencies
+      run: |
+        python3 -m pip install --upgrade pip
+        python3 -m pip install --upgrade-strategy eager --upgrade setuptools twine
+
+    - name: Create Tarball
+      run: python3 setup.py sdist
+
+    - name: Check Wheels
+      run: twine check dist/*
+
+    - name: Publish to PyPI
+      env:
+        TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
+      run: echo twine upload --skip-existing -u __token__ dist/*
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index a4f4cb8..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-language: python
-
-os: linux
-dist: focal
-
-git:
-  depth: 3
-  quiet: true
-
-python:
-  - 3.5
-  - 3.6
-  - 3.7
-  - 3.8
-  - 3.9
-
-before_install:
-  - sudo apt-get update
-  - sudo apt-get -y install libzstd-dev g++
-
-install:
-  - test indexed_zstd/indexed_zstd.cpp -nt indexed_zstd/indexed_zstd.pyx ||
-    echo -e '\e[31mPlease trigger a rebuild of indexed_zstd.pyx using "python3 setup.py build_ext --inplace --cython" and commit the new file\e[0m'
-  - pip install --upgrade cython twine
-  - python3 setup.py build_clib
-  - python3 setup.py build_ext --inplace --cython
-
-script:
-  # test whether installation from tarball works
-  - python3 setup.py sdist
-  - twine check dist/*
-  - pip install dist/*.tar.gz
-  # test zstd decoder
-  #- python3 test/test.py
-
-env:
-  global:
-    # travis encrypt TWINE_PASSWORD=...
-    - secure: "f0DEWuHpbspIe8/UNnwHpk2vQPXAfXutts60FVa3TMKOjktz/VQVtZ7M5nsXApnX4xPtf3+w8eqpWG1QVTAg0dQqABcDsvgTpqV4mliE61GJCaYYQl/Q0o+oMrzS0y76LMVucWYepWMWW+FFfrtUDEJxKOVFyTWE35RqyHmWcI45Ope6Sn+xQh0KHMJqV2hRuC2g88xeYFkGx+4CoqrjfNZqHSuK6Ru6P3Ol8mq7Nnf9wq75HtSAZRawnPVJY3hwIc/4TeIy3UUAIFHojiVKhiRTNMdbNIC00BYxof+lcI6gnE6V5Mdmr6UJOfgVG9IL9TSiHJJ3WQx/M03vYZT9YNu3G9v7ukcHXSfKCUXtz3ZCh3A+Ed9COd4GcoYlCBfb1g28khVdKDInDZSH8PObcMJO9VWw6b/bInJBuuKGs6OC73Lk8gUT2/ANN1I4qZkzVYVcqjbooVZdlI8rSCdyzh9wzO9a+Rm2ov+NZp28hb44TWHFH1vD8ZVJLlOQmHnjMWeQSDXAxLsbb1s44tu7ZVmu17JHIsRkQrJVoLUw/seodUOFrtL9Kw+3viSqoAq2PxWsm7J22eWhzCFUV43iWHb1GnV3LWvVA4F9E6gEEw6WSf0amAdW6XK6FPQO1FrNnGaWqehsNyS2HQlp2ePsGMs47aPWEyBb1VlUBZ9k/t4="
-
-jobs:
-  include:
-    - name: build-tarball
-      stage: deploy
-      script:
-        - python3 setup.py sdist
-        - twine check dist/*
-        - twine upload --skip-existing -u __token__ dist/*
-
-    - name: build-manylinux2010_x86_64
-      stage: deploy
-      services:
-        - docker
-      script:
-        - docker run --rm -v "$( pwd ):/project" quay.io/pypa/manylinux2010_x86_64 bash /project/manylinux/build-wheels.sh manylinux2010_x86_64
-        - twine check dist/*
-        - twine upload --skip-existing -u __token__ dist/*
-
-    - name: build-manylinux2014_x86_64
-      stage: deploy
-      services:
-        - docker
-      script:
-        - docker run --rm -v "$( pwd ):/project" quay.io/pypa/manylinux2014_x86_64 bash /project/manylinux/build-wheels.sh manylinux2014_x86_64
-        - twine check dist/*
-        - twine upload --skip-existing -u __token__ dist/*
-
-stages:
-  - name: test
-    # test with: travis-conditions eval "..." --data '{ "commit_message": "test string" }'
-    # after installing: gem install --user-install travis-conditions
-    if: NOT ( commit_message =~ /(^|[^A-Za-z])[Ww][Ii][Pp]([^A-Za-z]|$)/ )
-  - name: deploy
-    if: tag =~ /^v/
diff --git a/indexed_zstd/indexed_zstd.cpp b/indexed_zstd/indexed_zstd.cpp
index de54b40..01a7dbc 100644
--- a/indexed_zstd/indexed_zstd.cpp
+++ b/indexed_zstd/indexed_zstd.cpp
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.29.26 */
+/* Generated by Cython 0.29.24 */
 
 /* BEGIN: Cython Metadata
 {
@@ -40,8 +40,8 @@ END: Cython Metadata */
 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
     #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_29_26"
-#define CYTHON_HEX_VERSION 0x001D1AF0
+#define CYTHON_ABI "0_29_24"
+#define CYTHON_HEX_VERSION 0x001D18F0
 #define CYTHON_FUTURE_DIVISION 1
 #include <stddef.h>
 #ifndef offsetof
@@ -188,7 +188,7 @@ END: Cython Metadata */
   #ifndef CYTHON_USE_UNICODE_INTERNALS
     #define CYTHON_USE_UNICODE_INTERNALS 1
   #endif
-  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
+  #if PY_VERSION_HEX < 0x030300F0
     #undef CYTHON_USE_UNICODE_WRITER
     #define CYTHON_USE_UNICODE_WRITER 0
   #elif !defined(CYTHON_USE_UNICODE_WRITER)
@@ -207,7 +207,7 @@ END: Cython Metadata */
     #define CYTHON_FAST_THREAD_STATE 1
   #endif
   #ifndef CYTHON_FAST_PYCALL
-    #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1)
+    #define CYTHON_FAST_PYCALL 1
   #endif
   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
@@ -226,9 +226,7 @@ END: Cython Metadata */
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
 #endif
 #if CYTHON_USE_PYLONG_INTERNALS
-  #if PY_MAJOR_VERSION < 3
-    #include "longintrepr.h"
-  #endif
+  #include "longintrepr.h"
   #undef SHIFT
   #undef BASE
   #undef MASK
@@ -359,68 +357,9 @@ class __Pyx_FakeReference {
   #define __Pyx_DefaultClassType PyClass_Type
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
-  #define __Pyx_DefaultClassType PyType_Type
-#if PY_VERSION_HEX >= 0x030B00A1
-    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
-                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
-                                                    PyObject *fv, PyObject *cell, PyObject* fn,
-                                                    PyObject *name, int fline, PyObject *lnos) {
-        PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
-        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
-        const char *fn_cstr=NULL;
-        const char *name_cstr=NULL;
-        PyCodeObject* co=NULL;
-        PyObject *type, *value, *traceback;
-        PyErr_Fetch(&type, &value, &traceback);
-        if (!(kwds=PyDict_New())) goto end;
-        if (!(argcount=PyLong_FromLong(a))) goto end;
-        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
-        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
-        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
-        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
-        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
-        if (!(nlocals=PyLong_FromLong(l))) goto end;
-        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
-        if (!(stacksize=PyLong_FromLong(s))) goto end;
-        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
-        if (!(flags=PyLong_FromLong(f))) goto end;
-        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
-        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
-        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
-        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
-        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
-        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
-        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
-        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
-        Py_XDECREF((PyObject*)co);
-        co = (PyCodeObject*)call_result;
-        call_result = NULL;
-        if (0) {
-            cleanup_code_too:
-            Py_XDECREF((PyObject*)co);
-            co = NULL;
-        }
-        end:
-        Py_XDECREF(kwds);
-        Py_XDECREF(argcount);
-        Py_XDECREF(posonlyargcount);
-        Py_XDECREF(kwonlyargcount);
-        Py_XDECREF(nlocals);
-        Py_XDECREF(stacksize);
-        Py_XDECREF(replace);
-        Py_XDECREF(call_result);
-        Py_XDECREF(empty);
-        if (type) {
-            PyErr_Restore(type, value, traceback);
-        }
-        return co;
-    }
+#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
+  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
 #else
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
@@ -658,10 +597,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
 #if PY_VERSION_HEX < 0x030200A4
   typedef long Py_hash_t;
   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
-  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
+  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
 #else
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
-  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
+  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
@@ -731,8 +670,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include "typeinfo"
 #include <utility>
 
-    #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
-    // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
+    #if __cplusplus > 199711L
     #include <type_traits>
 
     namespace cython_std {
@@ -840,7 +778,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
 #if CYTHON_ASSUME_SAFE_MACROS
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
@@ -1091,7 +1028,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
 #ifndef Py_MEMBER_SIZE
 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
 #endif
-#if CYTHON_FAST_PYCALL
   static size_t __pyx_pyframe_localsplus_offset = 0;
   #include "frameobject.h"
   #define __Pxy_PyFrame_Initialize_Offsets()\
@@ -1099,7 +1035,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
   #define __Pyx_PyFrame_GetLocalsplus(frame)\
     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
-#endif // CYTHON_FAST_PYCALL
 #endif
 
 /* PyObjectCall.proto */
@@ -4409,9 +4344,6 @@ static PyTypeObject __pyx_type_12indexed_zstd__IndexedZstdFile = {
   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
   0, /*tp_print*/
   #endif
-  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
-  0, /*tp_pypy_flags*/
-  #endif
 };
 
 static PyMethodDef __pyx_methods[] = {
@@ -7261,9 +7193,6 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
     0,
 #endif
-#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
-    0,
-#endif
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
@@ -7431,7 +7360,7 @@ static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int
     }
     if (!use_cline) {
         c_line = 0;
-        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
     }
     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
         c_line = 0;
@@ -7528,31 +7457,30 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
             const char *funcname, int c_line,
             int py_line, const char *filename) {
-    PyCodeObject *py_code = NULL;
-    PyObject *py_funcname = NULL;
+    PyCodeObject *py_code = 0;
+    PyObject *py_srcfile = 0;
+    PyObject *py_funcname = 0;
     #if PY_MAJOR_VERSION < 3
-    PyObject *py_srcfile = NULL;
     py_srcfile = PyString_FromString(filename);
-    if (!py_srcfile) goto bad;
+    #else
+    py_srcfile = PyUnicode_FromString(filename);
     #endif
+    if (!py_srcfile) goto bad;
     if (c_line) {
         #if PY_MAJOR_VERSION < 3
         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        if (!py_funcname) goto bad;
         #else
         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        if (!py_funcname) goto bad;
-        funcname = PyUnicode_AsUTF8(py_funcname);
-        if (!funcname) goto bad;
         #endif
     }
     else {
         #if PY_MAJOR_VERSION < 3
         py_funcname = PyString_FromString(funcname);
-        if (!py_funcname) goto bad;
+        #else
+        py_funcname = PyUnicode_FromString(funcname);
         #endif
     }
-    #if PY_MAJOR_VERSION < 3
+    if (!py_funcname) goto bad;
     py_code = __Pyx_PyCode_New(
         0,
         0,
@@ -7571,16 +7499,11 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
         __pyx_empty_bytes  /*PyObject *lnotab*/
     );
     Py_DECREF(py_srcfile);
-    #else
-    py_code = PyCode_NewEmpty(filename, funcname, py_line);
-    #endif
-    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
+    Py_DECREF(py_funcname);
     return py_code;
 bad:
-    Py_XDECREF(py_funcname);
-    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_srcfile);
-    #endif
+    Py_XDECREF(py_funcname);
     return NULL;
 }
 static void __Pyx_AddTraceback(const char *funcname, int c_line,
@@ -8858,23 +8781,6 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_DECREF(x);
   return ival;
 }
-static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
-  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
-    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
-#if PY_MAJOR_VERSION < 3
-  } else if (likely(PyInt_CheckExact(o))) {
-    return PyInt_AS_LONG(o);
-#endif
-  } else {
-    Py_ssize_t ival;
-    PyObject *x;
-    x = PyNumber_Index(o);
-    if (!x) return -1;
-    ival = PyInt_AsLong(x);
-    Py_DECREF(x);
-    return ival;
-  }
-}
 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
 }
diff --git a/manylinux/build-wheels.sh b/manylinux/build-wheels.sh
deleted file mode 100644
index f6ac0c8..0000000
--- a/manylinux/build-wheels.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-set -e -x
-
-PLATFORM=$1
-
-yum -y update
-yum -y install libzstd-devel
-#yum -y install https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/l/libzstd-devel-1.4.5-3.el6.x86_64.rpm
-
-# Compile wheels
-for PYBIN in /opt/python/*3*/bin; do
-(
-    buildFolder=$( mktemp -d )
-    cd /project
-    git worktree add "$buildFolder"
-    cd -- "$buildFolder"
-    git submodule update
-
-    "${PYBIN}/pip" wheel .  # Compile C++ source code and make wheels
-    for wheel in *.whl; do
-        # Bundle external shared libraries into the wheels
-        auditwheel repair "$wheel" --plat $PLATFORM -w /project/dist/
-    done
-
-    cd -
-    git worktree remove --force "$buildFolder"
-    rm -rf "$buildFolder"
-)
-done
diff --git a/setup.py b/setup.py
index 086f908..bdd4155 100755
--- a/setup.py
+++ b/setup.py
@@ -39,17 +39,27 @@
 
 setup(
     name             = 'indexed_zstd',
-    version          = '1.3.2',
+    version          = '1.3.4',
 
     description      = 'Fast random access to zstd files',
     url              = 'https://github.com/martinellimarco/indexed_zstd',
-    author           = 'Martinelli Marco with help of Maximilian Knespel',
+    author           = 'Marco Martinelli with the help of Maximilian Knespel',
     license          = 'MIT',
     classifiers      = [ 'License :: OSI Approved :: MIT License',
                          'Development Status :: 5 - Production/Stable',
+                         'Intended Audience :: Developers',
+                         'Operating System :: MacOS',
                          'Operating System :: POSIX',
                          'Operating System :: Unix',
                          'Programming Language :: Python :: 3',
+                         '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 :: C++',
+                         'Topic :: Software Development :: Libraries',
+                         'Topic :: Software Development :: Libraries :: Python Modules',
                          'Topic :: System :: Archiving' ],
 
     long_description = readmeContents,


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..08a53c1
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,132 @@
+name: tests
+
+on: [push, pull_request]
+
+jobs:
+  Code-Checks:
+    name: Code Checks
+    runs-on: ubuntu-20.04
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - name: Install Dependencies
+      run: |
+        sudo apt-get -y install libzstd-dev clang g++ wget
+        python3 -m pip install --upgrade pip
+        python3 -m pip install --upgrade-strategy eager --upgrade cython twine numpy
+        
+    - name: System Information
+      run: |
+        nproc
+        g++ --version
+        clang++ --version
+
+    - name: Check committed Cython source
+      run: |
+        # Note that modification times can't be compared because they are changed by the git checkout
+        python3 setup.py build_clib
+        python3 setup.py build_ext --inplace --cython
+        git status
+        git diff
+        ls -la indexed_zstd/indexed_zstd.cpp
+        if ! git diff --quiet indexed_zstd/indexed_zstd.cpp; then
+          echo -e '\e[31mPlease trigger a rebuild of indexed_zstd.pyx using "python3 setup.py build_ext --inplace --cython" and commit the new file\e[0m'
+          git diff indexed_zstd/indexed_zstd.cpp
+        fi
+
+    - name: Install From Tarball
+      run: |
+        python3 setup.py sdist
+        twine check dist/*
+        python3 -m pip install dist/*.tar.gz
+
+  Tests:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        # Oldest and newest versions should be enough. Python versions are supported 5 years from release date.
+        # 3.5 was released 2015-09-13 and end-of-life was 2020-09-13
+        # 3.6 was released 2016-12-23 and end-of-life will be 2021-12-23
+        # 3.7 was released 2018-06-27 and end-of-life will be 2023-06-27
+        # 3.8 was released 2019-10-14 and end-of-life will be 2024-10-14
+        # 3.9 was released 2020-10-05 and end-of-life will be 2025-10-25
+        # 3.10 was released 2021-10-04 and end-of-life will be 2026-10-25
+        python-version: ['3.6', '3.10']
+        os: [macos-latest, ubuntu-latest]
+        #os: [macos-latest, ubuntu-latest, windows-latest]
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+
+    - name: Install Dependencies
+      if: matrix.os == 'ubuntu-latest'
+      run: |
+        sudo apt-get -y install libzstd-dev g++
+
+    - name: Install Python Modules
+      run: |
+        python3 -m pip install --upgrade pip
+        python3 -m pip install --upgrade-strategy eager --upgrade cibuildwheel cython twine numpy
+
+    - name: Test Installation From Tarball
+      shell: bash
+      run: |
+        python3 setup.py sdist
+        twine check dist/*
+        python3 -m pip install dist/*.tar.gz
+
+    - name: Test ZSTD Decoder Python Package
+      # indexed_zstd should be installed for this step!
+      run: |
+        cd test
+        python3 test.py
+
+  Build-Wheels:
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      matrix:
+        os: [macos-latest, ubuntu-latest]
+        #os: [macos-latest, ubuntu-latest, windows-latest]
+        manylinux-image: [manylinux2014]
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: '3.10'
+
+    - name: Install Python Dependencies
+      run: |
+        python3 -m pip install --upgrade pip
+        python3 -m pip install --upgrade-strategy eager --upgrade cython twine cibuildwheel
+
+    - name: Build Tarball
+      if: matrix.os == 'ubuntu-latest'
+      run: python3 setup.py sdist
+
+    - name: Build Wheels
+      env:
+        CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }}
+        CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
+        CIBW_ARCHS: auto64
+        CIBW_BEFORE_ALL_LINUX: yum install -y libzstd-devel || apk add zstd-dev
+        CIBW_BEFORE_ALL_MACOS: brew install zstd
+        CIBW_BEFORE_ALL_WINDOWS: choco install zstandard
+      run: python -m cibuildwheel --output-dir dist
+
+    - name: Check Wheels
+      run: twine check dist/*