Skip to content

Commit 5f0673c

Browse files
authored
chore(pop-cli): remove contract from default features (#1003)
* chore: remove contracts as default feat * chore: CI still runs contract tests * fix: leaking integration-tests feat chore: wrong subs
1 parent 79140aa commit 5f0673c

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
uses: actions-rs/clippy-check@v1
122122
with:
123123
token: ${{ secrets.GITHUB_TOKEN }}
124-
args: --all-targets -- -D warnings
124+
args: --no-default-features --features telemetry,contract,chain --all-targets -- -D warnings
125125

126126
docker:
127127
runs-on: ubuntu-latest
@@ -154,8 +154,8 @@ jobs:
154154
shared-key: pop-cache-docs
155155
save-if: ${{ github.ref == 'refs/heads/main' }}
156156

157-
- name: Check no default features
158-
run: cargo doc --locked --no-deps
157+
- name: Check all features
158+
run: cargo doc --locked --no-default-features --features telemetry,contract,chain --no-deps
159159

160160
documentation-tests:
161161
needs:
@@ -184,4 +184,4 @@ jobs:
184184
shared-key: pop-cache
185185

186186
- name: Run doc tests
187-
run: cargo test --locked --doc
187+
run: cargo test --locked --no-default-features --features telemetry,contract,chain --doc

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Build and archive instrumented tests
7171
run: |
7272
source <(cargo llvm-cov show-env --export-prefix --target x86_64-unknown-linux-gnu --coverage-target-only)
73-
cargo nextest archive --locked --workspace --lib --bins --archive-file nextest-archive.tar.zst
73+
cargo nextest archive --locked --workspace --no-default-features --features telemetry,contract,chain --lib --bins --archive-file nextest-archive.tar.zst
7474
env:
7575
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7676

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Pop CLI is organized as a Cargo workspace:
1515
- Packaging and release assets live in `debian/`, `Dockerfile*`, and `flake.nix`/`flake.lock` for Nix builds.
1616

1717
### Feature Flags
18-
- **Default features**: `["chain", "telemetry", "contract"]`
18+
- **Default features**: `["chain", "telemetry"]`
1919
- **`chain`** - Parachain development tools (includes `wallet-integration`)
20-
- **`contract`** - ink! smart contract support (includes `wallet-integration`)
20+
- **`contract`** - ink! smart contract support (opt-in, includes `wallet-integration`)
2121
- **`telemetry`** - Anonymous usage analytics
2222
- **`wallet-integration`** - Browser wallet connectivity for signing transactions
2323
- **`integration-tests`** - Enable integration test helpers in pop-common
@@ -46,7 +46,7 @@ Commands in `crates/pop-cli/src/commands/`:
4646
## Build, Test, and Development Commands
4747

4848
### Build
49-
- `cargo build` - Build with default features (chain, contract, telemetry)
49+
- `cargo build` - Build with default features (chain, telemetry)
5050
- `cargo build --no-default-features --features chain` - Build for parachain functionality only
5151
- `cargo build --no-default-features --features contract` - Build for smart contracts functionality only
5252

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,32 @@ On the [Pop Docs website](https://learn.onpop.io) you will find:
106106

107107
## Building Pop CLI locally
108108

109-
Build the tool only for Parachain functionality:
109+
Build with default features (parachain support):
110+
111+
```sh
112+
cargo build
113+
```
114+
115+
Build with Smart Contracts support (opt-in):
116+
117+
```sh
118+
cargo build --features contract
119+
```
120+
121+
Build for parachain functionality only:
110122

111123
```sh
112124
cargo build --no-default-features --features chain
113125
```
114126

115-
Build the tool only for Smart Contracts functionality:
127+
Build for Smart Contracts functionality only:
116128

117129
```sh
118130
cargo build --no-default-features --features contract
119131
```
120132

133+
> :information_source: Smart contract (ink!) support is available as an opt-in feature. To install with contract support: `cargo install pop-cli --locked --features contract`
134+
121135
## Testing Pop CLI
122136

123137
To test the tool locally. Due to the time it can take to build a Parachain or a Smart Contract, some tests have been

crates/pop-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ scale.workspace = true
8282
temp-env.workspace = true
8383

8484
[features]
85-
default = ["chain", "telemetry", "contract"]
85+
default = ["chain", "telemetry"]
8686
chain = ["dep:pop-chains", "dep:pop-fork", "dep:git2", "dep:tracing-subscriber", "dep:scale-value", "wallet-integration"]
8787
contract = ["dep:pop-contracts", "wallet-integration"]
8888
telemetry = ["dep:pop-telemetry"]

crates/pop-cli/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ mod tests {
342342
"call chain"
343343
);
344344
// Call contract command display.
345+
#[cfg(feature = "contract")]
345346
assert_eq!(
346347
Cli {
347348
json: false,

0 commit comments

Comments
 (0)