Skip to content

Commit 8bd74b7

Browse files
committed
add devenv
1 parent f868e8f commit 8bd74b7

File tree

9 files changed

+238
-1
lines changed

9 files changed

+238
-1
lines changed

.envrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
export DIRENV_WARN_TIMEOUT=20s
4+
5+
eval "$(devenv direnvrc)"
6+
7+
# `use devenv` supports the same options as the `devenv shell` command.
8+
#
9+
# To silence all output, use `--quiet`.
10+
#
11+
# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true
12+
use devenv

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ htmlcov
3838
pyvenv.cfg
3939
.idea/
4040
share/
41+
# Devenv
42+
.devenv*
43+
devenv.local.nix
44+
devenv.local.yaml

buildout-constraints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
setuptools<80.9.0
2+
zc.buildout==4.1.12
3+
packaging < 24.0

devenv.lock

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1765809457,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "da793b6ea48239c00a227c59a895f7febe3f9acc",
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": 1765121682,
23+
"owner": "edolstra",
24+
"repo": "flake-compat",
25+
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
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": 1765121682,
38+
"owner": "edolstra",
39+
"repo": "flake-compat",
40+
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
41+
"type": "github"
42+
},
43+
"original": {
44+
"owner": "edolstra",
45+
"repo": "flake-compat",
46+
"type": "github"
47+
}
48+
},
49+
"git-hooks": {
50+
"inputs": {
51+
"flake-compat": "flake-compat",
52+
"gitignore": "gitignore",
53+
"nixpkgs": [
54+
"nixpkgs"
55+
]
56+
},
57+
"locked": {
58+
"lastModified": 1765464257,
59+
"owner": "cachix",
60+
"repo": "git-hooks.nix",
61+
"rev": "09e45f2598e1a8499c3594fe11ec2943f34fe509",
62+
"type": "github"
63+
},
64+
"original": {
65+
"owner": "cachix",
66+
"repo": "git-hooks.nix",
67+
"type": "github"
68+
}
69+
},
70+
"gitignore": {
71+
"inputs": {
72+
"nixpkgs": [
73+
"git-hooks",
74+
"nixpkgs"
75+
]
76+
},
77+
"locked": {
78+
"lastModified": 1762808025,
79+
"owner": "hercules-ci",
80+
"repo": "gitignore.nix",
81+
"rev": "cb5e3fdca1de58ccbc3ef53de65bd372b48f567c",
82+
"type": "github"
83+
},
84+
"original": {
85+
"owner": "hercules-ci",
86+
"repo": "gitignore.nix",
87+
"type": "github"
88+
}
89+
},
90+
"nixpkgs": {
91+
"locked": {
92+
"lastModified": 1764580874,
93+
"owner": "cachix",
94+
"repo": "devenv-nixpkgs",
95+
"rev": "dcf61356c3ab25f1362b4a4428a6d871e84f1d1d",
96+
"type": "github"
97+
},
98+
"original": {
99+
"owner": "cachix",
100+
"ref": "rolling",
101+
"repo": "devenv-nixpkgs",
102+
"type": "github"
103+
}
104+
},
105+
"nixpkgs-python": {
106+
"inputs": {
107+
"flake-compat": "flake-compat_2",
108+
"nixpkgs": [
109+
"nixpkgs"
110+
]
111+
},
112+
"locked": {
113+
"lastModified": 1765052656,
114+
"owner": "cachix",
115+
"repo": "nixpkgs-python",
116+
"rev": "04b27dbad2e004cb237db202f21154eea3c4f89f",
117+
"type": "github"
118+
},
119+
"original": {
120+
"owner": "cachix",
121+
"repo": "nixpkgs-python",
122+
"type": "github"
123+
}
124+
},
125+
"root": {
126+
"inputs": {
127+
"devenv": "devenv",
128+
"git-hooks": "git-hooks",
129+
"nixpkgs": "nixpkgs",
130+
"nixpkgs-python": "nixpkgs-python",
131+
"pre-commit-hooks": [
132+
"git-hooks"
133+
]
134+
}
135+
}
136+
},
137+
"root": "root",
138+
"version": 7
139+
}

devenv.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{ pkgs, lib, config, inputs, ... }:
2+
3+
{
4+
# https://devenv.sh/basics/
5+
env.GREET = "devenv";
6+
7+
# https://devenv.sh/packages/
8+
packages = [ pkgs.git ];
9+
10+
# https://devenv.sh/languages/
11+
languages.python.enable = true;
12+
languages.python.uv.enable = true;
13+
languages.python.version = "3.11";
14+
15+
16+
# https://devenv.sh/processes/
17+
# processes.dev.exec = "${lib.getExe pkgs.watchexec} -n -- ls -la";
18+
19+
# https://devenv.sh/services/
20+
# services.postgres.enable = true;
21+
22+
# https://devenv.sh/scripts/
23+
scripts.hello.exec = ''
24+
echo hello from $GREET
25+
'';
26+
27+
# https://devenv.sh/basics/
28+
enterShell = ''
29+
hello # Run scripts directly
30+
git --version # Use packages
31+
'';
32+
33+
# https://devenv.sh/tasks/
34+
# tasks = {
35+
# "myproj:setup".exec = "mytool build";
36+
# "devenv:enterShell".after = [ "myproj:setup" ];
37+
# };
38+
39+
# https://devenv.sh/tests/
40+
enterTest = ''
41+
echo "Running tests"
42+
git --version | grep --color=auto "${pkgs.git.version}"
43+
'';
44+
45+
# https://devenv.sh/git-hooks/
46+
# git-hooks.hooks.shellcheck.enable = true;
47+
48+
# See full reference at https://devenv.sh/reference/options/
49+
}

devenv.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
inputs:
2+
nixpkgs:
3+
url: github:cachix/devenv-nixpkgs/rolling
4+
nixpkgs-python:
5+
url: github:cachix/nixpkgs-python
6+
inputs:
7+
nixpkgs:
8+
follows: nixpkgs

justfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
instance:
2+
make bin/instance
3+
4+
fg: instance
5+
bin/instance fg
6+
7+
omelette:
8+
make parts/omelette
9+
echo "cd parts/omelette"
10+
11+

makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin/instance: test-6.0.x.cfg buildout-constraints.txt
2+
uv tool run --from zc.buildout -c buildout-constraints.txt buildout -c test-6.0.x.cfg install instance
3+
4+
parts/omelette: buildout.cfg buildout-constraints.txt
5+
uv tool run --from zc.buildout -c buildout-constraints.txt buildout -c test-6.0.x.cfg install omelette

test-6.0.x.cfg

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[buildout]
22
extends =
33
https://raw.githubusercontent.com/collective/buildout.plonetest/master/pytest-6.0.x.cfg
4+
https://dist.plone.org/release/6.0.8/versions.cfg
45
base.cfg
56
auto-checkout=
67
collective.plonefinder
78
collective.quickupload
9+
sources-dir = devel
810

911
[instance]
1012
recipe = plone.recipe.zope2instance
@@ -20,7 +22,11 @@ six = 1.10.0
2022
selenium = 4.12.0
2123
robotframework-seleniumlibrary = 6.1.3
2224
Pillow = 9.4.0
23-
wheel = 0.38.4
25+
wheel =
26+
zc.buildout =
27+
setuptools =
28+
mr.developer = 2.0.4
29+
packaging = 23.2
2430

2531
[sources]
2632
collective.plonefinder = git ${remotes:collective}/collective.plonefinder.git pushurl=${remotes:collective_push}/collective.plonefinder.git branch=plone5

0 commit comments

Comments
 (0)