jesse-rust 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jesse_rust-0.1.3/.github/workflows/build-and-publish.yml +187 -0
- jesse_rust-0.1.3/.gitignore +95 -0
- jesse_rust-0.1.3/CROSS_COMPILE_SETUP.md +141 -0
- jesse_rust-0.1.3/Cargo.lock +374 -0
- jesse_rust-0.1.3/Cargo.toml +31 -0
- jesse_rust-0.1.3/LICENSE +21 -0
- jesse_rust-0.1.3/MANIFEST.in +9 -0
- jesse_rust-0.1.3/PKG-INFO +131 -0
- jesse_rust-0.1.3/PUBLISHING.md +209 -0
- jesse_rust-0.1.3/README.md +99 -0
- jesse_rust-0.1.3/__init__.py +11 -0
- jesse_rust-0.1.3/build-all-wheels.sh +164 -0
- jesse_rust-0.1.3/build-comprehensive.sh +215 -0
- jesse_rust-0.1.3/build-local.ps1 +55 -0
- jesse_rust-0.1.3/build-local.sh +54 -0
- jesse_rust-0.1.3/build-quick.sh +50 -0
- jesse_rust-0.1.3/pyproject.toml +66 -0
- jesse_rust-0.1.3/src/indicators.rs +2043 -0
- jesse_rust-0.1.3/src/lib.rs +45 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
name: Build and Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
tags: [ 'v*' ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main, master ]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
linux:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
target: [x86_64, aarch64]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@v4
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.11'
|
|
27
|
+
|
|
28
|
+
- name: Build wheels
|
|
29
|
+
uses: PyO3/maturin-action@v1
|
|
30
|
+
with:
|
|
31
|
+
target: ${{ matrix.target }}
|
|
32
|
+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13
|
|
33
|
+
sccache: 'true'
|
|
34
|
+
manylinux: auto
|
|
35
|
+
env:
|
|
36
|
+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
|
|
37
|
+
|
|
38
|
+
- name: Upload wheels
|
|
39
|
+
uses: actions/upload-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: wheels-linux-${{ matrix.target }}
|
|
42
|
+
path: dist
|
|
43
|
+
|
|
44
|
+
windows:
|
|
45
|
+
runs-on: windows-latest
|
|
46
|
+
strategy:
|
|
47
|
+
matrix:
|
|
48
|
+
target: [x64]
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
|
|
52
|
+
- uses: actions/setup-python@v4
|
|
53
|
+
with:
|
|
54
|
+
python-version: '3.11'
|
|
55
|
+
architecture: ${{ matrix.target }}
|
|
56
|
+
|
|
57
|
+
- name: Build wheels
|
|
58
|
+
uses: PyO3/maturin-action@v1
|
|
59
|
+
with:
|
|
60
|
+
target: ${{ matrix.target }}
|
|
61
|
+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13
|
|
62
|
+
sccache: 'true'
|
|
63
|
+
env:
|
|
64
|
+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
|
|
65
|
+
|
|
66
|
+
- name: Upload wheels
|
|
67
|
+
uses: actions/upload-artifact@v4
|
|
68
|
+
with:
|
|
69
|
+
name: wheels-windows-${{ matrix.target }}
|
|
70
|
+
path: dist
|
|
71
|
+
|
|
72
|
+
macos:
|
|
73
|
+
runs-on: macos-latest
|
|
74
|
+
strategy:
|
|
75
|
+
matrix:
|
|
76
|
+
target: [x86_64, aarch64]
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v4
|
|
79
|
+
|
|
80
|
+
- uses: actions/setup-python@v4
|
|
81
|
+
with:
|
|
82
|
+
python-version: '3.11'
|
|
83
|
+
|
|
84
|
+
- name: Build wheels
|
|
85
|
+
uses: PyO3/maturin-action@v1
|
|
86
|
+
with:
|
|
87
|
+
target: ${{ matrix.target }}
|
|
88
|
+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13
|
|
89
|
+
sccache: 'true'
|
|
90
|
+
env:
|
|
91
|
+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
|
|
92
|
+
|
|
93
|
+
- name: Upload wheels
|
|
94
|
+
uses: actions/upload-artifact@v4
|
|
95
|
+
with:
|
|
96
|
+
name: wheels-macos-${{ matrix.target }}
|
|
97
|
+
path: dist
|
|
98
|
+
|
|
99
|
+
sdist:
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
|
|
104
|
+
- name: Build sdist
|
|
105
|
+
uses: PyO3/maturin-action@v1
|
|
106
|
+
with:
|
|
107
|
+
command: sdist
|
|
108
|
+
args: --out dist
|
|
109
|
+
|
|
110
|
+
- name: Upload sdist
|
|
111
|
+
uses: actions/upload-artifact@v4
|
|
112
|
+
with:
|
|
113
|
+
name: wheels-sdist
|
|
114
|
+
path: dist
|
|
115
|
+
|
|
116
|
+
test:
|
|
117
|
+
needs: [linux, windows, macos, sdist]
|
|
118
|
+
runs-on: ${{ matrix.os }}
|
|
119
|
+
strategy:
|
|
120
|
+
matrix:
|
|
121
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
122
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
123
|
+
exclude:
|
|
124
|
+
# Reduce matrix size for faster builds
|
|
125
|
+
- os: windows-latest
|
|
126
|
+
python-version: '3.10'
|
|
127
|
+
- os: macos-latest
|
|
128
|
+
python-version: '3.10'
|
|
129
|
+
|
|
130
|
+
steps:
|
|
131
|
+
- uses: actions/checkout@v4
|
|
132
|
+
|
|
133
|
+
- uses: actions/setup-python@v4
|
|
134
|
+
with:
|
|
135
|
+
python-version: ${{ matrix.python-version }}
|
|
136
|
+
|
|
137
|
+
- name: Download wheels
|
|
138
|
+
uses: actions/download-artifact@v4
|
|
139
|
+
with:
|
|
140
|
+
pattern: wheels-*
|
|
141
|
+
path: dist
|
|
142
|
+
merge-multiple: true
|
|
143
|
+
|
|
144
|
+
- name: Install wheel
|
|
145
|
+
shell: bash
|
|
146
|
+
run: |
|
|
147
|
+
python -m pip install --upgrade pip
|
|
148
|
+
python -m pip install numpy
|
|
149
|
+
# Find and install the appropriate wheel for this platform
|
|
150
|
+
python -m pip install --find-links dist --no-index jesse-rust
|
|
151
|
+
|
|
152
|
+
- name: Test import
|
|
153
|
+
run: |
|
|
154
|
+
python -c "import jesse_rust; print('jesse_rust imported successfully')"
|
|
155
|
+
|
|
156
|
+
- name: Run basic tests
|
|
157
|
+
run: |
|
|
158
|
+
python -c "
|
|
159
|
+
import jesse_rust
|
|
160
|
+
import numpy as np
|
|
161
|
+
|
|
162
|
+
# Test that the module loads and basic functionality works
|
|
163
|
+
print('Module loaded successfully')
|
|
164
|
+
print('Available functions:', [name for name in dir(jesse_rust) if not name.startswith('_')])
|
|
165
|
+
"
|
|
166
|
+
|
|
167
|
+
publish:
|
|
168
|
+
name: Publish to PyPI
|
|
169
|
+
runs-on: ubuntu-latest
|
|
170
|
+
needs: [test]
|
|
171
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
172
|
+
|
|
173
|
+
steps:
|
|
174
|
+
- name: Download wheels
|
|
175
|
+
uses: actions/download-artifact@v4
|
|
176
|
+
with:
|
|
177
|
+
pattern: wheels-*
|
|
178
|
+
path: dist
|
|
179
|
+
merge-multiple: true
|
|
180
|
+
|
|
181
|
+
- name: Publish to PyPI
|
|
182
|
+
uses: PyO3/maturin-action@v1
|
|
183
|
+
with:
|
|
184
|
+
command: upload
|
|
185
|
+
args: --non-interactive --skip-existing dist/*
|
|
186
|
+
env:
|
|
187
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Rust artifacts
|
|
2
|
+
/target/
|
|
3
|
+
**/*.rs.bk
|
|
4
|
+
*.pdb
|
|
5
|
+
Cargo.lock
|
|
6
|
+
|
|
7
|
+
# Python artifacts
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*$py.class
|
|
11
|
+
*.so
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyPI publishing
|
|
32
|
+
.pypirc
|
|
33
|
+
*.whl
|
|
34
|
+
*.tar.gz
|
|
35
|
+
|
|
36
|
+
# Virtual environments
|
|
37
|
+
.env
|
|
38
|
+
.venv
|
|
39
|
+
env/
|
|
40
|
+
venv/
|
|
41
|
+
ENV/
|
|
42
|
+
env.bak/
|
|
43
|
+
venv.bak/
|
|
44
|
+
|
|
45
|
+
# IDE and editor files
|
|
46
|
+
.vscode/
|
|
47
|
+
.idea/
|
|
48
|
+
*.swp
|
|
49
|
+
*.swo
|
|
50
|
+
*~
|
|
51
|
+
.DS_Store
|
|
52
|
+
Thumbs.db
|
|
53
|
+
|
|
54
|
+
# OS files
|
|
55
|
+
.DS_Store?
|
|
56
|
+
ehthumbs.db
|
|
57
|
+
Icon?
|
|
58
|
+
Thumbs.db
|
|
59
|
+
|
|
60
|
+
# Logs
|
|
61
|
+
*.log
|
|
62
|
+
|
|
63
|
+
# Testing
|
|
64
|
+
.coverage
|
|
65
|
+
.pytest_cache/
|
|
66
|
+
.tox/
|
|
67
|
+
.nox/
|
|
68
|
+
htmlcov/
|
|
69
|
+
.cache
|
|
70
|
+
nosetests.xml
|
|
71
|
+
coverage.xml
|
|
72
|
+
*.cover
|
|
73
|
+
*.py,cover
|
|
74
|
+
.hypothesis/
|
|
75
|
+
|
|
76
|
+
# Documentation
|
|
77
|
+
docs/_build/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# Environment variables
|
|
87
|
+
.env.local
|
|
88
|
+
.env.development.local
|
|
89
|
+
.env.test.local
|
|
90
|
+
.env.production.local
|
|
91
|
+
|
|
92
|
+
# Temporary files
|
|
93
|
+
*.tmp
|
|
94
|
+
*.temp
|
|
95
|
+
.temp/
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Cross-Compilation Setup for Jesse Rust
|
|
2
|
+
|
|
3
|
+
This guide explains how to set up cross-compilation for building Python wheels locally instead of using GitHub Actions.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
The easiest way to get started is to use the provided build script:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
./build-all-wheels.sh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This will give you options for different build methods.
|
|
14
|
+
|
|
15
|
+
## Build Methods
|
|
16
|
+
|
|
17
|
+
### 1. Native Build (Simplest)
|
|
18
|
+
Builds only for your current platform:
|
|
19
|
+
```bash
|
|
20
|
+
maturin build --release --out dist
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Cross-Compilation (Fast)
|
|
24
|
+
Uses Rust's cross-compilation capabilities. Works best on macOS for multiple targets:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Install targets
|
|
28
|
+
rustup target add x86_64-apple-darwin aarch64-apple-darwin
|
|
29
|
+
|
|
30
|
+
# Build for both architectures
|
|
31
|
+
maturin build --release --target x86_64-apple-darwin --out dist
|
|
32
|
+
maturin build --release --target aarch64-apple-darwin --out dist
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 3. cibuildwheel (Most Comprehensive)
|
|
36
|
+
Uses Docker containers to build for multiple platforms:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install cibuildwheel
|
|
40
|
+
cibuildwheel --platform auto --output-dir dist
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Platform-Specific Setup
|
|
44
|
+
|
|
45
|
+
### macOS (Recommended for cross-compilation)
|
|
46
|
+
On macOS, you can easily build for both Intel and Apple Silicon:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Install Xcode command line tools (if not already installed)
|
|
50
|
+
xcode-select --install
|
|
51
|
+
|
|
52
|
+
# Install targets
|
|
53
|
+
rustup target add x86_64-apple-darwin
|
|
54
|
+
rustup target add aarch64-apple-darwin
|
|
55
|
+
|
|
56
|
+
# Build
|
|
57
|
+
./build-all-wheels.sh
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Linux
|
|
61
|
+
For Linux, you can build for multiple architectures but need additional setup:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Install cross-compilation tools
|
|
65
|
+
sudo apt-get install gcc-aarch64-linux-gnu # For ARM64
|
|
66
|
+
|
|
67
|
+
# Install targets
|
|
68
|
+
rustup target add aarch64-unknown-linux-gnu
|
|
69
|
+
|
|
70
|
+
# Build
|
|
71
|
+
./build-all-wheels.sh
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Windows
|
|
75
|
+
On Windows, use the PowerShell script or WSL:
|
|
76
|
+
|
|
77
|
+
```powershell
|
|
78
|
+
# Use the existing PowerShell script
|
|
79
|
+
./build-local.ps1
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Environment Variables
|
|
83
|
+
|
|
84
|
+
Set these environment variables for PyPI publishing:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
export MATURIN_PYPI_TOKEN="your_pypi_token_here"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Comparison: Local vs GitHub Actions
|
|
91
|
+
|
|
92
|
+
### Local Cross-Compilation Advantages:
|
|
93
|
+
- ✅ **Faster**: No waiting for CI queue
|
|
94
|
+
- ✅ **Immediate feedback**: Test builds instantly
|
|
95
|
+
- ✅ **Control**: Full control over build environment
|
|
96
|
+
- ✅ **Debugging**: Easier to debug build issues
|
|
97
|
+
- ✅ **Cost**: No CI minutes usage
|
|
98
|
+
|
|
99
|
+
### GitHub Actions Advantages:
|
|
100
|
+
- ✅ **Comprehensive**: Builds for all platforms reliably
|
|
101
|
+
- ✅ **Testing**: Automatic testing on all platforms
|
|
102
|
+
- ✅ **Automation**: Triggers on tags/releases
|
|
103
|
+
- ✅ **Consistency**: Same environment every time
|
|
104
|
+
- ✅ **Windows support**: Better Windows cross-compilation
|
|
105
|
+
|
|
106
|
+
## Recommended Workflow
|
|
107
|
+
|
|
108
|
+
1. **Development**: Use local native builds for quick iteration
|
|
109
|
+
2. **Testing**: Use cross-compilation for testing on multiple platforms
|
|
110
|
+
3. **Release**: Use either local build + manual upload or keep GitHub Actions
|
|
111
|
+
|
|
112
|
+
## Publishing to PyPI
|
|
113
|
+
|
|
114
|
+
After building wheels locally:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Publish all wheels
|
|
118
|
+
maturin publish --skip-existing dist/*
|
|
119
|
+
|
|
120
|
+
# Or with specific token
|
|
121
|
+
MATURIN_PYPI_TOKEN=your_token maturin publish --skip-existing dist/*
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Troubleshooting
|
|
125
|
+
|
|
126
|
+
### Common Issues:
|
|
127
|
+
1. **Missing cross-compilation tools**: Install platform-specific toolchains
|
|
128
|
+
2. **Target not found**: Run `rustup target add <target>`
|
|
129
|
+
3. **Permission denied**: Run `chmod +x build-all-wheels.sh`
|
|
130
|
+
4. **Docker not running**: Start Docker for cibuildwheel
|
|
131
|
+
|
|
132
|
+
### Platform-Specific Issues:
|
|
133
|
+
- **macOS**: Make sure Xcode CLI tools are installed
|
|
134
|
+
- **Linux**: Install cross-compilation GCC toolchains
|
|
135
|
+
- **Windows**: Consider using WSL or keep using GitHub Actions
|
|
136
|
+
|
|
137
|
+
## Next Steps
|
|
138
|
+
|
|
139
|
+
1. Try the `./build-all-wheels.sh` script
|
|
140
|
+
2. Choose the build method that works best for your setup
|
|
141
|
+
3. Consider keeping GitHub Actions for releases but using local builds for development
|