-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrailway-build-webhook.sh
More file actions
executable file
·82 lines (66 loc) · 2.41 KB
/
railway-build-webhook.sh
File metadata and controls
executable file
·82 lines (66 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Ce webhook est destiné à Railway pour déployer automatiquement votre application
# URL: https://railway.app/project/YOUR_PROJECT_ID/service/YOUR_SERVICE_ID/settings
# Webhook Type: Build
# Cliquez sur "Create Webhook" et copiez l'URL générée
#!/bin/bash
# Installation de NumPy dans une version compatible
pip install numpy==1.24.3
# Attempt 1: Install from anaconda repository
pip install --index-url https://pypi.anaconda.org/ranaroussi/simple ta-lib==0.4.28
# If that fails, attempt 2: Install from GitHub source
if [ $? -ne 0 ]; then
echo "Installing TA-Lib from GitHub..."
pip install git+https://github.com/TA-Lib/ta-lib-python.git@0.4.28
fi
# If that also fails, attempt 3: Use mock implementation
if [ $? -ne 0 ]; then
echo "Installing mock TA-Lib implementation..."
# Create a minimalistic talib module
mkdir -p /app/talib_mock/talib
cat > /app/talib_mock/talib/__init__.py << 'EOL'
import numpy as np
import warnings
warnings.warn("Using minimal TA-Lib mock implementation. Limited functionality available.")
# Version information
__version__ = "0.4.28-mock"
# Basic functions
def MA(real, timeperiod=30, matype=0):
"""Moving Average"""
if not isinstance(real, np.ndarray):
real = np.array(real)
result = np.full_like(real, np.nan)
for i in range(timeperiod-1, len(real)):
result[i] = np.mean(real[i-timeperiod+1:i+1])
return result
def SMA(real, timeperiod=30):
"""Simple Moving Average"""
return MA(real, timeperiod=timeperiod)
def RSI(real, timeperiod=14):
"""Relative Strength Index - Minimal implementation"""
warnings.warn("Using minimal RSI implementation")
return np.zeros_like(real)
def BBANDS(real, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0):
"""Bollinger Bands - Minimal implementation"""
warnings.warn("Using minimal BBANDS implementation")
middle = MA(real, timeperiod, matype)
upper = middle + nbdevup
lower = middle - nbdevdn
return upper, middle, lower
def MACD(*args, **kwargs):
warnings.warn("MACD function is a stub in this mock implementation")
return np.array([]), np.array([]), np.array([])
EOL
cat > /app/talib_mock/setup.py << 'EOL'
from setuptools import setup, find_packages
setup(
name="TA-Lib",
version="0.4.28.mock",
packages=find_packages(),
install_requires=["numpy"],
)
EOL
cd /app/talib_mock
pip install .
fi
# Install the rest of requirements
pip install -r requirements.txt