rename python_snippets folder to python

.
This commit is contained in:
Jesse de Wit
2023-11-13 20:52:59 +01:00
committed by ok300
parent 34387e8b62
commit 0927ab4408
29 changed files with 57 additions and 50 deletions

34
snippets/python/README.md Normal file
View File

@@ -0,0 +1,34 @@
## Steps to run locally
1. Build a python package
- By running the publish-all-platforms CI in the breez-sdk repository (use dummy binaries)
- or by downloading from Pypi
2. Download the wheel artifact for your platform. For linux that is `python-wheel-3.8-manylinux_2_31_x86_64`
3. Unzip the artifact in the `snippets/python/packages` folder.
4. Run `pip install packages/{NAME_OF_.WHL_FILE}`
4. happy coding!
To check the syntax:
```bash
cd snippets/python
python3 -m compileall src
```
To check the snippet formatting:
```bash
cd snippets/python/src
ruff --ignore F841 --ignore F401 --output-format=github .
```
To execute the snippets locally, in order to check for type correctness:
```bash
#!/bin/bash
export API_KEY="..."
export MNEMONIC="..."
cd snippets/python
python main.py $API_KEY $MNEMONIC
```

View File

@@ -1,27 +0,0 @@
## Steps to run locally
To check the syntax:
```bash
cd snippets/python_snippets
python3 -m compileall src
```
To check the snippet formatting:
```bash
cd snippets/python_snippets/src
ruff --ignore F841 --ignore F401 --output-format=github .
```
To execute the snippets locally, in order to check for type correctness:
```bash
#!/bin/bash
export API_KEY="..."
export MNEMONIC="..."
cd snippets/python_snippets
python main.py $API_KEY $MNEMONIC
```

View File

@@ -66,7 +66,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/buy_btc.py:buy-btc}}
{{#include ../../snippets/python/src/buy_btc.py:buy-btc}}
```
</section>

View File

@@ -61,7 +61,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/connecting_lsp.py:get-lsp-info}}
{{#include ../../snippets/python/src/connecting_lsp.py:get-lsp-info}}
```
</section>
@@ -137,7 +137,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/connecting_lsp.py:connect-lsp}}
{{#include ../../snippets/python/src/connecting_lsp.py:connect-lsp}}
```
</section>

View File

@@ -43,7 +43,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/fiat_currencies.py:list-fiat-currencies}}
{{#include ../../snippets/python/src/fiat_currencies.py:list-fiat-currencies}}
```
</section>

View File

@@ -134,7 +134,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/getting_started.py:init-sdk}}
{{#include ../../snippets/python/src/getting_started.py:init-sdk}}
```
</section>
@@ -214,7 +214,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/getting_started.py:fetch-balance}}
{{#include ../../snippets/python/src/getting_started.py:fetch-balance}}
```
</section>

View File

@@ -55,7 +55,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/list_payments.py:list-payments}}
{{#include ../../snippets/python/src/list_payments.py:list-payments}}
```
</section>
@@ -137,7 +137,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/list_payments.py:list-payments-filtered}}
{{#include ../../snippets/python/src/list_payments.py:list-payments-filtered}}
```
</section>

View File

@@ -77,7 +77,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/lnurl_auth.py:lnurl-auth}}
{{#include ../../snippets/python/src/lnurl_auth.py:lnurl-auth}}
```
</section>

View File

@@ -75,7 +75,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/lnurl_pay.py:lnurl-pay}}
{{#include ../../snippets/python/src/lnurl_pay.py:lnurl-pay}}
```
</section>

View File

@@ -79,7 +79,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/lnurl_withdraw.py:lnurl-withdraw}}
{{#include ../../snippets/python/src/lnurl_withdraw.py:lnurl-withdraw}}
```
</section>

View File

@@ -63,7 +63,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/receive_onchain.py:generate-receive-onchain-address}}
{{#include ../../snippets/python/src/receive_onchain.py:generate-receive-onchain-address}}
```
</section>
@@ -139,7 +139,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/receive_onchain.py:in-progress-swap}}
{{#include ../../snippets/python/src/receive_onchain.py:in-progress-swap}}
```
</section>
@@ -221,7 +221,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/receive_onchain.py:list-refundables}}
{{#include ../../snippets/python/src/receive_onchain.py:list-refundables}}
```
</section>
@@ -306,7 +306,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/receive_onchain.py:execute-refund}}
{{#include ../../snippets/python/src/receive_onchain.py:execute-refund}}
```
</section>
@@ -384,7 +384,7 @@ do {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/receive_onchain.py:get-channel-opening-fees}}
{{#include ../../snippets/python/src/receive_onchain.py:get-channel-opening-fees}}
```
</section>

View File

@@ -62,7 +62,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/receive_payment.py:receive-payment}}
{{#include ../../snippets/python/src/receive_payment.py:receive-payment}}
```
</section>

View File

@@ -61,7 +61,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/send_onchain.py:estimate-current-reverse-swap-total-fees}}
{{#include ../../snippets/python/src/send_onchain.py:estimate-current-reverse-swap-total-fees}}
```
</section>
@@ -135,7 +135,7 @@ Log.v("Breez", "Maximum amount, in sats: ${fees.max}")
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/send_onchain.py:get-current-reverse-swap-min-max}}
{{#include ../../snippets/python/src/send_onchain.py:get-current-reverse-swap-min-max}}
```
</section>
@@ -221,7 +221,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/send_onchain.py:start-reverse-swap}}
{{#include ../../snippets/python/src/send_onchain.py:start-reverse-swap}}
```
</section>
@@ -297,7 +297,7 @@ for (rs in sdk.inProgressReverseSwaps()) {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/send_onchain.py:check-reverse-swaps-status}}
{{#include ../../snippets/python/src/send_onchain.py:check-reverse-swaps-status}}
```
</section>

View File

@@ -62,7 +62,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/send_spontaneous_payment.py:send-spontaneous-payment}}
{{#include ../../snippets/python/src/send_spontaneous_payment.py:send-spontaneous-payment}}
```
</section>

View File

@@ -64,7 +64,7 @@ try {
<section>
```python,ignore
{{#include ../../snippets/python_snippets/src/static_channel_backup.py:static-channel-backup}}
{{#include ../../snippets/python/src/static_channel_backup.py:static-channel-backup}}
```
</section>