-
Notifications
You must be signed in to change notification settings - Fork 36
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
Install rust globally #331
Changes from 34 commits
a5b0c84
7250ffa
69fba5e
0bb5667
5295378
2845d07
6906afa
cad2cbd
47c897e
7ef887f
6c22bac
e9542fe
67defe7
45e9698
362cb9b
edb1c59
0c9aaa9
d7681dd
87df9d4
84ce195
b3c6a0c
3cbff95
c597e34
485bfaf
d5999e9
837b794
39f1b77
177d263
648cb4c
340e5e1
fc8609a
8eea743
ad585ea
851bd30
d2af8f5
d8bb7a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,53 +5,52 @@ name: build | |
|
||
on: | ||
pull_request: | ||
branches: [ main, feat/* ] | ||
branches: [main, feat/*] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build and Test mxpy for ${{ matrix.os }}, python ${{ matrix.python-version }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: [3.8, 3.11] | ||
python-version: [3.11] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install -r requirements.txt | ||
pip3 install pytest | ||
- name: Install libtinfo5 | ||
if: ${{ matrix.os != 'macos-latest' }} | ||
run: | | ||
sudo apt update | ||
sudo apt install -y libtinfo5 | ||
- name: Set github_api_token | ||
run: | | ||
mkdir ~/multiversx-sdk | ||
export PYTHONPATH=. | ||
python3 -m multiversx_sdk_cli.cli config new test | ||
python3 -m multiversx_sdk_cli.cli config set github_api_token ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup test dependencies | ||
run: | | ||
python3 -m multiversx_sdk_cli.cli deps install testwallets | ||
python3 -m multiversx_sdk_cli.cli deps install wasm-opt | ||
- name: Run unit tests | ||
run: | | ||
export PYTHONPATH=. | ||
pytest . | ||
- name: Run CLI tests | ||
run: | | ||
python3 -m multiversx_sdk_cli.cli config set dependencies.vmtools.tag v1.4.60 | ||
cd ./multiversx_sdk_cli/tests | ||
source ./test_cli_contracts.sh && testAll || return 1 | ||
source ./test_cli_dns.sh && testOffline || return 1 | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install -r requirements.txt | ||
pip3 install pytest | ||
- name: Install libtinfo5 | ||
if: ${{ matrix.os != 'macos-latest' }} | ||
run: | | ||
sudo apt update | ||
sudo apt install -y libtinfo5 | ||
- name: Set github_api_token | ||
run: | | ||
mkdir ~/multiversx-sdk | ||
export PYTHONPATH=. | ||
python3 -m multiversx_sdk_cli.cli config new test | ||
python3 -m multiversx_sdk_cli.cli config set github_api_token ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup test dependencies | ||
run: | | ||
python3 -m multiversx_sdk_cli.cli deps install testwallets | ||
- name: Run unit tests | ||
run: | | ||
export PYTHONPATH=. | ||
pytest . | ||
- name: Run CLI tests | ||
run: | | ||
python3 -m multiversx_sdk_cli.cli config set dependencies.vmtools.tag v1.4.60 | ||
cd ./multiversx_sdk_cli/tests | ||
source ./test_cli_contracts.sh && testAll || return 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come that we don't need to install clang / llvm, as well? No C smart contracts in our tests? If so, we should add some tests for C contracts in the next PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we only use rust contracts in our tests |
||
source ./test_cli_dns.sh && testOffline || return 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,28 +150,18 @@ def get_defaults() -> Dict[str, Any]: | |
"dependencies.vmtools.urlTemplate.linux": "https://github.com/multiversx/mx-chain-vm-go/archive/{TAG}.tar.gz", | ||
"dependencies.vmtools.urlTemplate.osx": "https://github.com/multiversx/mx-chain-vm-go/archive/{TAG}.tar.gz", | ||
"dependencies.vmtools.urlTemplate.windows": "https://github.com/multiversx/mx-chain-vm-go/archive/{TAG}.tar.gz", | ||
"dependencies.llvm.tag": "v9-19feb", | ||
# ide.elrond.com will be removed, TBD if clang will still be downloaded | ||
"dependencies.llvm.urlTemplate.linux": "https://ide.elrond.com/vendor-llvm/{TAG}/linux-amd64.tar.gz?t=19feb", | ||
"dependencies.llvm.urlTemplate.osx": "https://ide.elrond.com/vendor-llvm/{TAG}/darwin-amd64.tar.gz?t=19feb", | ||
"dependencies.rust.resolution": "SDK", | ||
"dependencies.rust.tag": "nightly-2023-05-26", | ||
"dependencies.golang.resolution": "SDK", | ||
"dependencies.golang.tag": "go1.20.7", | ||
"dependencies.golang.urlTemplate.linux": "https://golang.org/dl/{TAG}.linux-amd64.tar.gz", | ||
"dependencies.golang.urlTemplate.osx": "https://golang.org/dl/{TAG}.darwin-amd64.tar.gz", | ||
"dependencies.golang.urlTemplate.windows": "https://golang.org/dl/{TAG}.windows-amd64.zip", | ||
"dependencies.wasm-opt.tag": "latest", | ||
"dependencies.twiggy.tag": "latest", | ||
"dependencies.testwallets.tag": "latest", | ||
"dependencies.testwallets.urlTemplate.linux": "https://github.com/multiversx/mx-sdk-testwallets/archive/{TAG}.tar.gz", | ||
"dependencies.testwallets.urlTemplate.osx": "https://github.com/multiversx/mx-sdk-testwallets/archive/{TAG}.tar.gz", | ||
"dependencies.testwallets.urlTemplate.windows": "https://github.com/multiversx/mx-sdk-testwallets/archive/{TAG}.tar.gz", | ||
"dependencies.wasm-opt.resolution": "SDK", | ||
"dependencies.wasm-opt.tag": "version_112", | ||
"dependencies.wasm-opt.urlTemplate.linux": "https://github.com/WebAssembly/binaryen/releases/download/{TAG}/binaryen-{TAG}-x86_64-linux.tar.gz", | ||
"dependencies.wasm-opt.urlTemplate.osx": "https://github.com/WebAssembly/binaryen/releases/download/{TAG}/binaryen-{TAG}-x86_64-macos.tar.gz", | ||
"dependencies.wasm-opt.urlTemplate.windows": "https://github.com/WebAssembly/binaryen/releases/download/{TAG}/binaryen-{TAG}-x86_64-windows.tar.gz", | ||
"dependencies.wasm-opt.tag": "0.112.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
"github_api_token": "", | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,22 @@ | |
from typing import Dict, List | ||
|
||
from multiversx_sdk_cli import config, errors | ||
from multiversx_sdk_cli.dependencies.modules import (CargoModule, TestWalletsModule, VMToolsModule, | ||
DependencyModule, GolangModule, Rust, StandaloneModule, WasmOptModule) | ||
from multiversx_sdk_cli.dependencies.modules import (DependencyModule, | ||
GolangModule, Rust, | ||
TestWalletsModule, | ||
VMToolsModule) | ||
|
||
logger = logging.getLogger("install") | ||
|
||
|
||
def install_module(key: str, tag: str = "", overwrite: bool = False): | ||
def install_module(key: str, overwrite: bool = False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, we are getting rid of |
||
if key == 'all': | ||
modules = _get_implicitly_installable_deps() | ||
modules = _get_all_deps() | ||
else: | ||
modules = [get_module_by_key(key)] | ||
|
||
for module in modules: | ||
module.install(tag, overwrite) | ||
module.install(overwrite) | ||
|
||
|
||
def get_module_directory(key: str) -> Path: | ||
|
@@ -46,26 +48,10 @@ def get_deps_dict() -> Dict[str, DependencyModule]: | |
|
||
|
||
def _get_all_deps() -> List[DependencyModule]: | ||
return _get_explicitly_installable_deps() + _get_implicitly_installable_deps() | ||
|
||
|
||
def _get_explicitly_installable_deps() -> List[DependencyModule]: | ||
return [ | ||
StandaloneModule(key="llvm", aliases=["clang", "cpp"]), | ||
Rust(key="rust"), | ||
GolangModule(key="golang") | ||
] | ||
|
||
|
||
def _get_implicitly_installable_deps() -> List[DependencyModule]: | ||
# See: https://github.com/multiversx/mx-sdk-py-cli/pull/55 | ||
|
||
return [ | ||
GolangModule(key="golang"), | ||
VMToolsModule(key="vmtools"), | ||
StandaloneModule(key="mx_chain_go", repo_name="mx-chain-go", organisation="multiversx"), | ||
StandaloneModule(key="mx_chain_proxy_go", repo_name="mx-chain-proxy-go", organisation="multiversx"), | ||
WasmOptModule(key="wasm-opt"), | ||
CargoModule(key="twiggy"), | ||
TestWalletsModule(key="testwallets") | ||
] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some unrelated whitespace changes in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll blame it on the formatter.