...
 
Commits (2)
  • Axel Roebel's avatar
    Version 1.3.7 - dev1 · f4e37052
    Axel Roebel authored
    administrative changes only
     - hard code language_level=2 in .pyx source, it apears that
       language_level does not lead to any changes that are externally
       visible so for the moment I fix it to the current cython default
       value to avoid cython warnings
     - changed README checksum to use secure_hash
     - support pre-release tags in the version number
    f4e37052
  • Axel Roebel's avatar
    Updated for 1.3.7.dev1 · 03ba972e
    Axel Roebel authored
    03ba972e
......@@ -128,6 +128,14 @@ Please see the developer documentation
Changes
-------
Version_1.3.7 (dev1)
~~~~~~~~~~~~~~~~~~~~
- 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.
Version_1.3.6 (2019-07-27)
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -3,15 +3,18 @@ python_version_full := $(wordlist 2,4,$(subst ., ,$(shell ${PYTHON} --version 2>
python_version_major := $(word 1,${python_version_full})
CYTHON=cython
PIP=pip
vv=$(shell grep _pysndfile_version= _pysndfile.pyx | tr '(),' '++.' | cut -f2 -d'+' )
vv=$(shell $(PYTHON) setup.py get_version )
all: build
build : cythonize Makefile setup.py
$(PYTHON) setup.py build_ext
cythonize : _pysndfile.cpp
# dont adapt language_level for the moment, it does not seem to make any difference anyway
# language_level is now hard-coded in the source
# $(CYTHON) -${python_version_major} --cplus $<
_pysndfile.cpp: _pysndfile.pyx pysndfile.hh sndfile_linux.pxi sndfile_win32.pxi
$(CYTHON) -${python_version_major} --cplus $<
$(CYTHON) --cplus $<
install:
$(PIP) install .
......
......@@ -78,6 +78,13 @@ Please see the developer documentation [here](https://pysndfile.readthedocs.io/e
## Changes
### Version_1.3.7 (dev1)
* 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.
### Version_1.3.6 (2019-07-27)
* fixed potential but undesired build dependency of pandoc
......
......@@ -23,6 +23,7 @@
#
# cython: embedsignature=True
# cython: language_level=2
import numpy as np
import warnings
......@@ -34,10 +35,10 @@ from libcpp.string cimport string
cdef extern from "Python.h":
ctypedef int Py_intptr_t
_pysndfile_version=(1,3,6)
_pysndfile_version=(1, 3, 7, "dev1")
def get_pysndfile_version():
"""
return tuple describing the version opf pysndfile
return tuple describing the version of pysndfile
"""
return _pysndfile_version
......
Changes
-------
Version_1.3.7 (dev1)
~~~~~~~~~~~~~~~~~~~~
- 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.
Version_1.3.6 (2019-07-27)
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -6,6 +6,7 @@ import shutil
import subprocess
import re
import numpy as np
import hashlib
from setuptools import setup
from distutils.core import Extension
......@@ -21,7 +22,6 @@ try :
except Exception:
pass
compile_for_RTD = "READTHEDOCS" in os.environ
if compile_for_RTD:
......@@ -38,7 +38,10 @@ else:
try :
from Cython.Build import cythonize
ext_modules = cythonize(ext_modules, force=compile_for_RTD )
# dont adapt language level to python
# languge_level is hard-coded in the pyx source
#ext_modules = cythonize(ext_modules, force=compile_for_RTD, language_level=sys.version_info[0])
ext_modules = cythonize(ext_modules, force=compile_for_RTD, language_level=2)
except ImportError :
print("cannot import cythonize - to be able to cythonize the source please install cython")
sys.exit(1)
......@@ -115,9 +118,13 @@ class build_ext_subclass( build_ext ):
# get _pysndfile version number
for line in open("_pysndfile.pyx") :
if "_pysndfile_version=" in line:
_pysndfile_version_str = re.split('[()]', line)[1].replace(',','.')
_pysndfile_version_str = re.split('[()]', line)[1].replace(',','.',3).replace(',','-',1).replace('"','').replace(' ','')
break
if sys.argv[1] == "get_version":
print(_pysndfile_version_str)
sys.exit(0)
README_path = os.path.join(os.path.dirname(__file__), 'README.md')
README_cksum_path = os.path.join(os.path.dirname(__file__), 'README.md.cksum')
......@@ -129,7 +136,7 @@ def read_readme_checksum():
try:
with open(README_cksum_path, "r") as fi:
rdlen, rdsum = fi.read().split()
return int(rdlen), int(rdsum)
return rdlen, rdsum
except OSError:
return 0, 0
......@@ -137,7 +144,7 @@ def calc_readme_checksum():
readme = open(README_path).read()
readme_length = len(readme)
readme_sum = sum(bytes(readme, encoding="utf8"))
readme_sum = hashlib.sha256(bytes(readme, encoding="utf8")).hexdigest()
return readme_length, readme_sum
......@@ -149,8 +156,8 @@ 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()
rrdck = read_readme_checksum()
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))
......