Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-install dependencies if not installed #174

Open
PatrickAlphaC opened this issue Dec 2, 2024 · 3 comments
Open

auto-install dependencies if not installed #174

PatrickAlphaC opened this issue Dec 2, 2024 · 3 comments

Comments

@PatrickAlphaC
Copy link
Member

I should be able to run:

mox build

or

mox run deploy

And it installs deps if they are not installed.

@floor-licker
Copy link
Contributor

I'd love to work on this. I'm not familiar with the mox command though. My experience is that convention would be to use pip and to include a requirements.txt file, then the set up process would be something like

## Installation
git clone https://github.com/username/repo.git
cd repo
pip install -r requirements.txt

@PatrickAlphaC
Copy link
Member Author

Hi @floor-licker, go for it! But here is what it entails.

Dependencies

Moccasin has it's own sort of smart contract dependencies that can be git or pypi based. You can see the dependencies docs here: https://cyfrin.github.io/moccasin/core_concepts/dependencies.html

When you run:

mox build

It should essentially do:

# Check for dependencies, if not installed, install them with `mox install`
mox build

Let me know if that does or doesn't make sense.

@floor-licker
Copy link
Contributor

Presently when calling mox --help I get

positional arguments:
  {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util}
    init                Initialize a new project.
    compile (build)     Compiles the project.
    test                Runs all tests in the project.
    run (script)        Runs a script with the project's context.
    deploy              Deploys a contract named in the config with a deploy script.
    wallet              Wallet management utilities.
    console             BETA, USE AT YOUR OWN RISK: Interact with the network in a python shell.
    install             Installs the project's dependencies.
    purge               Purge a given dependency
    config              View the Moccasin configuration.
    explorer            Work with block explorers to get data.
    inspect             Inspect compiler data of a contract.
    deployments         View deployments of the project from your DB.
    utils (u, util)     Helpful utilities - right now it's just the one.

which seems to suggest that there might already be some build functionality within the logic of the compile argument? I looked through the corresponding logic which is compile.py and there doesn't seem to be anything related to building or dependencies in that file. Should I also update the output of mox --help to add in the build command and remove "(build)" from the compile command?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants