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
Osintgram by Datalux but i fixed some errors i found and made it look cleaner

OSINTgram-V2 OSINTgram-V2 is made from Osintgram which is made by Datalux originally but i took the script and fixed some errors i found and made the

2 Feb 02, 2022
creates a batch file that uses adb to auto-install apks into the Windows Subsystem for Android and registers it as the default application to open apks.

wsa-apktool creates a batch file that uses adb to auto-install apks into the Windows Subsystem for Android and registers it as the default application

Aditya Vikram 3 Apr 05, 2022
Change your Windows background with this program safely & easily!

Background_Changer Table of Contents: About the Program Features Requirements Preview Credits Reach Me See Also About the Program: You can change your

Sina.f 0 Jul 14, 2022
In the works, creating a new Chess Board and way to Play...

sWJz4Chess date started on github.com 11-13-2021 In the works, creating a new Chess Board and way to Play... starting to write this in Pygame, any ind

Shawn 2 Nov 18, 2021
A Python script to delete movies with a certain tag after a certain amount of days.

radarr_autodelete Simple script, which deletes movies with a specific tag after a certain amount of days Pip Packages pip3 install pyarr python-dotenv

7 Dec 06, 2022
Bible-App : Simple Tool To Show Bible Books

Bible App Simple Tool To Show Bible Books Socials: Language:

ู…ูŠุฎุงุฆูŠู„ 5 Jan 18, 2022
Taichi is a parallel programming language for high-performance numerical computations.

Taichi is a parallel programming language for high-performance numerical computations.

Taichi Developers 22k Jan 04, 2023
This is the course repository for the Spring 2022 iteration of MACS 30123 "Large-Scale Computing for the Social Sciences" at the University of Chicago.

Large-Scale Computing for the Social Sciences Spring 2022 - MACS 30123/MAPS 30123/PLSC 30123 Instructor Information TA Information TA Information Cour

6 May 06, 2022
Data derived from the OpenType specification

This package currently provides the opentypespec.tags module, which exports FEATURE_TAGS, SCRIPT_TAGS, LANGUAGE_TAGS and BASELINE_TAGS dictionaries, representing data from the Layout Tag Registry

Simon Cozens 4 Dec 01, 2022
A basic animation modding workflow for FFXIV

AnimAssist Provides a quick and easy way to mod animations in FFXIV. You will need: Before anything, the VC++2012 32-bit Redist from here. Havok will

liam 37 Dec 16, 2022
UdemyPy is a bot that hourly looks for Udemy free courses and post them in my Telegram Channel: Free Courses.

UdemyPy UdemyPy is a bot that hourly looks for Udemy free courses and post them in my Telegram Channel: Free Courses. How does it work? For publishing

88 Dec 25, 2022
Users can read others' travel journeys in addition to being able to upload and delete posts detailing their own experiences

Users can read others' travel journeys in addition to being able to upload and delete posts detailing their own experiences! Posts are organized by country and destination within that country.

Christopher Zeas 1 Feb 03, 2022
Python scripts to interact with Upper Deck ePack online trading card platform

This script should connect to the Upper Deck ePack API using your browser cookies and download a list of your current collection and save it as a CSV.

Adrian Kent 1 Nov 22, 2021
JD-backup is an advanced Python script, that will extract all links from a jDownloader 2 file list and export them to a text file.

JD-backup is an advanced Python script, that will extract all links from a jDownloader 2 file list and export them to a text file.

Kraken.snv 3 Jun 07, 2022
Script de monitoramento das teclas do teclado, salvando todos os dados digitados em um arquivo de log juntamente com os dados de rede.

listenerPython Script de monitoramento das teclas do teclado, salvando todos os dados digitados em um arquivo de log juntamente com os dados de rede.

Vinรญcius Azevedo 4 Nov 27, 2022
BridgeWalk is a partially-observed reinforcement learning environment with dynamics of varying stochasticity.

BridgeWalk is a partially-observed reinforcement learning environment with dynamics of varying stochasticity. The player needs to walk along a bridge to reach a goal location. When the player walks o

Danijar Hafner 6 Jun 13, 2022
Run CodeServer on Google Colab using Inlets in less than 60 secs using your own domain.

Inlets Colab Run CodeServer on Colab using Inlets in less than 60 secs using your own domain. Features Optimized for Inlets/InletsPro Use your own Cus

2 Dec 30, 2021
bamboo-engine ๆ˜ฏไธ€ไธช้€š็”จ็š„ๆต็จ‹ๅผ•ๆ“Ž๏ผŒไป–ๅฏไปฅ่งฃๆž๏ผŒๆ‰ง่กŒ๏ผŒ่ฐƒๅบฆ็”ฑ็”จๆˆทๅˆ›ๅปบ็š„ๆต็จ‹ไปปๅŠก๏ผŒๅนถๆไพ›ไบ†ๅฆ‚ๆš‚ๅœ๏ผŒๆ’ค้”€๏ผŒ่ทณ่ฟ‡๏ผŒๅผบๅˆถๅคฑ่ดฅ๏ผŒ้‡่ฏ•ๅ’Œ้‡ๅ…ฅ็ญ‰็ญ‰็ตๆดป็š„ๆŽงๅˆถ่ƒฝๅŠ›ๅ’Œๅนถ่กŒใ€ๅญๆต็จ‹็ญ‰่ฟ›้˜ถ็‰นๆ€ง๏ผŒๅนถๅฏ้€š่ฟ‡ๆฐดๅนณๆ‰ฉๅฑ•ๆฅ่ฟ›ไธ€ๆญฅๆๅ‡ไปปๅŠก็š„ๅนถๅ‘ๅค„็†่ƒฝๅŠ›ใ€‚

bamboo-engine ๆ˜ฏไธ€ไธช้€š็”จ็š„ๆต็จ‹ๅผ•ๆ“Ž๏ผŒไป–ๅฏไปฅ่งฃๆž๏ผŒๆ‰ง่กŒ๏ผŒ่ฐƒๅบฆ็”ฑ็”จๆˆทๅˆ›ๅปบ็š„ๆต็จ‹ไปปๅŠก๏ผŒๅนถๆไพ›ไบ†ๅฆ‚ๆš‚ๅœ๏ผŒๆ’ค้”€๏ผŒ่ทณ่ฟ‡๏ผŒๅผบๅˆถๅคฑ่ดฅ๏ผŒ้‡่ฏ•ๅ’Œ้‡ๅ…ฅ็ญ‰็ญ‰็ตๆดป็š„ๆŽงๅˆถ่ƒฝๅŠ›ๅ’Œๅนถ่กŒใ€ๅญๆต็จ‹็ญ‰่ฟ›้˜ถ็‰นๆ€ง๏ผŒๅนถๅฏ้€š่ฟ‡ๆฐดๅนณๆ‰ฉๅฑ•ๆฅ่ฟ›ไธ€ๆญฅๆๅ‡ไปปๅŠก็š„ๅนถๅ‘ๅค„็†่ƒฝๅŠ›ใ€‚ ๆ•ดไฝ“่ฎพ่ฎก Quick start 1. ๅฎ‰่ฃ…ไพ่ต– 2. ้กน็›ฎๅˆๅง‹

่…พ่ฎฏ่“้ฒธ 96 Dec 15, 2022
Collection of tools to be more productive in your work environment and to avoid certain repetitive tasks. ๐Ÿ’›๐Ÿ’™๐Ÿ’š

Collection of tools to be more productive in your work environment and to avoid certain repetitive tasks. ๐Ÿ’›๐Ÿ’™๐Ÿ’š

Raja Rakotonirina 2 Jan 10, 2022
Developing a python based app prototype with KivyMD framework for a competition :))

Developing a python based app prototype with KivyMD framework for a competition :))

Jay Desale 1 Jan 10, 2022