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
Creates infinite amount of guilded accounts in seconds.

Guilded Cookie Creator [fuck guilded i quit working on this, they patch like every fucking method after 2/3 days i release shit] Optimizations Asynchr

scripted 7 Feb 28, 2022
Pre-commit hook for upgrading type hints

This is a pre-commit hook configured to automatically upgrade your type hints to the new native types implemented in PEP 585.

snok 54 Nov 14, 2022
a pull switch (or BYO button) that gets you out of video calls, quick

zoomout a pull switch (or BYO button) that gets you out of video calls, quick. As seen on Twitter System compatibility Tested on macOS Catalina (10.15

Brian Moore 422 Dec 30, 2022
Organize seu linux - organize your linux

OrganizeLinux Organize seu linux - organize your linux Organize seu linux Uma forma rΓ‘pida de separar arquivos dispersos em pastas. formatos a serem c

Marcus VinΓ­cius Ribeiro Andrade 1 Nov 30, 2021
This app converts an pdf file into the audio file.

PDF-to-Audio This app takes an pdf as an input and convert it into audio, and the library text-to-speech starts speaking the preffered page given in t

Ojas Barawal 3 Aug 04, 2021
Age of Empires II recorded game parsing and summarization in Python 3.

mgz Age of Empires II recorded game parsing and summarization in Python 3. Supported Versions Age of Kings (.mgl) The Conquerors (.mgx) Userpatch 1.4

148 Dec 11, 2022
A program that analyzes data from inertia measurement units installeed in aircraft and generates g-exceedance curves

A program that analyzes data from inertia measurement units installeed in aircraft and generates g-exceedance curves

Pooya 1 Nov 23, 2021
Package to provide translation methods for pyramid, and means to reload translations without stopping the application

Package to provide translation methods for pyramid, and means to reload translations without stopping the application

Grzegorz ŚliwiΕ„ski 4 Nov 20, 2022
Removes all archived super productivity tasks. Just run the python script.

delete-archived-sp-tasks.py Removes all archived super productivity tasks. Just run the python script. This is helpful to do a cleanup every 3-6 month

Ben Herbst 1 Jan 09, 2022
Python module to work with Magneto Database directly without using broken Magento 2 core

Python module to work with Magneto Database directly without using broken Magento 2 core

Egor Shitikov 13 Nov 10, 2022
Master Duel Card Translator Project

Master Duel Card Translator Project A tool for translating card effects in Yu-Gi-Oh! Master Duel. Quick Start (for Chinese version only) Download the

67 Dec 23, 2022
Scraper pour les offres de stage Tesla et les notes sur Oasis (Polytech Paris-Saclay) sous forme de bot Discord

Scraper pour les offres de stage Tesla et les notes sur Oasis (Polytech Paris-Saclay) sous forme de bot Discord

Alexandre Malfreyt 1 Jan 21, 2022
Pomodoro timer by the Algodrip team!

PomoDrip πŸ… Pomodoro timer by the Algo Drip team! To-do: Create the script for the pomodoro timer Design the front-end of the program (Flask or Javasc

Algodrip 3 Sep 12, 2021
Class XII computer science project.

Computer Science Project β€” Class XII Kshitij Srivastava (XI – A) Introduction The aim of this project is to create a fully operational system for a me

Kshitij Srivastava 2 Jul 21, 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
Library to emulate the Sneakers movie effect

py-sneakers Port to python of the libnms C library To recreate the famous data decryption effect shown in the 1992 film Sneakers. Install pip install

Nicolas Rebagliati 11 Aug 27, 2021
Small exercises to get you used to reading and writing Python code!

Pythonlings Welcome to Pythonlings, an automated Python tutorial program (inspired by Rustlings and Haskellings). WIP This program is still working in

ιΉ€ηΏ”δΈ‡ι‡Œ 5 Sep 23, 2022
A carrot-based color palette you didn't know you needed.

A package to produce a carrot-inspired color palette for python/matplotlib. Install: pip install carrotColors Update: pip install --upgrade carrotColo

10 Sep 28, 2021
The newest contender in Server Gateway Interface.

nsgi The newest contender in Server Gateway Interface. Why use this webserver? This webserver is made with the newest version of asyncio, and sockets,

OpenRobot 1 Feb 12, 2022
Weakly-Divisable - Takes an interger and seee if it is weakly divisible by seven

Weakly Divisble Project by Diana Arce-Hernandez, Ryan McAlpine, and Rommel Ravan

Diana Arce-Hernandez 1 Jan 12, 2022