A proof-of-concept package manager for Cairo contracts/libraries

Overview

glyph

A proof-of-concept package manager for Cairo contracts/libraries. Distribution through pypi. Installation through existing package managers -- pip, pipenv, poetry.

Intended to be a lightweight layer on top of existing python package management. Sole responsibility is collecting contracts/libraries registered to the contracts namespace package, and copying their contents to a new contracts/lib folder.

NOTE: solely experimental to play around one potential strategy, doubtful that this would be a real package management solution for the ecosystem

Usage

Install with pip install cairo-glyph. Additionally, pip install cairo-nile and nile init to intialize a starter project.

Check out the help command (auto-gen from code, will always be more up to date than this README):

(venv) [email protected]:~/dev/eth/tmp$ glyph --help
Usage: glyph [OPTIONS] COMMAND [ARGS]...

  A proof-of-concept package manager for Cairo.

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.
  --help                Show this message and exit.

Commands:
  clean  Remove everything in the lib directory
  use    Install one or all added cairo packages in the project

Use all libraries installed to the venv:

(venv) [email protected]:~/dev/eth/tmp$ glyph use --all
๐Ÿ”Ž Discovering installed contracts...

โœ… Done.

For now, nothing is installed. To change that, do a pip install cairo-placeholder

Then do it again:

(venv) $ glyph use --all
๐Ÿ”Ž Discovering installed contracts...

 โ€ข Using contracts.placeholder

โœ… Done.

If we inspect our project directory we now see it's installed in a contracts/lib folder:

โ”œโ”€โ”€ accounts.json
โ”œโ”€โ”€ contracts
โ”‚   โ”œโ”€โ”€ contract.cairo
โ”‚   โ””โ”€โ”€ libs
โ”‚       โ””โ”€โ”€ placeholder
โ”‚           โ””โ”€โ”€ contract.cairo
โ”œโ”€โ”€ Makefile
โ”œโ”€โ”€ tests
โ”‚   โ””โ”€โ”€ test_contract.p

๐Ÿฅณ

Your Own Library Setup

In order to allow your contracts to be installed, a few conventions must be followed.

contracts                # The "namespace package" that the contracts are installed to
โ””โ”€โ”€ placeholder          # The library you are distributing
    โ”œโ”€โ”€ contract.cairo
    โ””โ”€โ”€ __init__.py      # Required to be installable.
setup.py                 # The installer

The actual setup.py will look something like this:

from setuptools import setup


setup(
    name="placeholder",

    version="1",
    description="",
    long_description="",

    author="Jane Doe",
    author_email="[email protected]",

    license="MIT License",

    packages=["contracts.placeholder"],
    # Include all extra package data. Possible to include *.cairo only
    package_data={"": ["*"]},
    zip_safe=False,
)

If using poetry, have pyproject.toml like:

"] license = "MIT License" readme = "README.md" packages = [ { include = "contracts/*" }, ] [tool.poetry.dependencies] python = "^3.7" cairo-nile = "^0.3.0" [tool.poetry.dev-dependencies] [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api"">
[tool.poetry]
name = "cairo-placeholder"
version = "0.0.2"
description = "Example project for cairo-glyph"
authors = ["Your Name 
   
    "]
license = "MIT License"
readme = "README.md"
packages = [
    { include = "contracts/*" },
]

[tool.poetry.dependencies]
python = "^3.7"
cairo-nile = "^0.3.0"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

   

Once distributed on pypi, one could:

(venv) $ pip install cairo-glyph cairo-placeholder
...
(venv) $ glyph use placeholder
๐Ÿ”Ž Discovering installed contracts...

 โ€ข Using contracts.placeholder

โœ… Done.

Adding the following to your project:

contracts/
โ””โ”€โ”€ libs
    โ””โ”€โ”€ placeholder
        โ””โ”€โ”€ contract.cairo
Owner
Sam Barnes
Sam Barnes
Lagrange Interpolation Method-Python

Lagrange Interpolation Method-Python The Lagrange interpolation formula is a way to find a polynomial, called Lagrange polynomial, that takes on certa

Motahare Soltani 2 Jul 05, 2022
Block when attacker want to bypass the limit of request

Block when attacker want to bypass the limit of request

iFanpS 1 Dec 01, 2021
Practice in Oxford_AI&ML class

Practice in Oxford_AI&ML class

St3ve Lee 2 Feb 04, 2022
ๅฅ‡้‡ๆท˜ๅฎขๆœๅŠกๅ™จ็ซฏ

ๅฅ‡้‡ๆท˜ๅฎข APP ๆœๅŠกๅ™จ็ซฏ ่ญฆๅ‘Š ๆญฃๅœจไฝฟ็”จ v0.2.0 ็‰ˆๆœฌ็š„็”จๆˆท๏ผŒ่ฏทๅฐฝๅฟซๅ‡็บงๅˆฐ v0.2.1ใ€‚ v0.2.0 ็‰ˆๆœฌ็š„ Docker ้•œๅƒไธญๅŒ…ๅซไบ†ๆœ‰้—ฎ้ข˜็š„ aiohttpใ€‚ ๅฅ‡้‡ๆท˜ๅฎขไปฃ็ ๅบ“ ๅฅ‡้‡ๆท˜ๅฎข iOS APP ๅฅ‡้‡ๆท˜ๅฎข Android APP ๅฅ‡้‡ๆท˜ๅฎขๆ–‡ๆกฃ ๆœๅŠกๅ™จ็ซฏๆ–‡ๆกฃ Docker ไฝฟ็”จ

ๅฅ‡้‡็ง‘ๆŠ€ 92 Nov 09, 2022
A C-like hardware description language (HDL) adding high level synthesis(HLS)-like automatic pipelining as a language construct/compiler feature.

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆ

Julian Kemmerer 391 Jan 01, 2023
Extremely unfinished animation toolset for Blender 3.

AbraTools Alpha IMPORTANT: Code is a mess. Be careful using it in production. Bug reports, feature requests and PRs are appreciated. Download AbraTool

Abra 15 Dec 17, 2022
FBChecker Account using python , package requests and web old facebook

fbcek FBChecker Account using python , package requests and web old facebook using python 3.x apt upgrade -y apt update -y pkg install bash -y pkg ins

XnuxersXploitXen 5 Dec 24, 2022
A Microsoft reward automator, designed to work headless on a raspberry pi

MsReward A Microsoft reward automator, designed to work headless on a raspberry pi. Tested with a pi 3b+ and a pi 4 2Gb . Using a discord bot to log e

10 Dec 21, 2022
A free and powerful system for awareness and research of the American judicial system.

CourtListener Started in 2009, CourtListener.com is the main initiative of Free Law Project. The goal of CourtListener.com is to provide high quality

Free Law Project 332 Dec 25, 2022
A script for creating battle animations in FEGBA format.

AA2 Made by Huichelaar. I heavily referenced FEBuilderGBA. I also referenced circleseverywhere's Animation Assembler. This is also where I took lzss.p

2 May 31, 2022
An example file showing a simple endpoints like a login/logout function and maybe some others.

Flask API Example An example project showing a simple endpoints like a login/logout function and maybe some others. How to use: Open up your IDE (or u

Kevin 1 Oct 27, 2021
A simple tool made in Python language

Simple tool Uma simples ferramenta feita 100% em linguagem Python ๐Ÿ’ป Requisitos: Python3 instalado em seu dispositivo Clonagem e acesso ๐Ÿ“ณ git clone h

josh washington 4 Dec 07, 2021
Spinning waffle from waffle shaped python code

waffle Spinning waffle from waffle shaped python code Based on a parametric curve: r(t) = 2 - 2*sin(t) + (sin(t)*abs(cos(t)))/(sin(t) + 1.4) projected

Viljar Femoen 5 Feb 14, 2022
Agora-token-helper - Some help tools for AgoraToken

Agora Token Helper Support AgoraToken version 001 - 006. But for security reason

To lazy to read your homework ? Get it done with LOL

LOL To lazy to read your homework ? Get it done with LOL Needs python 3.x L:::::::::L OO:::::::::OO L:::::::::L L:::::::

KorryKatti 4 Dec 08, 2022
Wordle Solver

Wordle Solver Installation Install the following onto your computer: Python 3.10.x Download Page Run pip install -r requirements.txt Instructions To r

John Bucknam 1 Feb 15, 2022
:art: Diagram as Code for prototyping cloud system architectures

Diagrams Diagram as Code. Diagrams lets you draw the cloud system architecture in Python code. It was born for prototyping a new system architecture d

MinJae Kwon 27.5k Jan 04, 2023
Automatically give thanks to Pypi packages you use in your project!

Automatically give thanks to Pypi packages you use in your project!

Ward 25 Dec 20, 2021
fetchmesh is a tool to simplify working with Atlas anchoring mesh measurements

A Python library for working with the RIPE Atlas anchoring mesh. fetchmesh is a tool to simplify working with Atlas anchoring mesh measurements. It ca

2 Aug 30, 2022
Whatsapp Messenger master

Whatsapp Messenger master

Swarup Kharul 5 Nov 21, 2021