Big picture view
See original GitHub issueIβve spent some more time thinking how to organize cairo projects and what Iβd like to see. I think we should leverage the python ecosystem as much as possible:
nile init
could use cookiecutter to create the projectpypi
to distribute cairo packages- users should be able to configure nile (for example the contracts directory) from their
setup.cfg
file like other python tools
I think cairo projects should use the same folder structure as python projects, this has the added benefit that library developers can distribute the cairo files together with an sdk to interact with it (like @uniswap/core
and @uniswap/sdk
).
.
βββ src
β βββ cairoswap
β βββ __init__.py
β βββ cairo
β β βββ __init__.py
β β βββ pool.cairo
β β βββ router.cairo
β βββ pool.py
β βββ router.py
βββ tests
β βββ pool.test.cairo
β βββ test_pool.py
β βββ test_router.py
βββ pyproject.toml
βββ setup.cfg
βββ tox.in
Developers can then create a tox task than runs python tests with pytest and cairo tests with nile test
.
If users donβt need/want to setup a full blown project they can revert to a minimal setup and use nile to build and test.
.
βββ src
βββ pool.cairo
βββ pool.test.cairo
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (7 by maintainers)
Top Results From Across the Web
6 ways to develop big picture thinking (and stop drowning in ...
Big picture thinking is the ability to grasp abstract concepts, ideas and possibilities. Big picture thinkers emphasize the system in which s/he isΒ ......
Read more >6 big picture thinking strategies that you'll actually use - BetterUp
6 exercises to develop big picture thinking Β· 1. Start with reflection Β· 2. Ditch perfectionism Β· 3. Think about other perspectives Β·...
Read more >Big Picture Thinking: Definition, Strategies and Careers - Indeed
Big picture thinking refers to a thinking strategy that focuses on the entirety of a concept or idea instead of on each individual...
Read more >Big Picture Thinking: Thinking More Strategically
βLook at the bigger picture.β A statement that carries so much weight and the potential to turn things around if only everyone would...
Read more >Big Picture Thinking in Business - Video & Lesson Transcript
The Big Picture is the name given to a new way of thinking. It can be defined as thinking about ideas, concepts, and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
On point questions, Eric. The way I see Nile today is as a collective experiment on how Cairo development looks or could look like, and it is materialized in a poorly defined array of tooling, functionality and libraries that may arise on the way.
Cairo is a rapidly evolving language and environment, its API changes week over week. Some Nile features may arise and some we might need to sunset. Iβve been adding and removing development utils here and in the contracts repo Iβm working on, and I expect it continues to be the case for a while.
My intention is for Nile to serve as a vehicle for the Cairo community to share insights and best practices to accelerate the ecosystem and its development experience. Thatβs why questions such as how projects should be structured, packages distributed also belong in here. Today this dev experience improvement is achieved through a small set of utils aiding bootstrapping and task automation, but it can be anything π . For example, @fracek is experimenting with Cairo native testing.
After discussing here and on Discord I changed my mind and I agree with more points that you brought up.
I completely agree with this. I think now setting up a Python environment is the best way to get a StarkNet project running, but in the future who knows?
On the other hand, dapp tools show that people are willing to setup extra package managers (nix in their case) if the tool is worth it. I donβt necessarily believe thatβs good, but itβs something to consider π
I tend to agree with this, on the other hand minimizing the work a user needs to get the project running is also important. See how
create-react-app
became a standard even though they pull a bazillion dependencies on project setup.After discussing with you I now agree that
init
should return a more minimal structure and developers can provide their more opinionated templates through cookiecutter or other tools.Good point, Python also makes it terrible to have multiple packages in the same repo. Now I can see only testing helpers shipped with the contracts package.
Looks good, I think we can replace
pyproject.toml
,setup.cfg
, andtox.ini
with aMakefile
that callsnile
. That reduces the project dependencies to two βgloballyβ (per virtual environment) installed tools (because of how Python dependencies work, even if the dependencies where specified insetup.cfg
they would be global for the virtual environment).Edit: I think using Makefiles also means we are not pushing a package manager to users, which can for example use git submodules for dependencies.