Skip to content
Snippets Groups Projects
Commit 8e87fd2f authored by Moul's avatar Moul
Browse files

Add Contributing to Silkaj presentation at RML16

parent 478f053a
No related branches found
No related tags found
No related merge requests found
Pipeline #15726 passed
<!DOCTYPE html>
<html>
<head>
<title>Contributing to Silkaj</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/styles.css" />
<style>
@font-face{
font-family: 'Ubuntu Mono';
src: url('../css/UbuntuMono-R.ttf');
}
@font-face{
font-family: 'Yanone Kaffesatz';
src: url('YanoneKaffeesatz-Regular.otf');
}
h1, h2, h3 { font-family: 'Yanone Kaffeesatz'; font-weight: normal; }
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
</style>
</head>
<body>
<script src="../js/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create({
sourceUrl: 'presentation.md',
highlightStyle: 'tomorrow-night',
countIncrementalSlides: false,
});
</script>
</body>
</html>
name:begin
class: center, middle
# Contributing to Silkaj
\#RML16 − 28th May 2022 − L’Éstachon (Sisteron) − Moul
<img src="../images/silkaj_logo.svg" width=50 />
<img src="../images/Python-logo-notext.svg" width=45 />
<img src="../images/poetry-logo.svg" width=30 />
<img src="../images/pre-commit_logo.svg" width=50 />
<img src="../images/gitlab-icon.png" width=50 />
<img src="../images/gtk_logo.svg" width=40 />
<img src="../images/substrate_logo.png" width=55 />
<img src="../images/duniter_logo.svg" width=50 />
<img src="../images/g1_logo.svg" width=50 />
---
This presentation is an augmented presentation of:
- [How to contribute to Silkaj](https://git.duniter.org/moul/slides#rml14-toulouse-28th-november-2019)
- RML14 − Toulouse − 28th November 2019
Call for contributors
---
### Outline
--
- Pre-requisites
--
- Project goals
--
- Set-up the development environment
- Poetry
- Pre-commit
--
- Pytest
--
- Continuous Integration and Delivery (CI/CD)
--
- Future developments
- Substrate APIs usage
- Graphical interface
---
#### Pre-requisites
- `git` basics
- GitLab
- Motivation
- Time
---
#### What are Silkaj project goals?
.center[<img src="../images/silkaj_logo.svg" width=100 />]
--
- Project is aiming at creating a generic tool to manage accounts and wallets, and to monitor the currency
- Features
- Web of Trust exploration and handling
- Money aspects handling
- Blockchain exploration
- Advanced users
- Minimalist tool, with advanced features
---
#### <img src="../images/Python-logo-notext.svg" width=25 /> Python
Non-steep learning curve language
---
#### Planning
- Milestones
- Direction of the project is relatively clear
- Mentoring
---
#### Set up the development environment
##### <img src="../images/poetry-logo.svg" width=20 /> Poetry
###### Usage
- Isolated enviroment to not mess-up your system
- Handle Python dependencies
- Publish releases to PyPI
---
##### <img src="../images/poetry-logo.svg" width=20 /> Poetry
###### Installation
- [Documentation to install Silkaj with Poetry](https://git.duniter.org/clients/python/silkaj/blob/main/doc/install_poetry.md)
--
- On Debian Bullseye:
```bash
sudo apt install libsodium23 python3-pip python3-venv
python3 -m pip install poetry --user
```
--
```bash
git clone https://git.duniter.org/clients/python/silkaj.git
cd silkaj
poetry install
```
--
```bash
poetry run silkaj
```
---
##### <img src="../images/pre-commit_logo.svg" width=30 /> Pre-commit
```bash
sudo apt install pre-commit
cd silkaj
pre-commit install
```
```bash
pre-commit run --all-files
check python ast.........................................................Passed
check for merge conflicts................................................Passed
check toml...............................................................Passed
debug statements (python)................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
black....................................................................Passed
isort....................................................................Passed
pyupgrade................................................................Passed
.gitlab-ci.yml linter....................................................Passed
Insert license in comments...............................................Passed
mdformat.................................................................Passed
```
```bash
pre-commit run --all-files black
```
---
##### <img src="../images/pre-commit_logo.svg" width=30 /> Pre-commit hooks
- `black`: Code formatting
- `isort`: Imports sorting
- `pylint`: Code lint
- `mypy`: Static type annotation check
- `flake8`: Code checker
- `pyupgrade`: Code upgrade among Python versions
---
#### <img src="../images/pytest_logo.svg" width=50 /> Pytest
```bash
poetry run pytest
Test session starts (platform: linux, Python 3.10.4, pytest 7.1.2, pytest-sugar 0.9.4)
plugins: sugar-0.9.4, asyncio-0.10.0, cov-3.0.0
collecting ...
tests/test_auth.py ✓✓✓✓ 2% ▎
tests/test_checksum.py ✓✓✓✓✓✓✓ 4% ▌
tests/test_cli.py ✓ 5% ▌
tests/test_crypto_tools.py ✓✓✓✓✓✓✓✓✓✓✓✓ 9% ▉
tests/test_end_to_end.py ✓✓✓✓ 11% █▏
tests/test_idty_tools.py ✓✓✓✓✓✓✓✓✓✓ 14% █▌
tests/test_license.py ✓✓✓✓✓✓✓✓✓✓✓ 18% █▉
tests/test_membership.py ✓✓✓✓✓✓✓ 21% ██▎
tests/test_money.py ✓✓ 22% ██▎
tests/test_network_tools.py ✓✓✓✓✓✓✓✓✓✓✓✓ 26% ██▋
tests/test_revocation.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 49% ████▉
tests/test_tui.py ✓✓✓✓ 50% █████
tests/test_tx.py ✓✓✓✓✓✓✓ 53% █████▍
tests/test_tx_file.py ✓✓✓✓✓✓✓ 55% █████▋
tests/test_tx_history.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 61% ██████▏
tests/test_unit_tx.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 91% █████████▏
tests/test_verify_blocks.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 98% █████████▊
tests/test_wot.py ✓✓✓✓✓✓ 100% ██████████
Results (23.26s):
265 passed
```
---
#### <img src="../images/gitlab-icon.png" width=30 /> GitLab CI/CD
GitLab-CI is running:
- `pre-commit` hooks
- Pytest on all the supported Python versions
- Build and distribute Docker images of Silkaj
- Release Python package on PyPI
---
#### Future developments
##### <img src="../images/substrate_logo.png" width=50 /> Substrate APIs usage
--
- Currently uses DuniterPy with BMA client API
- Migrate to Substrate APIs (RPC) using [`substrate-interface`](https://github.com/polkascan/py-substrate-interface) library
---
##### Graphical interface
Currently uses a (**TUI**) terminal user interface
- [Click](https://click.palletsprojects.com/): Command line interface creation kit
- Display tables with `texttable`
--
###### <img src="../images/gtk_logo.svg" width=30 /> GTK+3/4 PyGObject
--
###### `ncurses` with [`blessed`](https://github.com/jquast/blessed) library
---
name: links
#### Links
--
##### Communication means
- Technical Forum: [forum.duniter.org](https://forum.duniter.org)
- XMPP chatroom [chat.duniter.org](https://chat.duniter.org)
- [xmpp:duniter@muc.duniter.org](xmpp:duniter@muc.duniter.org)
- Matrix chatroom: `#duniter:matrix.org`
--
##### Silkaj
- Silkaj website: https://silkaj.duniter.org/
- Silkaj repository: https://git.duniter.org/clients/python/silkaj
- [CONTRIBUTING.md](https://git.duniter.org/clients/python/silkaj/blob/main/CONTRIBUTING.md)
---
#### Credit
- Slides published under the GNU GPL v3 free license
- Slides source: [git.duniter.org/moul/slides](https://git.duniter.org/moul/slides)
- Slides Pages: [moul.duniter.io/slides/contributing_to_silkaj](https://moul.duniter.io/slides/contributing_to_silkaj/)
- Slideshow created using [remark](https://github.com/gnab/remark)
--
#### Donation
- My public key: GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP:J1k
- Or, as a QRcode:
<img src="../images/qrcode.png" width=100 />
???
If you did appreciate the presentation, you can donate here
---
class: center, middle
## Thanks
???
Thank you for your attention
---
class: center, middle
## Questions?
???
If you have a question, this is the right moment
---
name: end
class: center, middle
.center[<img src="../images/g1_logo.svg" width=500 />]
public/images/gitlab-icon.png

5.49 KiB

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="88.572334" height="96.050743" id="svg6843">
<defs id="defs6845"/>
<g transform="translate(-19.822308,-16.115941)" id="layer1">
<path d="M 20.88413,30.82696 53.816977,55.527708 107.33282,39.060543 70.587303,17.177763 20.88413,30.82696 z" id="path6976" style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
<path d="m 22.94243,82.287118 -2.0583,-51.460158 32.932847,24.700748 0,55.577152 L 22.94243,82.287118 z" id="path6978" style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
<path d="m 53.816977,111.10486 49.399213,-20.58416 4.11663,-51.460157 -53.515843,16.467165 0,55.577152 z" id="path6980" style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
<path d="M 23.216626,81.319479 70.48573,67.361442 103.38422,90.444516" id="path6982" style="fill:none;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
<path d="m 70.434539,17.875593 0,49.109284" id="path6984" style="fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
</g>
</svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="2000" width="2000"><defs><clipPath id="a" clipPathUnits="userSpaceOnUse"><path d="M0 1500h1500V0H0z"/></clipPath></defs><g clip-path="url(#a)" transform="matrix(1.33333 0 0 -1.33333 0 2000)"><path d="M665.147 130.852L130.853 665.147c-46.863 46.862-46.863 122.842 0 169.705l534.294 534.295c46.863 46.864 122.843 46.864 169.706 0l534.294-534.294c46.863-46.863 46.863-122.843 0-169.706L834.853 130.852c-46.863-46.862-122.843-46.862-169.706 0" fill="#fab040"/><path d="M687.774 233.226L233.225 687.775c-34.366 34.366-34.366 90.085 0 124.45l454.55 454.55c34.365 34.366 90.084 34.366 124.45 0l454.55-454.55c34.365-34.365 34.365-90.084 0-124.45l-454.55-454.55c-34.366-34.365-90.085-34.365-124.45 0z" fill="none" stroke="#040521" stroke-width="34" stroke-miterlimit="10"/><path d="M784.672 763.286c12.096 0 23.74.893 34.943 2.688 11.194 1.785 21.053 5.26 29.569 10.416 8.504 5.145 15.34 12.432 20.496 21.84 5.144 9.408 7.726 21.724 7.726 36.96 0 15.225-2.582 27.552-7.726 36.96-5.156 9.408-11.992 16.684-20.496 21.84-8.516 5.145-18.375 8.62-29.57 10.416-11.202 1.785-22.846 2.688-34.942 2.688h-81.985V763.286zm28.895 225.792c30.009 0 55.544-4.368 76.609-13.104 21.05-8.736 38.187-20.275 51.406-34.608 13.209-14.343 22.85-30.692 28.897-49.056 6.048-18.375 9.072-37.412 9.072-57.12 0-19.268-3.024-38.2-9.072-56.784-6.047-18.596-15.688-35.06-28.897-49.392-13.22-14.343-30.355-25.872-51.406-34.608-21.065-8.736-46.6-13.104-76.61-13.104h-110.88V509.27H597.184v479.808z"/></g></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="1500" height="1500" viewBox="0, 0, 1500, 1500">
<g id="pytest_logo">
<g id="graphics">
<path d="M521.576,213.75 L952.616,213.75 C964.283,213.75 973.741,223.208 973.741,234.875 L973.741,234.875 C973.741,246.542 964.283,256 952.616,256 L521.576,256 C509.909,256 500.451,246.542 500.451,234.875 L500.451,234.875 C500.451,223.208 509.909,213.75 521.576,213.75 z" fill="#696969" id="horizontal_bar"/>
<g id="top_bars">
<path d="M525.333,171 L612,171 L612,191 L525.333,191 L525.333,171 z" fill="#009FE3"/>
<path d="M638.667,171 L725.333,171 L725.333,191 L638.667,191 L638.667,171 z" fill="#C7D302"/>
<path d="M750.5,171 L837.167,171 L837.167,191 L750.5,191 L750.5,171 z" fill="#F07E16"/>
<path d="M861.861,171 L948.528,171 L948.528,191 L861.861,191 L861.861,171 z" fill="#DF2815"/>
</g>
<g id="bottom_bars">
<path d="M861.861,278 L948.528,278 L948.528,424.5 L861.861,424.5 L861.861,278 z" fill="#DF2815"/>
<path d="M750.5,278 L837.328,278 L837.328,516 L750.5,516 L750.5,278 z" fill="#F07E16"/>
<path d="M638.667,278 L725.328,278 L725.328,634.5 L638.667,634.5 L638.667,278 z" fill="#C7D302"/>
<path d="M525.333,278 L612,278 L612,712.5 L525.333,712.5 L525.333,278 z" fill="#009FE3"/>
</g>
</g>
<g id="pytest">
<path d="M252.959,1173.846 Q240.139,1173.846 229.71,1171.021 Q219.28,1168.196 210.914,1163.525 Q202.549,1158.853 196.139,1152.552 Q189.729,1146.25 184.732,1139.297 L182.124,1139.297 Q182.776,1146.685 183.428,1153.421 Q183.862,1159.07 184.297,1165.046 Q184.732,1171.021 184.732,1174.498 L184.732,1276.404 L145.186,1276.404 L145.186,930.921 L177.344,930.921 L182.993,963.079 L184.732,963.079 Q189.729,955.474 196.03,948.847 Q202.332,942.22 210.697,937.331 Q219.063,932.442 229.492,929.509 Q239.922,926.575 252.959,926.575 Q273.384,926.575 290.115,934.397 Q306.846,942.22 318.688,957.756 Q330.53,973.292 337.048,996.324 Q343.567,1019.356 343.567,1049.776 Q343.567,1080.413 337.048,1103.554 Q330.53,1126.695 318.688,1142.339 Q306.846,1157.984 290.115,1165.915 Q273.384,1173.846 252.959,1173.846 z M245.354,959.385 Q228.84,959.385 217.433,964.383 Q206.025,969.38 198.964,979.593 Q191.902,989.805 188.534,1005.015 Q185.166,1020.225 184.732,1040.867 L184.732,1049.776 Q184.732,1071.722 187.665,1088.779 Q190.598,1105.835 197.66,1117.46 Q204.722,1129.085 216.455,1135.06 Q228.189,1141.036 245.789,1141.036 Q275.122,1141.036 288.92,1117.352 Q302.717,1093.667 302.717,1049.341 Q302.717,1004.146 288.92,981.766 Q275.122,959.385 245.354,959.385 z" fill="#696969"/>
<path d="M370.293,930.921 L411.36,930.921 L458.076,1064.117 Q461.118,1072.808 464.269,1082.369 Q467.42,1091.929 470.136,1101.49 Q472.852,1111.05 474.807,1119.959 Q476.763,1128.868 477.632,1136.473 L478.936,1136.473 Q480.022,1131.041 482.412,1121.697 Q484.802,1112.354 487.736,1101.816 Q490.669,1091.277 493.82,1081.065 Q496.97,1070.853 499.36,1063.682 L542.6,930.921 L583.45,930.921 L489.148,1200.572 Q483.064,1218.172 476.002,1232.187 Q468.941,1246.202 459.597,1255.979 Q450.254,1265.757 437.651,1271.081 Q425.049,1276.404 407.666,1276.404 Q396.367,1276.404 388.11,1275.209 Q379.854,1274.014 373.987,1272.71 L373.987,1241.204 Q378.55,1242.291 385.503,1243.051 Q392.456,1243.812 400.061,1243.812 Q410.491,1243.812 418.096,1241.313 Q425.701,1238.814 431.35,1234.034 Q437,1229.253 441.019,1222.3 Q445.039,1215.347 448.298,1206.438 L460.684,1171.673 z" fill="#696969"/>
<path d="M695.568,1141.47 Q699.479,1141.47 704.368,1141.036 Q709.257,1140.601 713.82,1139.949 Q718.383,1139.297 722.186,1138.428 Q725.988,1137.559 727.944,1136.907 L727.944,1166.893 Q725.119,1168.196 720.773,1169.5 Q716.428,1170.804 711.213,1171.781 Q705.998,1172.759 700.349,1173.302 Q694.699,1173.846 689.267,1173.846 Q675.795,1173.846 664.279,1170.369 Q652.763,1166.893 644.398,1158.418 Q636.032,1149.944 631.252,1135.495 Q626.472,1121.045 626.472,1099.1 L626.472,960.689 L592.792,960.689 L592.792,943.089 L626.472,926.141 L643.42,876.165 L666.235,876.165 L666.235,930.921 L726.206,930.921 L726.206,960.689 L666.235,960.689 L666.235,1099.1 Q666.235,1120.176 673.079,1130.823 Q679.924,1141.47 695.568,1141.47 z" fill="#009FE3"/>
<path d="M868.527,1173.846 Q844.626,1173.846 824.853,1165.806 Q805.08,1157.767 790.848,1142.339 Q776.616,1126.912 768.793,1104.097 Q760.971,1081.282 760.971,1051.949 Q760.971,1022.398 768.142,999.148 Q775.312,975.899 788.349,959.711 Q801.386,943.523 819.529,935.049 Q837.673,926.575 859.619,926.575 Q881.13,926.575 898.295,934.289 Q915.461,942.002 927.412,956.017 Q939.362,970.032 945.772,989.697 Q952.182,1009.361 952.182,1033.262 L952.182,1057.815 L801.821,1057.815 Q802.907,1099.751 819.529,1119.524 Q836.152,1139.297 868.962,1139.297 Q880.043,1139.297 889.495,1138.211 Q898.947,1137.125 907.747,1135.06 Q916.547,1132.996 924.804,1129.845 Q933.061,1126.695 941.535,1122.784 L941.535,1157.984 Q932.844,1162.112 924.478,1165.154 Q916.113,1168.196 907.313,1170.152 Q898.513,1172.107 889.061,1172.977 Q879.609,1173.846 868.527,1173.846 z M858.749,959.385 Q833.979,959.385 819.529,976.333 Q805.08,993.282 802.69,1025.657 L909.594,1025.657 Q909.594,1010.882 906.661,998.605 Q903.727,986.329 897.535,977.637 Q891.342,968.946 881.782,964.166 Q872.221,959.385 858.749,959.385 z" fill="#009FE3"/>
<path d="M1155.126,1104.097 Q1155.126,1121.48 1148.825,1134.517 Q1142.524,1147.554 1130.682,1156.354 Q1118.84,1165.154 1102.109,1169.5 Q1085.378,1173.846 1064.518,1173.846 Q1040.834,1173.846 1023.886,1170.043 Q1006.938,1166.241 994.118,1158.853 L994.118,1122.784 Q1000.854,1126.26 1009.111,1129.628 Q1017.368,1132.996 1026.494,1135.604 Q1035.62,1138.211 1045.289,1139.841 Q1054.958,1141.47 1064.518,1141.47 Q1078.642,1141.47 1088.528,1139.08 Q1098.415,1136.69 1104.608,1132.236 Q1110.8,1127.781 1113.625,1121.371 Q1116.45,1114.961 1116.45,1107.139 Q1116.45,1100.403 1114.277,1094.971 Q1112.104,1089.539 1106.346,1084.216 Q1100.588,1078.892 1090.593,1073.46 Q1080.598,1068.028 1064.953,1061.292 Q1049.308,1054.556 1036.815,1048.038 Q1024.321,1041.519 1015.629,1033.479 Q1006.938,1025.44 1002.266,1014.902 Q997.595,1004.363 997.595,989.805 Q997.595,974.595 1003.57,962.753 Q1009.545,950.911 1020.41,942.872 Q1031.274,934.832 1046.484,930.704 Q1061.694,926.575 1080.38,926.575 Q1101.457,926.575 1118.948,931.138 Q1136.44,935.701 1152.084,943.089 L1138.395,975.03 Q1124.272,968.729 1109.388,964.057 Q1094.504,959.385 1079.077,959.385 Q1056.913,959.385 1046.266,966.664 Q1035.62,973.943 1035.62,987.415 Q1035.62,995.02 1038.118,1000.669 Q1040.617,1006.319 1046.701,1011.316 Q1052.785,1016.314 1062.997,1021.42 Q1073.21,1026.526 1088.42,1032.828 Q1104.064,1039.346 1116.341,1045.865 Q1128.618,1052.383 1137.309,1060.531 Q1146,1068.68 1150.563,1079.109 Q1155.126,1089.539 1155.126,1104.097 z" fill="#009FE3"/>
<path d="M1285.28,1141.47 Q1289.191,1141.47 1294.08,1141.036 Q1298.969,1140.601 1303.532,1139.949 Q1308.095,1139.297 1311.898,1138.428 Q1315.7,1137.559 1317.656,1136.907 L1317.656,1166.893 Q1314.831,1168.196 1310.485,1169.5 Q1306.14,1170.804 1300.925,1171.781 Q1295.71,1172.759 1290.06,1173.302 Q1284.411,1173.846 1278.979,1173.846 Q1265.507,1173.846 1253.991,1170.369 Q1242.475,1166.893 1234.109,1158.418 Q1225.744,1149.944 1220.964,1135.495 Q1216.183,1121.045 1216.183,1099.1 L1216.183,960.689 L1182.504,960.689 L1182.504,943.089 L1216.183,926.141 L1233.132,876.165 L1255.947,876.165 L1255.947,930.921 L1315.917,930.921 L1315.917,960.689 L1255.947,960.689 L1255.947,1099.1 Q1255.947,1120.176 1262.791,1130.823 Q1269.636,1141.47 1285.28,1141.47 z" fill="#009FE3"/>
</g>
</g>
<script xmlns=""/></svg>
\ No newline at end of file
public/images/substrate_logo.png

4.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment