Skip to content

Commit a6f9ebc

Browse files
committed
Add CI workflows, refactor structure, and update metadata
Introduces GitHub Actions workflows for integration, CodeQL analysis, and wheel building. Refactors example.py to examples/basic_usage.py, reorganizes wallet modules, and updates MANIFEST.in for improved packaging. Adds compiler_opt.py for build-time compiler feature detection. Updates pyproject.toml and adds setup.cfg for project metadata and configuration. Removes legacy test files and C test sources.
1 parent 142ed82 commit a6f9ebc

File tree

173 files changed

+3975
-7887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+3975
-7887
lines changed

.github/codeql/codeql-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
paths-ignore:
2+
- src/libcrypto/Core/
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ master, codeql_debug ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ master ]
9+
schedule:
10+
- cron: '35 8 * * 1'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
language: [ 'cpp', 'python' ]
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
# Initializes the CodeQL tools for scanning.
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v2
29+
with:
30+
languages: ${{ matrix.language }}
31+
# If you wish to specify custom queries, you can do so here or in a config file.
32+
# By default, queries listed here will override any specified in a config file.
33+
# Prefix the list here with "+" to use these queries and those in the config file.
34+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
35+
config-file: ./.github/codeql/codeql-config.yml
36+
37+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
38+
# If this step fails, then you should remove it and run the build manually (see below)
39+
- name: Autobuild
40+
uses: github/codeql-action/autobuild@v2
41+
42+
- name: Perform CodeQL Analysis
43+
uses: github/codeql-action/analyze@v2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Specify the CMake version
2+
set(CMAKE_SYSTEM_NAME Linux)
3+
set(CMAKE_SYSTEM_PROCESSOR i386)
4+
set(CMAKE_C_COMPILER gcc)
5+
6+
# Specify the compiler flags
7+
set(CMAKE_C_FLAGS "-m32")
8+
set(CMAKE_CXX_FLAGS "-m32")
9+
10+
# Specify the linker flags
11+
set(CMAKE_SHARED_LINKER_FLAGS "-m32")
12+
set(CMAKE_EXE_LINKER_FLAGS "-m32")
13+
14+
# Specify the paths to search for libraries and includes
15+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
16+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
17+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

.github/workflows/integration.yml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
name: Integration
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13" ]
11+
cffi: [ yes, no ]
12+
os: [ ubuntu-22.04 ]
13+
include:
14+
- python-version: "3.13"
15+
cffi: yes
16+
os: macos-13
17+
- python-version: "3.13"
18+
cffi: no
19+
os: windows-latest
20+
- python-version: "3.13"
21+
cffi: yes
22+
os: windows-latest
23+
- python-version: "3.13"
24+
cffi: no
25+
os: windows-11-arm
26+
- python-version: "3.13"
27+
cffi: yes
28+
os: windows-11-arm
29+
- python-version: pypy2.7
30+
cffi: no
31+
os: ubuntu-latest
32+
- python-version: pypy3.9
33+
cffi: no
34+
os: ubuntu-latest
35+
- python-version: "3.13"
36+
cffi: yes
37+
os: ubuntu-22.04-arm
38+
env:
39+
CFLAGS: "-Wconversion"
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
49+
- name: Display Python version
50+
run: python -c "from __future__ import print_function; import sys; print(sys.version)"
51+
52+
- name: Install CFFI
53+
if: matrix.cffi == 'yes'
54+
run: pip install cffi
55+
56+
- name: Install dependencies (testing only)
57+
run: |
58+
pip install -r requirements-dev.txt
59+
60+
- name: Install package
61+
run: |
62+
pip install -v .
63+
64+
65+
build_python_27:
66+
# GitHub Actions will not setup Python 2.7 since June 2023
67+
runs-on: ${{ matrix.os }}
68+
strategy:
69+
matrix:
70+
os: [ ubuntu-22.04, windows-latest ]
71+
cffi: [ yes, no ]
72+
include:
73+
- os: ubuntu-22.04
74+
container: python:2.7.18-buster
75+
container:
76+
image: ${{ matrix.container }}
77+
env:
78+
CFLAGS: "-Wconversion"
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Install Python 2
84+
if: matrix.os == 'windows-latest'
85+
run: |
86+
choco install python2
87+
88+
- name: Install MSVC
89+
if: matrix.os == 'windows-latest'
90+
uses: ilammy/msvc-dev-cmd@v1
91+
92+
- name: Prepare environmental variables
93+
if: matrix.os == 'windows-latest'
94+
shell: bash
95+
run: |
96+
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
97+
echo "MSSdk=1" >> $GITHUB_ENV
98+
echo "C:\\Python27;$(cat $GITHUB_PATH)" >> $GITHUB_PATH
99+
cat $GITHUB_PATH
100+
101+
- name: Display Python version
102+
run: python -c "from __future__ import print_function; import sys; print(sys.version)"
103+
104+
- name: Install CFFI
105+
if: matrix.cffi == 'yes'
106+
run: python -m pip install cffi
107+
108+
- name: Install dependencies (testing only)
109+
run: |
110+
python -m pip install -r requirements-dev.txt
111+
112+
- name: Install package
113+
run: |
114+
python -m pip install -v .
115+
116+
117+
mypy:
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/checkout@v4
121+
- name: Set up Python
122+
uses: actions/setup-python@v5
123+
with:
124+
python-version: "3.x"
125+
- name: Install dependencies
126+
run: |
127+
pip install mypy -r requirements-dev.txt
128+
- name: Test
129+
run: |
130+
mypy --enable-incomplete-feature=Unpack src/
131+
132+
test_c_linux:
133+
runs-on: ubuntu-latest
134+
strategy:
135+
matrix:
136+
sse: [ 0, 1 ]
137+
arch: [ x64, x32 ]
138+
steps:
139+
- uses: actions/checkout@v4
140+
- name: Install dependencies
141+
run: |
142+
sudo apt-get update
143+
sudo apt-get install libc6-dev-i386 libubsan1
144+
- name: Test Linux x32 and x64
145+
run: |
146+
cd src/test
147+
mkdir build
148+
GCC_M32_TOOLCHAIN=${{ github.workspace }}/.github/workflows/gcc_m32_toolchain.txt
149+
EXTRA=$([ ${{ matrix.arch }} = x32 ] && echo "-DCMAKE_TOOLCHAIN_FILE=$GCC_M32_TOOLCHAIN" || true)
150+
cmake -B build -DSSE=${{ matrix.sse }} $EXTRA
151+
make -C build all test
152+
153+
test_c_windows:
154+
runs-on: ${{ matrix.os }}
155+
strategy:
156+
matrix:
157+
include:
158+
- os: windows-latest
159+
arch: x64
160+
- os: windows-latest
161+
arch: win32
162+
- os: windows-11-arm
163+
arch: arm64
164+
steps:
165+
- uses: actions/checkout@v4
166+
- name: Set up Python "3.13"
167+
uses: actions/setup-python@v5
168+
with:
169+
python-version: "3.13"
170+
- name: Install MSVC
171+
uses: ilammy/msvc-dev-cmd@v1
172+
with:
173+
arch: ${{ matrix.arch }}
174+
- name: Test Windows 32 and 64
175+
run: |
176+
cd src/test
177+
mkdir build
178+
cmake -B build -G "NMake Makefiles"
179+
cd build
180+
nmake all test
181+
182+
python_no_gil:
183+
runs-on: ubuntu-latest
184+
env:
185+
CFLAGS: "-Wconversion"
186+
steps:
187+
- uses: actions/checkout@v4
188+
- name: No-GIL Python
189+
uses: deadsnakes/[email protected]
190+
with:
191+
python-version: "3.13"
192+
nogil: true
193+
194+
- name: Install dependencies (testing only)
195+
run: |
196+
pip install -r requirements-dev.txt
197+
198+
- name: Install package
199+
run: |
200+
pip install -v .

0 commit comments

Comments
 (0)