diff --git a/devbox.json b/devbox.json new file mode 100644 index 0000000..2657f37 --- /dev/null +++ b/devbox.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.2/.schema/devbox.schema.json", + "packages": { + "python312": "latest", + "jq": "latest" + }, + "shell": { + "init_hook": [ + "export PROJECT_ROOT=\"$(git rev-parse --show-toplevel 2>/dev/null || echo $DEVBOX_PROJECT_ROOT)\"", + "if [ ! -d \"$PROJECT_ROOT/.venv\" ]; then python -m venv $PROJECT_ROOT/.venv; fi", + "source $PROJECT_ROOT/.venv/bin/activate", + "if ! python -m pylint --version > /dev/null 2>&1; then echo 'Running pip install...'; pip install -r requirements.txt && pip install -e '.[test]'; fi" + ], + "scripts": { + "install": ["pip install -r requirements.txt && pip install -e '.[test]'"], + "test": ["python -m pytest segment/analytics/test/"], + "lint": ["pylint --rcfile=.pylintrc --reports=y --exit-zero segment/analytics"], + "format-check": ["flake8 --max-complexity=10 --statistics segment/analytics"], + "check": [ + "devbox run lint", + "devbox run format-check", + "devbox run test" + ], + "release": ["python setup.py sdist bdist_wheel", "twine upload dist/*"] + } + } +} diff --git a/devbox.lock b/devbox.lock new file mode 100644 index 0000000..42a88c0 --- /dev/null +++ b/devbox.lock @@ -0,0 +1,182 @@ +{ + "lockfile_version": "1", + "packages": { + "github:NixOS/nixpkgs/nixpkgs-unstable": { + "last_modified": "2026-05-06T02:58:03Z", + "resolved": "github:NixOS/nixpkgs/ed67bc86e84e51d4a88e73c7fd36006dc876476f?lastModified=1778036283&narHash=sha256-62EWg6lI0qyzm7oAx5cAnGkLutvJsRBe0KkEW2JDZCE%3D" + }, + "jq@latest": { + "last_modified": "2026-04-29T01:19:07Z", + "resolved": "github:NixOS/nixpkgs/ebc08544afa77957cc348ba72dc490ec73b87f68#jq", + "source": "devbox-search", + "version": "1.8.1", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/zpaiv3csv85i5qdhwlivlbg8a5clnqmh-jq-1.8.1-bin", + "default": true + }, + { + "name": "man", + "path": "/nix/store/vs9rx9xgqachcay4mn95m1gwifzxrhm4-jq-1.8.1-man", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/h46rnp90pvk5ky12r9drbzhl1fqlmjnf-jq-1.8.1-dev" + }, + { + "name": "doc", + "path": "/nix/store/iksz05vk9j78ls9agfg9blhax9azgv69-jq-1.8.1-doc" + }, + { + "name": "out", + "path": "/nix/store/inmyqx7646xrcqrwxipacv5gkf3ca6m3-jq-1.8.1" + } + ], + "store_path": "/nix/store/zpaiv3csv85i5qdhwlivlbg8a5clnqmh-jq-1.8.1-bin" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/blgzs73jx017qji4n78v4wg1qxcg3cav-jq-1.8.1-bin", + "default": true + }, + { + "name": "man", + "path": "/nix/store/s8h2klkc7rw485yqj3s73ancc5915v2m-jq-1.8.1-man", + "default": true + }, + { + "name": "doc", + "path": "/nix/store/r992wf8cylhf9ayxwf64lawdfxcr4cl8-jq-1.8.1-doc" + }, + { + "name": "out", + "path": "/nix/store/2v9443fs97gdg5mz9lk3q603hryhqijm-jq-1.8.1" + }, + { + "name": "dev", + "path": "/nix/store/lx675fc624glij1dh9iw89pavkvfkv73-jq-1.8.1-dev" + } + ], + "store_path": "/nix/store/blgzs73jx017qji4n78v4wg1qxcg3cav-jq-1.8.1-bin" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/cpq0n6nrgs7jwyr121qshzk2fvjkmjbh-jq-1.8.1-bin", + "default": true + }, + { + "name": "man", + "path": "/nix/store/flsm1xvpbr9681y4y8101v5c5m3qmcim-jq-1.8.1-man", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/0p7h41icsq99c08sym6iw4wzdsl35r13-jq-1.8.1-dev" + }, + { + "name": "doc", + "path": "/nix/store/h6wn2lzbxq1v2dypaj4kpv4nnkkm9yld-jq-1.8.1-doc" + }, + { + "name": "out", + "path": "/nix/store/spn7m9y4302yvw9zafpy1g2sz3z9xnx1-jq-1.8.1" + } + ], + "store_path": "/nix/store/cpq0n6nrgs7jwyr121qshzk2fvjkmjbh-jq-1.8.1-bin" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin", + "default": true + }, + { + "name": "man", + "path": "/nix/store/lsyqny7h1riwhzajwy2vjjdd63viiwvm-jq-1.8.1-man", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev" + }, + { + "name": "doc", + "path": "/nix/store/g2wlgi44rn837jdirpwi3lk5f2iy13zg-jq-1.8.1-doc" + }, + { + "name": "out", + "path": "/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1" + } + ], + "store_path": "/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin" + } + } + }, + "python312@latest": { + "last_modified": "2026-04-23T13:07:47Z", + "plugin_version": "0.0.4", + "resolved": "github:NixOS/nixpkgs/01fbdeef22b76df85ea168fbfe1bfd9e63681b30#python312", + "source": "devbox-search", + "version": "3.12.13", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/fn6fnl5cg8qnsn1xn3lwaahk48vyw9l7-python3-3.12.13", + "default": true + } + ], + "store_path": "/nix/store/fn6fnl5cg8qnsn1xn3lwaahk48vyw9l7-python3-3.12.13" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/jczbi6lb8vws7zc251v47bpijh805lyg-python3-3.12.13", + "default": true + }, + { + "name": "debug", + "path": "/nix/store/2x5zchy1i0bprgxdvn5crjjmc4dw83p1-python3-3.12.13-debug" + } + ], + "store_path": "/nix/store/jczbi6lb8vws7zc251v47bpijh805lyg-python3-3.12.13" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/074rsjnaz8sf3xdf09a16zcw1qf8cj81-python3-3.12.13", + "default": true + } + ], + "store_path": "/nix/store/074rsjnaz8sf3xdf09a16zcw1qf8cj81-python3-3.12.13" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/h3q2g9wq4x3q84164qsfm3lz5djj0bf3-python3-3.12.13", + "default": true + }, + { + "name": "debug", + "path": "/nix/store/8hjni6450l0l4m5cvlxjb6wn7r0ynffl-python3-3.12.13-debug" + } + ], + "store_path": "/nix/store/h3q2g9wq4x3q84164qsfm3lz5djj0bf3-python3-3.12.13" + } + } + } + } +} diff --git a/setup.py b/setup.py index f7cc5b5..c8ab0a3 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ "mock==2.0.0", "pylint==3.3.1", "flake8==3.7.9", + "pytest", ] setup(