...
 
Commits (3)
......@@ -128,13 +128,14 @@ Please see the developer documentation
Changes
-------
Version_1.3.7 (dev1)
~~~~~~~~~~~~~~~~~~~~
Version_1.3.7
~~~~~~~~~~~~~
- removed cython (a build requirement) from requirements.txt
- avoid cython warning and fix language_level in the .pyx source code
- add and support pre-release tags in the version number
- use hashlib to calculate the README checksum.
- fixed support for use with python 2.7 that was broken since 1.3.4
Version_1.3.6 (2019-07-27)
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -10,4 +10,5 @@ include sndfile_linux.pxi
include sndfile_win32.pxi
include _pysndfile.pyx
include tests/*.wav
include tests/*.py
\ No newline at end of file
include tests/*.py
exclude _pysndfile.cpp
......@@ -37,4 +37,5 @@ sdist:
check: build
pip install --no-build-isolation --no-deps --no-cache --upgrade --target tests/pysndfile_inst_dir .
touch tests/pysndfile_inst_dir/__init__.py
cd tests; $(PYTHON) pysndfile_test.py
......@@ -78,12 +78,13 @@ Please see the developer documentation [here](https://pysndfile.readthedocs.io/e
## Changes
### Version_1.3.7 (dev1)
### Version_1.3.7
* removed cython (a build requirement) from requirements.txt
* avoid cython warning and fix language_level in the .pyx source code
* add and support pre-release tags in the version number
* use hashlib to calculate the README checksum.
* fixed support for use with python 2.7 that was broken since 1.3.4
### Version_1.3.6 (2019-07-27)
......
5 f
10214 9328ecf2e4103bd3f632414f3ff60bbb882a0c513cb08e7549a7160680c3b76c
......@@ -35,7 +35,7 @@ from libcpp.string cimport string
cdef extern from "Python.h":
ctypedef int Py_intptr_t
_pysndfile_version=(1, 3, 7, "dev1")
_pysndfile_version=(1, 3, 7)
def get_pysndfile_version():
"""
return tuple describing the version of pysndfile
......
Changes
-------
Version_1.3.7 (dev1)
~~~~~~~~~~~~~~~~~~~~
Version_1.3.7
~~~~~~~~~~~~~
- removed cython (a build requirement) from requirements.txt
- avoid cython warning and fix language_level in the .pyx source code
- add and support pre-release tags in the version number
- use hashlib to calculate the README checksum.
- fixed support for use with python 2.7 that was broken since 1.3.4
Version_1.3.6 (2019-07-27)
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function
import os
......@@ -7,8 +8,10 @@ import subprocess
import re
import numpy as np
import hashlib
import io
from setuptools import setup
from pkg_resources import parse_version
from distutils.core import Extension
from distutils.command.build_ext import build_ext
from distutils.command.sdist import sdist
......@@ -16,6 +19,13 @@ from distutils.command.sdist import sdist
import os
import sys
def utf8_to_bytes(ss):
try:
return bytes(ss, encoding="UTF-8")
except TypeError :
return bytes(ss)
try :
pp=[pd for pd in sys.path if not os.path.exists(pd) or not os.path.samefile(pd , ".")]
sys.path=pp
......@@ -122,7 +132,7 @@ for line in open("_pysndfile.pyx") :
break
if sys.argv[1] == "get_version":
print(_pysndfile_version_str)
print(parse_version(_pysndfile_version_str))
sys.exit(0)
README_path = os.path.join(os.path.dirname(__file__), 'README.md')
......@@ -137,14 +147,14 @@ def read_readme_checksum():
with open(README_cksum_path, "r") as fi:
rdlen, rdsum = fi.read().split()
return rdlen, rdsum
except OSError:
except IOError:
return 0, 0
def calc_readme_checksum():
readme = open(README_path).read()
readme_length = len(readme)
readme_sum = hashlib.sha256(bytes(readme, encoding="utf8")).hexdigest()
readme_sum = hashlib.sha256(utf8_to_bytes(readme)).hexdigest()
return readme_length, readme_sum
......@@ -156,20 +166,20 @@ def calc_readme_checksum():
def update_long_descr():
README_path = os.path.join(os.path.dirname(__file__), 'README.md')
LONG_DESCR_path = os.path.join(os.path.dirname(__file__), 'LONG_DESCR')
crdck = calc_readme_checksum()[1]
rrdck = read_readme_checksum()[1]
if ((not os.path.exists(LONG_DESCR_path)) or rrdck != crdck):
if rrdck != crdck:
print("readme check sum {} does not match readme {}, recalculate LONG_DESCR".format(rrdck, crdck))
crdck = calc_readme_checksum()
rrdck = read_readme_checksum()
if ((not os.path.exists(LONG_DESCR_path)) or rrdck[1] != crdck[1]):
if rrdck[1] != crdck[1]:
print("readme check sum {} does not match readme {}, recalculate LONG_DESCR".format(rrdck[1], crdck[1]))
try :
subprocess.check_call(["pandoc", "-f", "markdown", '-t', 'rst', '--ascii', '-o', LONG_DESCR_path, README_path], shell=False)
# pandoc version before 2.4 seems to write non ascii files even if the ascii flag is given
# fix this to ensure LONg_DESCR is ASCII
with open(LONG_DESCR_path, "r") as fi:
# fix this to ensure LONG_DESCR is ASCII, use io.open to make this work with python 2.7
with io.open(LONG_DESCR_path, "r", encoding="UTF-8") as fi:
# this creates a byte stream
inp = fi.read()
# replace utf8 characters thata re generated by pandoc to ASCII
# replace utf8 characters that are generated by pandoc to ASCII
# and create a byte string
ascii_long_desc = inp.replace(u"’","'").replace(u"–","--").replace(u'“','"').replace(u'”','"')
......