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
ARA Records Ansible and makes it easier to understand and troubleshoot.

ARA Records Ansible ARA Records Ansible and makes it easier to understand and troubleshoot. It's another recursive acronym. What it does Simple to ins

Community managed Ansible repositories 1.6k Dec 25, 2022
Vector tile server for the Wildfire Predictive Services Unit

wps-tileserver Vector tile server for the Wildfire Predictive Services Unit Overview The intention of this project is to: provide tools to easily spin

Province of British Columbia 6 Dec 20, 2022
An app that mirrors your phone to your compute and maps controller input to the screen

What is 'Dragalia Control'? An app that mirrors your phone to your compute and maps controller input to the screen. Inputs are mapped specifically for

1 May 03, 2022
Our product DrLeaf which not only makes the work easier but also reduces the effort and expenditure of the farmer to identify the disease and its treatment methods.

Our product DrLeaf which not only makes the work easier but also reduces the effort and expenditure of the farmer to identify the disease and its treatment methods. We have to upload the image of an

Aniruddha Jana 2 Feb 02, 2022
This is a modified variation of abhiTronix's vidgear. In this variation, it is possible to write the output file anywhere regardless the permissions.

Info In order to download this package: Windows 10: Press Windows+S, Type PowerShell (cmd in older versions) and hit enter, Type pip install vidgear_n

Ege Akman 3 Jan 30, 2022
Hello, Welcome to this repo. don't forget to read guidelines in readme.md

Hacktoberfest_2021 If you looking for your first contribution, we are here to help. Just create a simple program using any language you like in our fo

Wafa Rifqi Anafin 117 Dec 14, 2022
Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before.

Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before. This project is maintained by Aldrin Mathew.

Aldrin's Art Factory 67 Dec 31, 2022
Boot.img patcher for Tolino ebook readers to enable ADB and root.

I'm not responsible for any damage to your devices by running this tool. Please note that you may loose warranty when using this, although (This is no

Aaron Dewes 9 Nov 13, 2022
SQL centered, docker process running game

REQUIREMENTS Linux Docker Python/bash set up image "docker build -t game ." create db container "run my_whatever/game_docker/pdb create" # creating po

1 Jan 11, 2022
Ml-design-patterns - Source code accompanying O'Reilly book: Machine Learning Design Patterns

This is not an official Google product ml-design-patterns Source code accompanying O'Reilly book: Title: Machine Learning Design Patterns Authors: Val

Google Cloud Platform 1.5k Jan 05, 2023
IĀ³ Tracker for Essential Open Innovation Datasets

IĀ³ Tracker for Essential Open Innovation Datasets This repository is set up to track, version, and contribute updates to the IĀ³ Essential Open Innovat

1 Feb 08, 2022
A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool

Oppo/Realme Flash .OFP File on Bootloader A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme to

Italo Almeida 70 Jan 02, 2023
A tool to improve Boolean satisfiability (SAT) solver user's life

SatHelper This is a tool to improve the Boolean satisfiability (SAT) and MaxSAT solver user's life. It helps you model various problems as SAT and Max

Tomas Balyo 1 Nov 16, 2021
A Python program for calculating the 95%CI for GNSS-derived site velocities

GNSS_Vel_95%CI A Python program for calculating the 95%CI for GNSS-derived site velocities Function_GNSS_95CI.py is a Python function for calculating

<a href=[email protected]"> 4 Dec 16, 2022
Minos-python - A framework which helps you create reactive microservices in Python

minos-python Summary [TODO] Packages minos-microservice-aggregate minos-microser

Minos Framework 380 Jan 04, 2023
Bitflip Fault Simulation Platform by Daniele Rizzieri (2021)

BFSP [v1.05] Bitflip Fault Simulation Platform by Daniele Rizzieri (2021) The platform injects a random bitflip in each of N copies of a binary file.

Daniele Rizzieri 2 Nov 05, 2022
Job Guy Backend

Ų¬Ų§ŲØā€ŒŚÆŲ§ŪŒ Ś†ŪŒŲ³ŲŖŲŸ Ų§ŁˆŁ†Ų¬Ų§ ŁˆŲ¶Ų¹ŪŒŲŖ Ś†Ų·ŁˆŲ±ŪŒŁ‡ŲŸ ŪŒŁ‡ Ų³ŁˆŲ§Ł„ ŲØŁ‡ Ł‡Ł…ŪŒŁ† Ś©Ł„ŪŒŲŖ Łˆ Ų§ŲØŁ‡Ų§Ł… Ł…Ų¹Ł…ŁˆŁ„Ų§ ŁˆŁ‚ŲŖŪŒ ŲØŲ±Ų§ŪŒ ŪŒŁ‡ Ų“Ų±Ś©ŲŖ Ų±Ų²ŁˆŁ…Ł‡ Ł…ŪŒā€ŒŁŲ±Ų³ŲŖŪŒŁ… Ų§ŪŒŁ† Ų³ŁˆŲ§Ł„ Ś©Ł„ŪŒ Łˆ ŲØŲ²Ų±ŚÆ ŲØŲ±Ų§ŪŒ Ł‡Ł…Ł‡ Ł¾ŪŒŲ“ Ł…ŪŒŲ§ŲÆ.Ų§ŁˆŁ†Ų¬Ų§ ŁˆŲ¶

Jobguy.work 217 Dec 25, 2022
Trashselected - Plugin for fman.io to move files that has been selected in fman to trash

TrashSelected Plugin for fman.io to move files that has been selected in fman to

1 Feb 04, 2022
From "fixed RAnDom CRashes" to "[FIX] Fixed random crashes."

Clean Commit From fixed RAnDom CRashes to [FIX] Fixed random crashes. Clean commit helps you by auto-formating your commits to make your repos better

Mathias 3 Dec 26, 2021