Browse Source

try deploy

tb 2.1.2
ofek 7 years ago
parent
commit
417e726f55
  1. 8
      .travis.yml
  2. 4
      .travis/build_windows_wheels.sh
  3. 7
      .travis/deploy.sh
  4. 1
      .travis/install.sh
  5. 15
      coincurve/utils.py
  6. 2
      setup.py

8
.travis.yml

@ -36,14 +36,6 @@ matrix:
env:
- NEED_SSL_FIX=true
- TRAVIS_PYTHON_VERSION=3.6
- os: linux
language: python
python: 2.7
sudo: required
services:
- docker
env:
- BUILD_LINUX_WHEELS=1
- os: linux
language: python
python: 3.5

4
.travis/build_windows_wheels.sh

@ -19,14 +19,14 @@ cd 64bit
build_dll x86_64-w64-mingw32
mv .libs/libsecp256k1-0.dll ../clean/coincurve/libsecp256k1.dll
cd ../clean
python setup.py bdist_wheel --plat-name=win_amd64
python setup.py bdist_wheel --universal --plat-name=win_amd64
rm coincurve/libsecp256k1.dll
cd ../32bit
build_dll i686-w64-mingw32
mv .libs/libsecp256k1-0.dll ../clean/coincurve/libsecp256k1.dll
cd ../clean
python setup.py bdist_wheel --plat-name=win32
python setup.py bdist_wheel --universal --plat-name=win32
mv dist/* ../coincurve/dist/
cd ../coincurve

7
.travis/deploy.sh

@ -11,11 +11,8 @@ mkdir dist
python setup.py sdist
if [[ "$TRAVIS_OS_NAME" == "linux" && ${BUILD_LINUX_WHEELS} -eq 1 ]]; then
if [ "$TRAVIS_PYTHON_VERSION" == "3.5" ]
then
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /io/.travis/build-linux-wheels.sh
linux32 docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_i686 /io/.travis/build-linux-wheels.sh
fi
docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /io/.travis/build-linux-wheels.sh
linux32 docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_i686 /io/.travis/build-linux-wheels.sh
.travis/build_windows_wheels.sh
else
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then

1
.travis/install.sh

@ -10,7 +10,6 @@ if [[ $TRAVIS_OS_NAME == "osx" ]]; then
# We use the official python.org installers to make sure our wheels are
# going to be as widely compatible as possible
PYTHON_PKG_27="https://www.python.org/ftp/python/2.7.12/python-2.7.12-macosx10.6.pkg"
PYTHON_PKG_34="https://www.python.org/ftp/python/3.4.4/python-3.4.4-macosx10.6.pkg"
PYTHON_PKG_35="https://www.python.org/ftp/python/3.5.2/python-3.5.2-macosx10.6.pkg"
PYTHON_PKG_36="https://www.python.org/ftp/python/3.6.1/python-3.6.1-macosx10.6.pkg"
GET_PIP="https://bootstrap.pypa.io/get-pip.py"

15
coincurve/utils.py

@ -30,17 +30,20 @@ else:
if hasattr(int, "to_bytes"):
def int_to_bytes(num):
return num.to_bytes((num.bit_length() + 7) // 8 or 1, 'big')
def int_to_bytes(num, length=None):
return length or num.to_bytes((num.bit_length() + 7) // 8 or 1, 'big')
else:
def int_to_bytes(num):
def int_to_bytes(num, length=None):
hexed = '%x' % num
# Handle odd-length hex strings.
if len(hexed) & 1:
hexed = '0' + hexed
return unhexlify(hexed)
if not length:
return unhexlify(hexed)
return pad_scalar(unhexlify(hexed), length)
def sha256(bytestr):
@ -72,8 +75,8 @@ def get_valid_secret():
return secret
def pad_scalar(scalar):
return (ZERO * (KEY_SIZE - len(scalar))) + scalar
def pad_scalar(scalar, length=KEY_SIZE):
return (ZERO * (length - len(scalar))) + scalar
def validate_secret(secret):

2
setup.py

@ -261,7 +261,7 @@ else:
setup(
name='coincurve',
version='2.1.1',
version='2.1.2',
description='Cross-platform Python CFFI bindings for libsecp256k1',
long_description=open('README.rst', 'r').read(),

Loading…
Cancel
Save