Browse Source

update (#109)

* update

* bump cibuildwheel

* try

* .

* Update build.yml

* Update build.yml

* Update build.yml

* .

* .

* .

* Update build-windows-wheels.sh

* .
master
Ofek Lev 2 years ago
committed by GitHub
parent
commit
3927a27104
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .github/scripts/build-windows-wheels.sh
  2. 8
      .github/scripts/install-linux-build-deps.sh
  3. 87
      .github/workflows/build.yml
  4. 6
      docs/history.md
  5. 1
      docs/index.md
  6. 7
      docs/install.md
  7. 7
      setup.py
  8. 1
      tox.ini

1
.github/scripts/build-windows-wheels.sh

@ -3,7 +3,6 @@ set -ex
build_dll() {
./autogen.sh
echo "LDFLAGS = -no-undefined" >> Makefile.am
./configure --host=$1 --enable-module-recovery --enable-experimental --enable-module-ecdh --enable-benchmark=no --enable-tests=no --enable-openssl-tests=no --enable-exhaustive-tests=no --enable-static --disable-dependency-tracking --with-pic
make
}

8
.github/scripts/install-linux-build-deps.sh

@ -1,8 +0,0 @@
#!/bin/sh
set -ex
# Find out what we're emulating
ARCH="$(python -c 'import platform;print(platform.machine())')"
# Use updated GMP
curl -O https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.bz2 && tar -xjpf gmp-*.tar.bz2 && cd gmp* && ./configure --build=${ARCH}-pc-linux-gnu > /dev/null && make > /dev/null && make check > /dev/null && make install > /dev/null && cd ..

87
.github/workflows/build.yml

@ -1,10 +1,9 @@
name: build
on:
create:
push:
tags:
- v*
push:
branches:
- master
pull_request:
@ -16,9 +15,12 @@ concurrency:
cancel-in-progress: true
env:
COINCURVE_UPSTREAM_REF: f2d9aeae6d5a7c7fbbba8bbb38b1849b784beef7
COINCURVE_UPSTREAM_REF: d8a246324650c3df8d54d133a8ac3c1b857a7a4e
COINCURVE_IGNORE_SYSTEM_LIB: '1'
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh
CIBW_ENVIRONMENT_PASS_LINUX: >
COINCURVE_UPSTREAM_REF
COINCURVE_IGNORE_SYSTEM_LIB
CIBW_TEST_COMMAND: >
python -c
"from coincurve import PrivateKey;
@ -26,13 +28,12 @@ env:
b=PrivateKey();
assert a.ecdh(b.public_key.format())==b.ecdh(a.public_key.format())
"
CIBW_BEFORE_ALL_LINUX: ./.github/scripts/install-linux-build-deps.sh
CIBW_SKIP: >
pp*
jobs:
test:
name: Test latest
name: Test latest Python
runs-on: ubuntu-latest
env:
@ -69,24 +70,59 @@ jobs:
- name: Upload coverage
run: codecov -X gcov
unix-wheels-standard:
name: Build ${{ startsWith(matrix.os, 'macos-') && 'macOS' || 'Linux' }} wheels
linux-wheels-standard:
name: Build Linux wheels
needs:
- test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
- uses: actions/upload-artifact@v2
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error
macos-wheels-x86-64:
name: Build macOS wheels
needs:
- test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15]
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.0
uses: pypa/cibuildwheel@v2.3.1
env:
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_MACOS: x86_64
- uses: actions/upload-artifact@v2
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error
macos-wheels-arm:
name: Build macOS wheels for ARM
needs:
- test
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
env:
CIBW_ARCHS_MACOS: arm64
COINCURVE_CROSS_HOST: aarch64-apple-darwin
CFLAGS: -target arm64-apple-macos11
- uses: actions/upload-artifact@v2
with:
@ -118,15 +154,15 @@ jobs:
path: dist/*
if-no-files-found: error
unix-wheels-arm:
linux-wheels-arm:
name: Build Linux wheels for ARM
needs:
- test
runs-on: ubuntu-20.04
if: >
(github.event_name == 'push' && github.ref == 'refs/heads/master')
||
(github.event_name == 'create' && github.event.ref_type == 'tag')
github.event_name == 'push'
&&
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags'))
steps:
- uses: actions/checkout@v2
@ -137,7 +173,7 @@ jobs:
platforms: arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.0
uses: pypa/cibuildwheel@v2.3.1
env:
CIBW_ARCHS_LINUX: aarch64
@ -150,11 +186,16 @@ jobs:
publish:
name: Publish release
needs:
- unix-wheels-standard
- linux-wheels-standard
- macos-wheels-x86-64
- macos-wheels-arm
- windows-wheels-and-sdist
- unix-wheels-arm
- linux-wheels-arm
runs-on: ubuntu-latest
if: github.event_name == 'create' && github.event.ref_type == 'tag'
if: >
github.event_name == 'push'
&&
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags'))
steps:
- uses: actions/download-artifact@v2

6
docs/history.md

@ -6,6 +6,12 @@ Important changes are emphasized.
## master
## Unreleased
- **Breaking:** Drop support for Python 3.6
- Fix wheels for Apple M1
- Upgrade [libsecp256k1][] to the latest available version
## 16.0.0
- Wheels for Apple Silicon and musl linux (Alpine)

1
docs/index.md

@ -18,7 +18,6 @@ C library used by [Bitcoin Core][] for operations on the elliptic curve [secp256
- Clean, easy to use API
- Frequent updates from the development version of [libsecp256k1][]
- Linux, macOS, and Windows all have binary packages for multiple architectures
- Linux & macOS use GMP for faster computation
- Deterministic signatures as specified by [RFC 6979][]
- Non-malleable signatures (lower-S form) by default
- Secure, non-malleable [ECDH][] implementation

7
docs/install.md

@ -15,11 +15,10 @@ Binary wheels are available for most platforms and require at least version `19.
| | | | | |
| --- | --- | --- | --- | --- |
| | macOS | Windows | Linux (glibc) | Linux (musl) |
| CPython 3.6 | <ul><li>x86_64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.7 | <ul><li>x86_64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.8 | <ul><li>x86_64</li><li>Apple Silicon</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.9 | <ul><li>x86_64</li><li>Apple Silicon</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.10 | <ul><li>x86_64</li><li>Apple Silicon</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.8 | <ul><li>x86_64</li><li>ARM64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.9 | <ul><li>x86_64</li><li>ARM64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
| CPython 3.10 | <ul><li>x86_64</li><li>ARM64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> |
## Source

7
setup.py

@ -35,7 +35,7 @@ MAKE = 'gmake' if platform.system() in ['FreeBSD', 'OpenBSD'] else 'make'
# IMPORTANT: keep in sync with .github/workflows/build.yml
#
# Version of libsecp256k1 to download if none exists in the `libsecp256k1` directory
UPSTREAM_REF = os.getenv('COINCURVE_UPSTREAM_REF') or 'f2d9aeae6d5a7c7fbbba8bbb38b1849b784beef7'
UPSTREAM_REF = os.getenv('COINCURVE_UPSTREAM_REF') or 'd8a246324650c3df8d54d133a8ac3c1b857a7a4e'
LIB_TARBALL_URL = f'https://github.com/bitcoin-core/secp256k1/archive/{UPSTREAM_REF}.tar.gz'
@ -188,6 +188,8 @@ class build_clib(_build_clib):
'--enable-openssl-tests=no',
'--enable-exhaustive-tests=no',
]
if 'COINCURVE_CROSS_HOST' in os.environ:
cmd.append('--host={}'.format(os.environ['COINCURVE_CROSS_HOST']))
log.debug('Running configure: {}'.format(' '.join(cmd)))
subprocess.check_call(cmd, cwd=build_temp)
@ -269,7 +271,7 @@ setup(
author_email='Ofek Lev <oss@ofek.dev>',
license='MIT OR Apache-2.0',
python_requires='>=3.6',
python_requires='>=3.7',
install_requires=['asn1crypto', 'cffi>=1.3.0'],
packages=find_packages(exclude=('_cffi_build', '_cffi_build.*', 'libsecp256k1', 'tests')),
@ -299,7 +301,6 @@ setup(
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',

1
tox.ini

@ -1,7 +1,6 @@
[tox]
skip_missing_interpreters = true
envlist =
3.6
3.7
3.8
3.9

Loading…
Cancel
Save