Skip to content

Commit 9a0fc39

Browse files
committed
Setup commit
0 parents  commit 9a0fc39

12 files changed

+684
-0
lines changed

Diff for: .gitignore

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
artifacts/
2+
*DS_STORE
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Env
12+
*.env
13+
*.accounts.json
14+
accounts.json
15+
16+
# Distribution / packaging
17+
.Python
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
pip-wheel-metadata/
31+
share/python-wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
MANIFEST
36+
37+
# PyInstaller
38+
# Usually these files are written by a python script from a template
39+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
40+
*.manifest
41+
*.spec
42+
43+
# Installer logs
44+
pip-log.txt
45+
pip-delete-this-directory.txt
46+
47+
# Unit test / coverage reports
48+
htmlcov/
49+
.tox/
50+
.nox/
51+
.coverage
52+
.coverage.*
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
*.cover
57+
*.py,cover
58+
.hypothesis/
59+
.pytest_cache/
60+
61+
# Translations
62+
*.mo
63+
*.pot
64+
65+
# Django stuff:
66+
*.log
67+
local_settings.py
68+
db.sqlite3
69+
db.sqlite3-journal
70+
71+
# Flask stuff:
72+
instance/
73+
.webassets-cache
74+
75+
# Scrapy stuff:
76+
.scrapy
77+
78+
# Sphinx documentation
79+
docs/_build/
80+
81+
# PyBuilder
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
.python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
102+
__pypackages__/
103+
104+
# Celery stuff
105+
celerybeat-schedule
106+
celerybeat.pid
107+
108+
# SageMath parsed files
109+
*.sage.py
110+
111+
# Environments
112+
.env
113+
.venv
114+
env/
115+
venv/
116+
ENV/
117+
env.bak/
118+
venv.bak/
119+
120+
# Spyder project settings
121+
.spyderproject
122+
.spyproject
123+
124+
# Rope project settings
125+
.ropeproject
126+
127+
# mkdocs documentation
128+
/site
129+
130+
# mypy
131+
.mypy_cache/
132+
.dmypy.json
133+
dmypy.json
134+
135+
# Pyre type checker
136+
.pyre/
137+
138+
139+
node.json
140+
*.deployments.txt

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Checks Finance
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<p align="center">
2+
<a href="https://twitter.com/codefordao"><img src="https://avatars.githubusercontent.com/u/97301607?s=200&u=d0a9f88d13d7d7dd5b37c09fdd802c9fe378d029&v=4"/></a>
3+
</p>
4+
<h2 align="center">
5+
CodeforDAO Contracts in Cairo (StarkNet)
6+
</h2>
7+
<p align="center">
8+
Base on, build upon and code for DAOs.
9+
</p>
10+
<p align="center">
11+
Make DAO the next generation of productivity tools for global collaboration.
12+
</p>
13+
<p align="center">
14+
Follow us on Twitter <a href="https://twitter.com/codefordao">@codefordao</a>.
15+
</p>
16+
17+
<p align="center">
18+
<a href="https://github.com/CodeforDAO/contracts/">
19+
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="mit license"/>
20+
</a>
21+
</p>
22+
23+
## Cairo-array-utils
24+
25+
This module is implemented on StarkNet in Cairo language. Using this module requires that you have a basic understanding of the Cairo language and python.
26+
27+
### Install
28+
29+
```bash
30+
pip install git+https://github.com/CodeforDAO/cairo-array-utils.git
31+
```
32+
33+
### APIs
34+
35+
```python
36+
from codefordao.utils.array import Array
37+
38+
# APIs
39+
Array.save(
40+
arr_len: felt,
41+
arr: felt*
42+
) -> (key: ArrayInfo.key)
43+
44+
Array.get_item(
45+
key: ArrayInfo.key,
46+
index: felt
47+
) -> (res: felt)
48+
49+
Array.get_array(
50+
key: ArrayInfo.key,
51+
) -> (
52+
arr_len: felt,
53+
arr: felt*
54+
)
55+
```
56+
57+
### Set up the project
58+
59+
#### Create a Python virtual environment
60+
61+
```bash
62+
python -m venv env
63+
source env/bin/activate
64+
```
65+
66+
#### 📦 Install the requirements
67+
68+
```bash
69+
pip install -r requirements.txt
70+
```
71+
72+
### ⛏️ Compile
73+
74+
```bash
75+
nile compile --directory src
76+
```
77+
78+
### 🌡️ Test
79+
80+
```bash
81+
# Run all tests
82+
pytest tests
83+
```
84+
85+
## 📄 License
86+
87+
**cairo-array-utils** is released under the [MIT](LICENSE).

Diff for: pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build-system]
2+
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
3+
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"]
4+
build-backend = "setuptools.build_meta"
5+
6+
[tool.setuptools_scm]
7+
# See configuration details in https://github.com/pypa/setuptools_scm
8+
version_scheme = "no-guess-dev"

Diff for: pytest.ini

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
asyncio_mode = auto
3+
log_cli = true

Diff for: requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
wheel
2+
cairo-lang
3+
cairo-nile
4+
pytest-cairo
5+
tox

Diff for: setup.cfg

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[metadata]
2+
name = cairo-array-utils
3+
version = attr: cairo-array-utils.__version__
4+
description = Array helpers in Cairo.
5+
author = GUO Yu
6+
author_email = [email protected]
7+
license = MIT
8+
long_description = file: README.md
9+
long_description_content_type = text/markdown; charset=UTF-8
10+
url = https://github.com/CodeforDAO/cairo-array-utils
11+
platforms = any
12+
classifiers =
13+
Operating System :: OS Independent
14+
15+
[options]
16+
zip_safe = False
17+
packages = find_namespace:
18+
include_package_data = True
19+
package_dir =
20+
=src
21+
22+
install_requires =
23+
importlib-metadata>=4.0
24+
25+
[options.packages.find]
26+
where = src
27+
exclude =
28+
tests
29+
30+
[options.package_data]
31+
codefordao = "*.cairo"
32+
33+
[options.extras_require]
34+
testing =
35+
setuptools
36+
tox
37+
pytest

Diff for: setup.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from setuptools import setup
2+
3+
if __name__ == "__main__":
4+
try:
5+
setup(use_scm_version={"version_scheme": "no-guess-dev"})
6+
except: # noqa
7+
print(
8+
"\n\nAn error occurred while building the project, "
9+
"please ensure you have the most updated version of setuptools, "
10+
"setuptools_scm and wheel with:\n"
11+
" pip install -U setuptools setuptools_scm wheel\n\n"
12+
)
13+
raise

Diff for: src/codefordao/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""StarkNet/Cairo development toolbelt."""
2+
3+
try:
4+
from importlib import metadata as importlib_metadata
5+
except ImportError:
6+
import importlib_metadata
7+
8+
try:
9+
__version__ = importlib_metadata.version("checksfinance-soulmoment")
10+
except importlib_metadata.PackageNotFoundError:
11+
__version__ = None

0 commit comments

Comments
 (0)