-
Notifications
You must be signed in to change notification settings - Fork 2
Modernise development environment with Devbox and uv #20
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| output/ | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,27 @@ | ||
| FROM python:3.8.1-alpine | ||
| FROM jetpackio/devbox:latest | ||
|
|
||
| RUN apk add bash | ||
| RUN pip install pipenv | ||
| USER root:root | ||
|
|
||
| ADD . /app | ||
| RUN rm -rf /homeless-shelter && \ | ||
| mkdir -p /etc/nix && \ | ||
| echo "sandbox = false" > /etc/nix/nix.conf && \ | ||
| echo "build-users-group =" >> /etc/nix/nix.conf | ||
|
|
||
| ENV HOME=/tmp | ||
|
|
||
| WORKDIR /app | ||
| RUN pipenv install --dev --system --deploy --ignore-pipfile | ||
| RUN chown devbox:devbox /app | ||
|
|
||
| USER devbox | ||
|
|
||
| # Copy dependency files first for better caching | ||
| COPY --chown=devbox:devbox devbox.json devbox.lock ./ | ||
| COPY --chown=devbox:devbox pyproject.toml uv.lock ./ | ||
| COPY --chown=devbox:devbox scripts/ ./scripts/ | ||
|
|
||
| # Install dependencies in separate layer for caching | ||
| RUN devbox run install | ||
|
|
||
| CMD ["./ci/_test.sh"] | ||
| # Copy remaining files | ||
| COPY --chown=devbox:devbox ci/ ./ci/ | ||
| COPY --chown=devbox:devbox src/ ./src/ | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Running Unit Tests and Coverage" | ||
| echo "Installing dependencies..." | ||
| devbox run install | ||
|
|
||
| coverage run | ||
| coverage report | ||
| echo "Linting code..." | ||
| devbox run lint | ||
|
|
||
| echo "Running Unit Tests and Coverage..." | ||
| devbox run test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "iress-xplan-api-examples", | ||
| "packages": [ | ||
| "python@3.14", | ||
| "uv@latest" | ||
| ], | ||
| "shell": { | ||
| "init_hook": [ | ||
| ". ${VENV_DIR}/bin/activate" | ||
| ], | ||
| "scripts": { | ||
| "call": "scripts/call.sh \"$@\"", | ||
| "format": "scripts/format.sh \"$@\"", | ||
| "help": "scripts/help.sh \"$@\"", | ||
| "install": "scripts/install.sh \"$@\"", | ||
| "lint": "scripts/lint.sh \"$@\"", | ||
| "test": "scripts/test.sh \"$@\"", | ||
| "upgrade": "scripts/upgrade.sh \"$@\"" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| { | ||
| "lockfile_version": "1", | ||
| "packages": { | ||
| "github:NixOS/nixpkgs/nixpkgs-unstable": { | ||
| "last_modified": "2026-01-19T00:39:23Z", | ||
| "resolved": "github:NixOS/nixpkgs/bde09022887110deb780067364a0818e89258968?lastModified=1768783163&narHash=sha256-tLj4KcRDLakrlpvboTJDKsrp6z2XLwyQ4Zmo%2Bw8KsY4%3D" | ||
| }, | ||
| "python@3.14": { | ||
| "last_modified": "2026-01-23T17:20:52Z", | ||
| "plugin_version": "0.0.4", | ||
| "resolved": "github:NixOS/nixpkgs/a1bab9e494f5f4939442a57a58d0449a109593fe#python314", | ||
| "source": "devbox-search", | ||
| "version": "3.14.2", | ||
| "systems": { | ||
| "aarch64-darwin": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/8bwmgvfcyys3kfia055ih7gask3fid7s-python3-3.14.2", | ||
| "default": true | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/8bwmgvfcyys3kfia055ih7gask3fid7s-python3-3.14.2" | ||
| }, | ||
| "aarch64-linux": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/9zj2a40gbfh9scynfmfs1s9wx2q01yv3-python3-3.14.2", | ||
| "default": true | ||
| }, | ||
| { | ||
| "name": "debug", | ||
| "path": "/nix/store/j8ryg1l3z8ibf9rn848y1vll0f0wcab7-python3-3.14.2-debug" | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/9zj2a40gbfh9scynfmfs1s9wx2q01yv3-python3-3.14.2" | ||
| }, | ||
| "x86_64-darwin": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/0mnhsagxg8cp6cr9g0fz2dihw469ih8s-python3-3.14.2", | ||
| "default": true | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/0mnhsagxg8cp6cr9g0fz2dihw469ih8s-python3-3.14.2" | ||
| }, | ||
| "x86_64-linux": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/hd3h6gjpy7pf5himwf8sfqb3108pz5ld-python3-3.14.2", | ||
| "default": true | ||
| }, | ||
| { | ||
| "name": "debug", | ||
| "path": "/nix/store/2wvc4f32yycchbip56mlxixjm2sdzw2y-python3-3.14.2-debug" | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/hd3h6gjpy7pf5himwf8sfqb3108pz5ld-python3-3.14.2" | ||
| } | ||
| } | ||
| }, | ||
| "uv@latest": { | ||
| "last_modified": "2026-01-30T02:32:49Z", | ||
| "resolved": "github:NixOS/nixpkgs/6308c3b21396534d8aaeac46179c14c439a89b8a#uv", | ||
| "source": "devbox-search", | ||
| "version": "0.9.27", | ||
| "systems": { | ||
| "aarch64-darwin": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/bj9jidx7h317hmnz220qpka6850sjvi1-uv-0.9.27", | ||
| "default": true | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/bj9jidx7h317hmnz220qpka6850sjvi1-uv-0.9.27" | ||
| }, | ||
| "aarch64-linux": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/2703hnsgll85c1rpzzqycnmp0jvy579z-uv-0.9.27", | ||
| "default": true | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/2703hnsgll85c1rpzzqycnmp0jvy579z-uv-0.9.27" | ||
| }, | ||
| "x86_64-darwin": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/il24573a65xa0bfy2d6kli6nvnx80qhv-uv-0.9.27", | ||
| "default": true | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/il24573a65xa0bfy2d6kli6nvnx80qhv-uv-0.9.27" | ||
| }, | ||
| "x86_64-linux": { | ||
| "outputs": [ | ||
| { | ||
| "name": "out", | ||
| "path": "/nix/store/k9b6fbx5pzj04fws4na77i4pb5l64li8-uv-0.9.27", | ||
| "default": true | ||
| } | ||
| ], | ||
| "store_path": "/nix/store/k9b6fbx5pzj04fws4na77i4pb5l64li8-uv-0.9.27" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| [project] | ||
| name = "iress-xplan-api-examples" | ||
| requires-python = ">=3.14" | ||
| version = "1.0" | ||
|
|
||
| dependencies = [ | ||
| "pyotp", | ||
| "requests", | ||
| "urllib3" | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "coverage", | ||
| "mypy", | ||
| "pytest", | ||
| "pytest-cov", | ||
| "responses", | ||
| "ruff", | ||
| "types-requests" | ||
| ] | ||
|
|
||
| [tool.coverage.run] | ||
| branch = true | ||
| source = ["src"] | ||
| omit = [ | ||
| # omit anything in a .local directory anywhere | ||
| "*/.local/*", | ||
| # Omit any test files | ||
| "*/*_test.py", | ||
| ] | ||
|
|
||
| # [tool.coverage.xml] | ||
| # output = "./coverage.xml" | ||
|
|
||
| [tool.mypy] | ||
| platform="linux" | ||
|
|
||
| show_column_numbers=true | ||
| show_error_context=false | ||
| error_summary=true | ||
|
|
||
| # treat Optional per PEP 484 | ||
| strict_optional=true | ||
| strict_equality=true | ||
|
|
||
| # https://mypy.readthedocs.io/en/stable/config_file.html#configuring-warnings | ||
| warn_redundant_casts=true | ||
| warn_unused_ignores=true | ||
| warn_unreachable=true | ||
| warn_no_return=true | ||
| warn_return_any=true | ||
|
|
||
| # Be real strict on using types | ||
| check_untyped_defs=true | ||
| disallow_incomplete_defs=true | ||
| disallow_untyped_calls=true | ||
| disallow_untyped_decorators=false | ||
| disallow_untyped_defs=true | ||
|
|
||
| # Support for types is not yet available | ||
| ignore_missing_imports = true | ||
|
|
||
| [tool.pytest.ini_options] | ||
| markers = [ | ||
| "integration: marks tests as integration (these are not run by default)." | ||
| ] | ||
|
|
||
| [tool.ruff] | ||
| line-length = 90 | ||
| preview = true | ||
|
|
||
| [tool.ruff.lint] | ||
| select = [ | ||
| "F", "E", "W", "C90", "I", "N", "D2", "UP", "YTT", "ANN", "ASYNC", "S", | ||
| "B", "A", "C4", "DTZ", "T10", "FA", "ISC", "ICN", | ||
| "LOG", "G", "INP", "PIE", "PT", "Q", "RSE", "RET", "SLF", "SLOT", "SIM", | ||
| "TID", "TCH", "ARG", "PTH", "TD", "FIX", "ERA", "PL", "TRY", "FLY", | ||
| "PERF", "FURB", "RUF" | ||
| ] | ||
|
|
||
| ignore = ["E203", "S101", "S311", "D203", "D211", "D213", "ISC001", "ANN401", "TRY003", "ERA001", "PLW0603"] | ||
|
|
||
| [tool.ruff.lint.mccabe] | ||
| max-complexity = 10 | ||
|
|
||
| [tool.ruff.lint.pylint] | ||
| max-args = 6 | ||
|
|
||
| [tool.ruff.lint.per-file-ignores] | ||
| "*_test.py" = ["S105", "FBT", "PLR2004", "PLR6301", "PLC2801"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| # This script is used to run the commands. | ||
| set -euo pipefail | ||
|
|
||
| PYTHONPATH=$(pwd)/src python src/call.py "$@" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.