Skip to content

Commit e369df3

Browse files
authored
Setup devenv.sh (#428)
* Setup devenv.sh Signed-off-by: Prabhu Subramanian <[email protected]> * pnpm add improvements Signed-off-by: Prabhu Subramanian <[email protected]> * cdxgen version check after install Signed-off-by: Prabhu Subramanian <[email protected]> * Bug fix Signed-off-by: Prabhu Subramanian <[email protected]> * Language-specific profiles Signed-off-by: Prabhu Subramanian <[email protected]> * Adds python marker for tomli Signed-off-by: Prabhu Subramanian <[email protected]> --------- Signed-off-by: Prabhu Subramanian <[email protected]>
1 parent e08f007 commit e369df3

File tree

12 files changed

+435
-7
lines changed

12 files changed

+435
-7
lines changed

.devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"customizations": {
3+
"vscode": {
4+
"extensions": [
5+
"mkhl.direnv"
6+
]
7+
}
8+
},
9+
"image": "ghcr.io/cachix/devenv/devcontainer:latest",
10+
"overrideCommand": false,
11+
"updateContentCommand": "devenv test"
12+
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ indent_size = 4
66
insert_final_newline = true
77
trim_trailing_whitespace = true
88

9-
[*.{yml,yaml}]
9+
[*.{yml,yaml,nix}]
1010
indent_size = 2

.github/workflows/pythonapp.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,31 @@ jobs:
6262
uv run depscan --purl "pkg:npm/@biomejs/[email protected]"
6363
env:
6464
PYTHONIOENCODING: utf-8
65+
66+
devenv:
67+
runs-on: ${{ matrix.os }}
68+
strategy:
69+
matrix:
70+
os: [ubuntu-latest, macos-latest]
71+
steps:
72+
- uses: actions/checkout@v4
73+
- name: Trim CI agent
74+
run: |
75+
chmod +x contrib/free_disk_space.sh
76+
./contrib/free_disk_space.sh
77+
- uses: cachix/install-nix-action@v26
78+
- uses: cachix/cachix-action@v14
79+
with:
80+
name: devenv
81+
- name: Install devenv.sh
82+
run: nix profile install nixpkgs#devenv
83+
- name: Build the devenv shell and run any pre-commit hooks
84+
run: devenv test
85+
- name: Run pytest with uv
86+
run: |
87+
devenv shell uv run pytest --cov=depscan test
88+
devenv shell uv run depscan --config .config/depscan-dev.toml
89+
- name: Run pytest with uv
90+
run: |
91+
devenv shell uv run depscan --purl "pkg:pypi/[email protected]"
92+
devenv shell uv run depscan --purl "pkg:pypi/[email protected]"

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,13 @@ reports/
141141
*.slices.json
142142
.idx/
143143
.theia/
144+
145+
# Devenv
146+
.devenv*
147+
devenv.local.nix
148+
149+
# direnv
150+
.direnv
151+
152+
# pre-commit
153+
.pre-commit-config.yaml

depscan/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ def run_depscan(args):
822822
pkg_max_risk_score=pkg_max_risk_score,
823823
risk_report_file=risk_report_file,
824824
)
825-
if not args.no_vuln_table and report_data:
825+
if not args.no_vuln_table and report_data and rtable:
826826
console.print(rtable)
827827
except Exception as e:
828828
LOG.error(e)

devenv.lock

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1746190425,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "b97652de96e5704fc313d865f2bd1cf8433c514c",
10+
"type": "github"
11+
},
12+
"original": {
13+
"dir": "src/modules",
14+
"owner": "cachix",
15+
"repo": "devenv",
16+
"type": "github"
17+
}
18+
},
19+
"flake-compat": {
20+
"flake": false,
21+
"locked": {
22+
"lastModified": 1733328505,
23+
"owner": "edolstra",
24+
"repo": "flake-compat",
25+
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
26+
"type": "github"
27+
},
28+
"original": {
29+
"owner": "edolstra",
30+
"repo": "flake-compat",
31+
"type": "github"
32+
}
33+
},
34+
"flake-compat_2": {
35+
"flake": false,
36+
"locked": {
37+
"lastModified": 1733328505,
38+
"owner": "edolstra",
39+
"repo": "flake-compat",
40+
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
41+
"type": "github"
42+
},
43+
"original": {
44+
"owner": "edolstra",
45+
"repo": "flake-compat",
46+
"type": "github"
47+
}
48+
},
49+
"flake-compat_3": {
50+
"flake": false,
51+
"locked": {
52+
"lastModified": 1733328505,
53+
"owner": "edolstra",
54+
"repo": "flake-compat",
55+
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
56+
"type": "github"
57+
},
58+
"original": {
59+
"owner": "edolstra",
60+
"repo": "flake-compat",
61+
"type": "github"
62+
}
63+
},
64+
"flake-utils": {
65+
"inputs": {
66+
"systems": "systems"
67+
},
68+
"locked": {
69+
"lastModified": 1731533236,
70+
"owner": "numtide",
71+
"repo": "flake-utils",
72+
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
73+
"type": "github"
74+
},
75+
"original": {
76+
"owner": "numtide",
77+
"repo": "flake-utils",
78+
"type": "github"
79+
}
80+
},
81+
"git-hooks": {
82+
"inputs": {
83+
"flake-compat": "flake-compat",
84+
"gitignore": "gitignore",
85+
"nixpkgs": [
86+
"nixpkgs"
87+
]
88+
},
89+
"locked": {
90+
"lastModified": 1742649964,
91+
"owner": "cachix",
92+
"repo": "git-hooks.nix",
93+
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
94+
"type": "github"
95+
},
96+
"original": {
97+
"owner": "cachix",
98+
"repo": "git-hooks.nix",
99+
"type": "github"
100+
}
101+
},
102+
"gitignore": {
103+
"inputs": {
104+
"nixpkgs": [
105+
"git-hooks",
106+
"nixpkgs"
107+
]
108+
},
109+
"locked": {
110+
"lastModified": 1709087332,
111+
"owner": "hercules-ci",
112+
"repo": "gitignore.nix",
113+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
114+
"type": "github"
115+
},
116+
"original": {
117+
"owner": "hercules-ci",
118+
"repo": "gitignore.nix",
119+
"type": "github"
120+
}
121+
},
122+
"nixpkgs": {
123+
"locked": {
124+
"lastModified": 1733477122,
125+
"owner": "cachix",
126+
"repo": "devenv-nixpkgs",
127+
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857",
128+
"type": "github"
129+
},
130+
"original": {
131+
"owner": "cachix",
132+
"ref": "rolling",
133+
"repo": "devenv-nixpkgs",
134+
"type": "github"
135+
}
136+
},
137+
"nixpkgs-python": {
138+
"inputs": {
139+
"flake-compat": "flake-compat_2",
140+
"nixpkgs": [
141+
"nixpkgs"
142+
]
143+
},
144+
"locked": {
145+
"lastModified": 1746223523,
146+
"owner": "cachix",
147+
"repo": "nixpkgs-python",
148+
"rev": "3f5f1dbe0122a1741907aa5ab76f7337ffcd2ccb",
149+
"type": "github"
150+
},
151+
"original": {
152+
"owner": "cachix",
153+
"repo": "nixpkgs-python",
154+
"type": "github"
155+
}
156+
},
157+
"nixpkgs-ruby": {
158+
"inputs": {
159+
"flake-compat": "flake-compat_3",
160+
"flake-utils": "flake-utils",
161+
"nixpkgs": [
162+
"nixpkgs"
163+
]
164+
},
165+
"locked": {
166+
"lastModified": 1745387063,
167+
"owner": "bobvanderlinden",
168+
"repo": "nixpkgs-ruby",
169+
"rev": "4363adc15a1137dc4b883a655e8f1db256e3c2e4",
170+
"type": "github"
171+
},
172+
"original": {
173+
"owner": "bobvanderlinden",
174+
"repo": "nixpkgs-ruby",
175+
"type": "github"
176+
}
177+
},
178+
"nixpkgs-unstable": {
179+
"locked": {
180+
"lastModified": 1746206129,
181+
"owner": "nixos",
182+
"repo": "nixpkgs",
183+
"rev": "9a7caecf30a0494c88b7daeeed29244cd9a52e7d",
184+
"type": "github"
185+
},
186+
"original": {
187+
"owner": "nixos",
188+
"ref": "nixpkgs-unstable",
189+
"repo": "nixpkgs",
190+
"type": "github"
191+
}
192+
},
193+
"root": {
194+
"inputs": {
195+
"devenv": "devenv",
196+
"git-hooks": "git-hooks",
197+
"nixpkgs": "nixpkgs",
198+
"nixpkgs-python": "nixpkgs-python",
199+
"nixpkgs-ruby": "nixpkgs-ruby",
200+
"nixpkgs-unstable": "nixpkgs-unstable",
201+
"pre-commit-hooks": [
202+
"git-hooks"
203+
]
204+
}
205+
},
206+
"systems": {
207+
"locked": {
208+
"lastModified": 1681028828,
209+
"owner": "nix-systems",
210+
"repo": "default",
211+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
212+
"type": "github"
213+
},
214+
"original": {
215+
"owner": "nix-systems",
216+
"repo": "default",
217+
"type": "github"
218+
}
219+
}
220+
},
221+
"root": "root",
222+
"version": 7
223+
}

0 commit comments

Comments
 (0)