Skip to main content

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.

Usage

$ 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:

$ glyph use --all
🔎 Discovering installed contracts...

 • Using contracts.placeholder

✅ Done.

TODO: add real example from pypi

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="author@example.com",

    license="MIT License",

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

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cairo-glyph-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file cairo-glyph-0.0.1.tar.gz.

File metadata

  • Download URL: cairo-glyph-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.9 Linux/4.15.0-167-generic

File hashes

Hashes for cairo-glyph-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a27d5e91bddf41daaed90bf6ca95728c6c173a96dca61e9308ef54189072f4e1
MD5 7d09a3a10f250c7eb14eb87763be1ec8
BLAKE2b-256 5b73b78e4e69343c39fb2f58a16bae04a8b45a27a3f75e26b9b6a38cf04a2414

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page