diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 47f4967..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM mcr.microsoft.com/devcontainers/python:0-3.10 - -RUN apt-get update && apt install git-lfs - -RUN python -m pip install --upgrade pip \ - && python -m pip install 'flit>=3.8.0' - -ENV FLIT_ROOT_INSTALL=1 - -COPY pyproject.toml . -RUN touch README.md \ - && mkdir -p src/arjan_codes_sw_design_mindset \ - && python -m flit install --only-deps --deps develop \ - && rm -r pyproject.toml README.md src \ No newline at end of file diff --git a/.devcontainer/claude-code/README.md b/.devcontainer/claude-code/README.md new file mode 100644 index 0000000..4e358b1 --- /dev/null +++ b/.devcontainer/claude-code/README.md @@ -0,0 +1,441 @@ +# Claude Code CLI - Local Dev Container Feature + +A local Dev Container Feature that installs the Claude Code CLI and bind-mounts your host machine's Claude configuration directory into the container. + +## What This Feature Does + +This feature combines two capabilities: + +1. **CLI Installation**: `install.sh` runs `pixi global install --channel https://prefix.dev/blooop claude-shim`, and downloads pixi to `/usr/local/bin/pixi` first if the base image does not already carry it +2. **Configuration Mounting**: Bind-mounts your host machine's `~/.claude` directory into the container, read-write + +## What Gets Installed + +- **Claude Code CLI**: The `claude` command becomes available in your container. It comes from the `claude-shim` package on the `blooop` prefix.dev channel, so that channel is a dependency of this feature. `install.sh` checks only that the pixi trampoline exists -- the binary it points at is downloaded on the first `claude` run. +- **VS Code Extension**: Automatically installs the `anthropic.claude-code` extension +- **Configuration Directories**: `install.sh` creates the `.claude/` tree, though it does so while the image is built -- at runtime the host's bind mount covers it + +## What Gets Mounted + +One mount, and it is the whole directory: + +``` +source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind +``` + +There is no `ro` flag and no per-file mount. The host and every container of every branch share one `~/.claude`, read-write, so anything running in a container can modify any of it -- `CLAUDE.md`, `settings.json`, `agents/`, `commands/` and `hooks/` included. + +### What That Means + +`hooks/` and `settings.json` are executed by Claude Code wherever it runs. Content a container writes there therefore runs on the **host**, the next time Claude Code starts on the host, and a `postCreateCommand` from a repository you have not read is enough to put it there. + +It is not a confidentiality boundary either: code running in the container holds the live Claude credentials the mount carries, and under `dl` a `GH_TOKEN` with repo and workflow scopes. + +### Why It Is Still One Read-Write Directory + +Sharing the directory is what makes credentials work across the host and every branch container. `.credentials.json` has to be writable because the access token is short-lived and a refresh has to persist -- a read-only or copied arrangement drifts into a re-auth. `.claude.json` has to be writable because Claude tracks per-workspace onboarding and trust state there, so a container that cannot write it re-onboards on every launch. + +Splitting the rest of the directory into separate read-only binds is possible and is not what this feature does today. What the container buys as it stands is reproducible dependencies and non-colliding concurrent work, not safety against hostile code. `blooop/wayfinder`'s `.devcontainer/devcontainer.json` states the same threat model in the comment above its `mounts` block. + +## Usage + +### Setup + +The feature is declared where the image is built, in `.devcontainer/ci/devcontainer.json`: + +```json +{ + "build": { + "dockerfile": "../Dockerfile", + "context": "." + }, + "features": { + "../claude-code": {} + } +} +``` + +CI publishes that image, and the `devcontainer.json` every branch launches from pulls it and declares neither `features` nor `runArgs`: + +```json +{ + "image": "ghcr.io/blooop/python_template/devcontainer:latest", + "containerEnv": { + "CLAUDE_CONFIG_DIR": "/home/vscode/.claude" + }, + "mounts": [ + "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind" + ] +} +``` + +Declaring the feature a second time there makes the devcontainer spec build a derived image on the first launch of every branch, reinstalling what the pulled image already carries. + +### Authentication Uses Host Credentials, Not Host Networking + +No OAuth flow runs inside the container. You authenticate `claude` once on the host, and the `~/.claude` bind mount plus `CLAUDE_CONFIG_DIR=/home/vscode/.claude` point the container at those same credentials, refresh tokens included. Every container of every branch reads them, and nothing has to reach the host's network to do it. + +### Why You Might Opt Into `--network=host` + +The one thing the bind mount does not give you is the interactive OAuth login *from inside* the container, which needs host networking to complete: + +1. You run `claude` → it starts a callback server on a random port in the container +2. Your browser opens the authorize page, you click "Authorize", and it redirects to `http://localhost:/callback` +3. On the default bridge network that port belongs to the container, not the host, so the browser cannot reach it and the CLI sits at "Paste code here" + +With `--network=host` the container shares the host's network namespace, port X in the container *is* port X on the host, and the callback lands. + +Two costs come with it, and they are why this template does not set it: + +- **VS Code extensions stop installing**: [vscode-remote-release#9212](https://github.com/microsoft/vscode-remote-release/issues/9212), covered again under Troubleshooting below. +- **Every port the container binds becomes a host port.** A container per branch is the reason these repos are launched with `dl`, and two branch containers on the host's network namespace collide on the first port they share. + +Host networking also gives the container full access to the host's network, so only use it in environments you trust. + +### Build the Container + +With DevPod: +```bash +devpod up . --recreate +``` + +With VS Code: +- Open the folder in VS Code +- Run: "Dev Containers: Rebuild Container" + +## Requirements + +### Host Machine + +`init-host.sh` runs on the host as the `initializeCommand` and creates `~/.claude` if it is missing. Nothing creates the contents below; they are optional, and the container starts without them: + +```bash +~/.claude/ +├── CLAUDE.md # Optional: global instructions +├── settings.json # Optional: Claude settings +├── agents/ # Optional: custom agents +├── commands/ # Optional: custom commands +└── hooks/ # Optional: event hooks +``` + +**Note**: The mount is the `~/.claude` directory itself, so a missing subdirectory or file costs nothing at launch. To create them anyway: + +```bash +mkdir -p ~/.claude/{agents,commands,hooks} +touch ~/.claude/CLAUDE.md +touch ~/.claude/settings.json +``` + +### Container + +- **pixi**, which the `Dockerfile` installs to `/usr/local/bin/pixi`; `install.sh` downloads it there itself if it is missing +- No manual configuration required + +## Assumptions + +1. **Container User**: This feature assumes the container user is `vscode` (standard for Dev Containers) + - Configuration files are mounted to `/home/vscode/.claude/` + - If your container uses a different user (e.g., `root`, `codespace`), you'll need to customize the mounts in your `devcontainer.json` + +2. **HOME Environment Variable**: Must be set on the host machine (standard on Unix systems) + +3. **Persistence**: Your host machine's `~/.claude/` directory should persist across container rebuilds + +4. **Platform**: Designed for Linux/macOS hosts + - Windows WSL2 should work + - Windows native may require path adjustments + +## How to Iterate Locally + +### Quick Changes + +1. Edit files in `.devcontainer/claude-code/`: + - `devcontainer-feature.json` - Change mounts, extensions, or metadata + - `install.sh` - Modify installation logic + - `README.md` - Update documentation + +2. Rebuild the container: + ```bash + devpod up . --recreate + ``` + +### Testing Install Script + +You can test the install script standalone, from inside the container: + +```bash +cd .devcontainer/claude-code +sudo ./install.sh +``` + +It resolves its target from `_REMOTE_USER` and `_REMOTE_USER_HOME` and falls back to `vscode`, so on a host with no `/home/vscode` it exits with an error rather than doing anything. + +### Debugging + +Check if Claude is installed: +```bash +claude --version +``` + +Check mounted files: +```bash +ls -la ~/.claude/ +``` + +Verify the config directory is mounted, writable, and pointed at: +```bash +env | grep CLAUDE_CONFIG_DIR # /home/vscode/.claude +mount | grep /home/vscode/.claude # one bind, rw +touch ~/.claude/.mount-check && rm ~/.claude/.mount-check && echo writable +``` + +The write test uses a throwaway file on purpose. Do not test the mount by appending to `CLAUDE.md`, `settings.json` or anything under `hooks/`: the mount is read-write, so the write lands on the host's real configuration and is loaded into every later Claude Code session. + +## Authentication + +### How It Works + +1. **Already Authenticated on Host**: If you have Claude Code set up on your host machine, credentials are automatically shared with the container +2. **First-Time Setup**: Run `claude` on the **host** and follow the OAuth flow there: + - The CLI provides an OAuth URL + - Open the URL in your browser + - Click "Authorize" + - The callback completes, because the CLI and the browser are both on the host + - Credentials are saved to `~/.claude/.credentials.json`, and the mount carries them into every container + +### OAuth Callback Behavior + +The OAuth flow opens a local callback server. In containers, this can behave differently: +- **VS Code Dev Containers**: Usually handles port forwarding automatically +- **DevPod**: May require manual code pasting if callback doesn't complete +- **SSH/Remote**: Callback URL opens in your local browser + +### Troubleshooting Authentication + +**"Paste code here" prompt hangs forever:** +- Check that `~/.claude/.credentials.json` exists on your host with proper permissions (`600`) +- Try authenticating on your host machine first, then restart `claude` in the container -- the mount is live, so no rebuild is needed +- If the callback fails, look for the authorization code in the URL after clicking "Authorize" + +**Credentials not persisting:** +- Ensure the `.credentials.json` file exists on your host before rebuilding +- Check file permissions: `chmod 600 ~/.claude/.credentials.json` + +**Setup wizard runs on every rebuild (theme selection, OAuth):** + +This happens because Claude tracks setup completion **per-workspace**, not globally. + +**Quick fix:** +```bash +# On your HOST machine: +# Set the onboarding flag for your workspace (`devpod list` shows its name) +jq '.projects["/workspaces/"].projectOnboardingSeenCount = 1' ~/.claude/.claude.json > ~/.claude/.claude.json.tmp +mv ~/.claude/.claude.json.tmp ~/.claude/.claude.json + +# Also ensure themeMode is set (if needed) +jq '. + {themeMode: "dark"}' ~/.claude/.claude.json > ~/.claude/.claude.json.tmp +mv ~/.claude/.claude.json.tmp ~/.claude/.claude.json + +# Then restart `claude` in the container -- the mount is live, so no rebuild is needed +``` + +**Root cause:** Claude tracks setup wizard completion per-workspace in `.claude.json` under `.projects["/workspaces/"].projectOnboardingSeenCount`. When this is `0`, the setup wizard runs. Set it to `1` to mark setup as complete. + +**Finding ``:** it is the devpod workspace name, and the container mounts the repo at `/workspaces/`. `devpod list` shows the name, and `dl --ls` shows it for workspaces devlaunch created. + +## Modifying Configuration + +The container writes to the same `~/.claude` as the host, so an edit made in either place is an edit to the one shared configuration. + +Editing from the **host** is still the better habit: `~/.claude/settings.json`, `~/.claude/CLAUDE.md` and the rest are yours across every branch container, and a change made on the host is one you meant to make. The mount is live, so restarting `claude` picks up a change -- no rebuild needed. + +## What Would Change Before Publishing to GHCR + +If you wanted to publish this feature to GitHub Container Registry later: + +### 1. Repository Structure + +Move from `.devcontainer/claude-code/` to a dedicated repo: + +``` +anthropics/devcontainer-features/ +└── src/ + └── claude-code/ + ├── devcontainer-feature.json + ├── install.sh + └── README.md +``` + +### 2. Metadata Updates + +In `devcontainer-feature.json`: + +```json +{ + "id": "claude-code", + "version": "1.0.0", // Semantic versioning + "documentationURL": "https://github.com/anthropics/devcontainer-features/tree/main/src/claude-code", + // ... rest of config +} +``` + +### 3. Testing Infrastructure + +Add GitHub Actions workflow (`.github/workflows/test.yaml`): + +```yaml +- name: "Create test prerequisites" + run: | + mkdir -p ~/.claude/agents + mkdir -p ~/.claude/commands + mkdir -p ~/.claude/hooks + touch ~/.claude/settings.json + touch ~/.claude/CLAUDE.md +``` + +### 4. Publishing Workflow + +Add release workflow to build and push to `ghcr.io/anthropics/devcontainer-features/claude-code:1` + +### 5. Reference Change + +Users would then reference it as: + +```json +{ + "features": { + "ghcr.io/anthropics/devcontainer-features/claude-code:1": {} + } +} +``` + +Instead of `"../claude-code": {}` + +## Optional: Future Composition + +### Splitting into Modular Features + +This feature could be split into: + +1. **`claude-code-core`**: Just CLI installation, no mounts + ```json + { + "features": { + "./claude-code-core": {} + } + } + ``` + +2. **`claude-code-mounts`**: Just configuration mounts (requires `claude-code-core`) + ```json + { + "features": { + "./claude-code-core": {}, + "./claude-code-mounts": {} + } + } + ``` + +Benefits: +- Users can install CLI without mounts (useful for Codespaces or CI) +- More flexible composition +- Easier to maintain and test separately + +### Composition with Custom Features + +You could create a personal feature that extends this: + +```json +// .devcontainer/my-claude-setup/devcontainer-feature.json +{ + "id": "my-claude-setup", + "installsAfter": ["./claude-code"], + "customizations": { + "vscode": { + "settings": { + "claude.someCustomSetting": "value" + } + } + } +} +``` + +Then use both: + +```json +{ + "features": { + "./claude-code": {}, + "./my-claude-setup": {} + } +} +``` + +## Troubleshooting + +### OAuth callback hangs at "Paste code here" + +**Problem**: Browser clicks "Authorize" but container never receives the callback. + +**Solution**: Run `claude` on the host instead and let the container read the credentials it writes to `~/.claude`. If you need the login to happen inside the container, add `--network=host` and accept its costs -- see "Why You Might Opt Into `--network=host`" above. + +### Interactive `claude` asks for authentication but `claude --print` works + +**Problem**: You're authenticated (credentials mounted) but interactive mode prompts for login. + +**Root cause**: Interactive mode tried to start an OAuth flow, which means it found no usable credentials under `CLAUDE_CONFIG_DIR`. + +**Solution**: Authenticate on the host so `~/.claude/.credentials.json` holds a live token, and check that `~/.claude` is actually mounted and `CLAUDE_CONFIG_DIR` points at it. + +### VS Code extensions don't install with `--network=host` + +**Known Issue**: [Using runArgs network=host prevents extensions from installing](https://github.com/microsoft/vscode-remote-release/issues/9212) + +**Workarounds:** +1. **Rebuild without runArgs first**, let extensions install, then add runArgs (extensions persist) +2. **Authenticate on host**, mount credentials, remove runArgs (no OAuth needed in container) +3. **Manually install extensions** after container starts + +### `~/.claude` missing on the host + +**Solution**: The `initializeCommand` (`init-host.sh`) creates it before the container starts. To lay out the rest yourself: + +```bash +mkdir -p ~/.claude/{agents,commands,hooks} +touch ~/.claude/CLAUDE.md ~/.claude/settings.json +``` + +## Security Notes + +The whole `~/.claude` directory is bind-mounted read-write as one mount, so nothing in it is held back from the container. + +### What Code in the Container Can Read and Write +- **`.credentials.json`**: the live OAuth access and refresh tokens +- **`.claude.json`**: account info, user ID, per-workspace onboarding and trust state +- **`CLAUDE.md`**, **`settings.json`**, **`agents/`**, **`commands/`**, **`hooks/`**: the host's copies, in place + +`install.sh` runs when the image is built, so the two `600` credential files it creates live in the image and the bind mount covers them at runtime. Permissions on the host's real files are whatever the host set -- see Issue 6 in TROUBLESHOOTING.md. Nothing here restricts code running inside the container, which runs as the user those files belong to. + +### The Consequence Worth Naming +`hooks/` and `settings.json` are executed by Claude Code wherever it runs. Code in the container that writes there gets its content executed on the **host**, the next time Claude Code starts there -- a `postCreateCommand` from a repository you have not read reaches that far. The container also carries the live Claude credentials and, under `dl`, a `GH_TOKEN` with repo and workflow scopes, so it is not a confidentiality boundary either. + +### Why It Is Accepted +One shared config directory is what makes auth work across the host and every branch container without a re-auth, and it is why a container never re-onboards. That is the trade; the isolation buys reproducible dependencies and non-colliding concurrent work, not protection from hostile code. `blooop/wayfinder`'s `.devcontainer/devcontainer.json` writes out the same threat model above its `mounts` block. Treat a repository you launch this way as code you are running with your own credentials, because that is what it is. + +Whether the non-credential paths should become read-only binds is an open question, not a settled one. + +See related security discussions: +- [anthropics/claude-code#4478](https://github.com/anthropics/claude-code/issues/4478) +- [anthropics/claude-code#2350](https://github.com/anthropics/claude-code/issues/2350) +- Per-file read-only approach this feature does not implement: [PR #25](https://github.com/anthropics/devcontainer-features/pull/25) + +## Reference + +- **Dev Container Features Spec**: https://containers.dev/implementers/features/ +- **Local Features**: https://containers.dev/implementers/features/#local-features +- **Based on PR**: https://github.com/anthropics/devcontainer-features/pull/25 +- **Upstream Features**: https://github.com/anthropics/devcontainer-features + +## License + +Based on the Anthropic devcontainer-features repository (MIT License). diff --git a/.devcontainer/claude-code/TROUBLESHOOTING.md b/.devcontainer/claude-code/TROUBLESHOOTING.md new file mode 100644 index 0000000..59e2156 --- /dev/null +++ b/.devcontainer/claude-code/TROUBLESHOOTING.md @@ -0,0 +1,381 @@ +# Claude Code Dev Container Feature - Troubleshooting Guide + +## Quick Reference + +### Files on the Host + +`init-host.sh` creates `~/.claude` as the `initializeCommand`. Everything inside it is optional, and only `.credentials.json` is load-bearing for an authenticated `claude`. + +```bash +~/.claude/ # one bind mount, read-write, shared with every container +├── .credentials.json # OAuth tokens +├── .claude.json # Account info, setup state +├── CLAUDE.md # Global instructions +├── settings.json # Settings +├── agents/ # Custom agents +├── commands/ # Custom commands +└── hooks/ # Event hooks +``` + +Every one of these is writable from inside the container, and a write lands on the host. See "Security Considerations" below for what follows from that. + +### Critical Configuration in devcontainer.json + +```json +{ + "image": "ghcr.io/blooop/python_template/devcontainer:latest", + "containerEnv": { + "CLAUDE_CONFIG_DIR": "/home/vscode/.claude", + "XDG_CONFIG_HOME": "/home/vscode/.config", + "XDG_CACHE_HOME": "/home/vscode/.cache", + "XDG_DATA_HOME": "/home/vscode/.local/share" + }, + "mounts": [ + "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind" + ] +} +``` + +The `../claude-code` feature is declared in `.devcontainer/ci/devcontainer.json`, the config CI builds the image from, so there is no `features` block here -- and no `runArgs` either. + +## Common Issues and Solutions + +### Issue 1: Setup Wizard Runs on Every Container Rebuild + +**Symptoms:** +- Interactive `claude` shows theme selection screen +- After selecting theme, asks for OAuth authentication +- Happens every time you rebuild the container + +**Root Cause:** +Claude tracks setup completion per-workspace in `.claude.json`: +```json +{ + "projects": { + "/workspaces/": { + "projectOnboardingSeenCount": 0 // ← This! + } + } +} +``` + +`` is the devpod workspace name -- `devpod list` shows it, and `dl --ls` shows it for workspaces devlaunch created. + +**Solution:** +```bash +# On HOST machine, set a high count to skip wizard +jq '.projects["/workspaces/"].projectOnboardingSeenCount = 999' \ + ~/.claude/.claude.json > ~/.claude/.claude.json.tmp +mv ~/.claude/.claude.json.tmp ~/.claude/.claude.json + +# Also ensure themeMode is set (global setting) +jq '. + {themeMode: "dark"}' ~/.claude/.claude.json > ~/.claude/.claude.json.tmp +mv ~/.claude/.claude.json.tmp ~/.claude/.claude.json + +# Then restart `claude` in the container -- the mount is live, so no rebuild is needed +``` + +**Why 999?** The field is `projectOnboardingSeenCount` - it increments each time you see the wizard. Setting it high tells Claude "this workspace has been onboarded many times, skip the wizard." + +**Verification:** +```bash +# From the host, shell into the container +devpod ssh +claude # Should go straight to interactive mode without wizard +``` + +### Issue 2: OAuth Callback Hangs at "Paste code here" + +**Symptoms:** +- Browser opens, you click "Authorize" +- CLI shows "Paste code here >" and waits forever +- Browser callback URL fails to connect + +**Root Cause:** +OAuth callback server runs inside container on a random port (e.g., `localhost:35673`). Your browser tries to connect to that port on the HOST, but the container's port isn't accessible. + +**Solution:** +Authenticate on the host, where the browser can reach the callback port, and let the container read the resulting credentials through the `~/.claude` bind mount. No OAuth flow then runs in the container at all. + +**Alternative, if you want the login to happen inside the container:** +Add `--network=host` to devcontainer.json: + +```json +{ + "runArgs": ["--network=host"] +} +``` + +This makes the container share the host's network namespace, so ports inside the container are accessible from the host browser. + +**What that costs:** +VS Code extensions stop installing (known issue: [#9212](https://github.com/microsoft/vscode-remote-release/issues/9212)), the container gets full access to the host's network, and every port the container binds becomes a host port -- so two branch containers of the same repo collide on the first port they share. + +### Issue 3: `claude --print` Works But Interactive `claude` Asks for Login + +**Symptoms:** +- `echo "test" | claude --print` works without authentication +- Running just `claude` shows setup wizard or login prompt + +**Root Cause:** +Two different issues: +1. **Setup wizard** (theme/onboarding) - see Issue 1 +2. **Print mode skips workspace trust dialogs** - expected behavior + +**Solution:** +- For setup wizard: See Issue 1 +- For workspace trust: Use `--dangerously-skip-permissions` in trusted containers + +### Issue 4: Authentication Doesn't Persist After Container Rebuild + +**Symptoms:** +- You authenticate in the container +- Rebuild the container +- Have to authenticate again + +**Root Cause:** +`~/.claude` is not mounted, so `claude` wrote its credentials into the container's own filesystem and they went away with the container. + +**Solution:** + +1. **Verify the mount in the container:** + ```bash + # From the host, shell into the container (`devpod list` shows ``, + # `dl --ls` for workspaces devlaunch created) + devpod ssh + mount | grep claude + ``` + + Should show one bind of the directory, read-write: + ``` + /dev/... on /home/vscode/.claude type ext4 (rw,...) + ``` + +2. **Check files exist on host:** + ```bash + ls -la ~/.claude/.credentials.json ~/.claude/.claude.json + ``` + +3. **Check the mount is read-write:** + A refresh has to persist, so `rw` in the line above is load-bearing. The feature declares no `ro` flag, so a read-only mount means something outside it added one. + +### Issue 5: A Container Changed the Host's Claude Configuration + +**Symptoms:** +- `~/.claude/CLAUDE.md`, `settings.json` or a file under `hooks/` differs from what you left on the host +- A hook or setting you did not write takes effect when you start `claude` on the host + +**Root Cause:** +Not a malfunction. `~/.claude` is one read-write bind of the whole directory, so the host and every container share it and anything in a container can write any of it. `hooks/` and `settings.json` are executed by Claude Code wherever it runs, so what a container leaves there runs on the host next time. + +**Solution:** +Restore the files from wherever your configuration lives -- keeping `~/.claude` under version control is what makes a change like this visible and reversible. Then look at what put it there: a `postCreateCommand`, a hook, or an agent session in the container all reach that far. + +### Issue 6: File Permission Errors (600 vs 664) + +**Symptoms:** +- Cannot read credentials file +- Permission denied errors + +**Solution:** +```bash +# On HOST +chmod 600 ~/.claude/.credentials.json +chmod 600 ~/.claude/.claude.json +``` + +These files contain sensitive data and should only be readable by you. + +## Debugging Commands + +### Check Authentication Status + +```bash +# In container +cat ~/.claude/.credentials.json | jq '.claudeAiOauth.accessToken' | head -c 30 +# Should show: sk-ant-oat01-... + +cat ~/.claude/.claude.json | jq '.oauthAccount.emailAddress' +# Should show your email +``` + +### Verify Mounts + +```bash +# In container +mount | grep claude +# Should show one bind of /home/vscode/.claude, rw + +ls -la ~/.claude/ +# Should show files from your host +``` + +### Check Environment Variables + +```bash +# In container +env | grep -E "(CLAUDE|XDG)" | sort +``` + +Should show: +``` +CLAUDE_CONFIG_DIR=/home/vscode/.claude +XDG_CACHE_HOME=/home/vscode/.cache +XDG_CONFIG_HOME=/home/vscode/.config +XDG_DATA_HOME=/home/vscode/.local/share +``` + +### Test Claude Without Authentication + +```bash +# This should work if you're authenticated +echo "what is 2+2" | claude --print +``` + +### Check Setup State + +```bash +# On HOST +cat ~/.claude/.claude.json | jq '.projects["/workspaces/"]' +``` + +Look for: +- `projectOnboardingSeenCount`: Should be > 0 (e.g., 999) +- Check your actual workspace path matches + +### Verify Network Mode + +```bash +# On HOST +docker inspect | jq '.[0].HostConfig.NetworkMode' +# "host" only if you opted into --network=host; otherwise the default bridge network +``` + +## Complete Setup Checklist + +When setting up a new workspace: + +- [ ] `../claude-code` feature declared in `.devcontainer/ci/devcontainer.json`, so the published image carries it +- [ ] `claude` authenticated on the host, so no OAuth flow runs in the container +- [ ] Environment variables added (CLAUDE_CONFIG_DIR, XDG_*) +- [ ] Files exist on host: `.credentials.json`, `.claude.json` +- [ ] File permissions: `chmod 600` on sensitive files +- [ ] `projectOnboardingSeenCount` set to 999 in `.claude.json` +- [ ] `themeMode` set (e.g., "dark") in `.claude.json` +- [ ] Container rebuilt: `devpod up . --recreate` +- [ ] Test: `claude --print "test"` works +- [ ] Test: `claude` goes to interactive mode without wizard + +## File Explanation + +### `.credentials.json` +Contains OAuth access and refresh tokens. Format: +```json +{ + "claudeAiOauth": { + "accessToken": "sk-ant-oat01-...", + "refreshToken": "sk-ant-ort01-...", + "expiresAt": 1234567890000 + } +} +``` + +**Why writable:** Tokens need to be refreshed periodically. + +### `.claude.json` +Contains account info, feature flags, and per-workspace state. Key fields: +```json +{ + "oauthAccount": { ... }, + "userID": "...", + "themeMode": "dark", + "projects": { + "/workspaces/": { + "projectOnboardingSeenCount": 999, + "hasTrustDialogAccepted": false, + ... + } + } +} +``` + +**Why writable:** Claude updates `projectOnboardingSeenCount` and other workspace state. + +## Advanced Debugging + +### Capture Complete Claude Startup + +```bash +# In container +script -qec "timeout 3 claude 2>&1" /tmp/claude-startup.log +cat /tmp/claude-startup.log +``` + +### Compare Config Before/After + +```bash +# Before operation +cp ~/.claude/.claude.json ~/.claude/.claude.json.before + +# Do operation (e.g., run claude) + +# After +diff <(jq -S . ~/.claude/.claude.json.before) <(jq -S . ~/.claude/.claude.json) +``` + +### Check What Changed on Host + +```bash +# On HOST, monitor file changes +watch -n 1 'stat ~/.claude/.claude.json | grep Modify' +``` + +## Security Considerations + +### What the Mount Actually Is +One read-write bind of the whole `~/.claude` directory. No `ro` flag, no per-file mounts. `.credentials.json`, `.claude.json`, `CLAUDE.md`, `settings.json`, `agents/`, `commands/` and `hooks/` are all writable from inside the container, and a write lands on the host's copy. + +### The Consequence +`hooks/` and `settings.json` are executed by Claude Code wherever it runs, so content a container writes there runs on the **host** the next time Claude Code starts there -- a `postCreateCommand` from a repository nobody read is enough. The container also holds the live Claude credentials from the mount and, under `dl`, a `GH_TOKEN` carrying repo and workflow scopes. It is not a confidentiality or integrity boundary. + +### Why It Is Accepted +Sharing one config directory is what makes credentials work across the host and every branch container: the access token is short-lived, so a read-only or copied arrangement drifts into a re-auth, and a container that cannot write `.claude.json` re-onboards on every launch. The isolation buys reproducible dependencies and non-colliding concurrent work, not safety against hostile code. `blooop/wayfinder`'s `.devcontainer/devcontainer.json` writes out the same threat model above its `mounts` block. + +Keeping `~/.claude` under version control is the one practical measure here: it makes a change from a container visible instead of silent. + +## Known Limitations + +1. **VS Code extensions may not install with --network=host** + - Issue: https://github.com/microsoft/vscode-remote-release/issues/9212 + - Workaround: Build without runArgs first, then add it + +2. **Per-workspace setup tracking** + - Each workspace path needs its own `projectOnboardingSeenCount` + - Renaming workspace requires updating the flag + +3. **No credential isolation** + - All containers share same host credentials + - Can't use different Claude accounts per container + +4. **OAuth callback browser routing** + - Requires `--network=host` or manual code pasting + - May not work in some network environments + +## Getting Help + +If issues persist: + +1. Check `/tmp/claude/debug.log` in container +2. Run `claude --debug` for verbose output +3. Review this guide with an AI agent: + - Share: `.devcontainer/claude-code/TROUBLESHOOTING.md` + - Include: Output of debugging commands above + - Describe: Exact symptoms and when they occur + +## References + +- Dev Container Features: https://containers.dev/implementers/features/ +- Claude Code Docs: https://code.claude.com/docs/ +- deps_rocker reference: https://github.com/blooop/deps_rocker +- OAuth callback issue: https://github.com/anthropics/claude-code/issues/1529 +- Network=host issue: https://github.com/microsoft/vscode-remote-release/issues/9212 diff --git a/.devcontainer/claude-code/devcontainer-feature.json b/.devcontainer/claude-code/devcontainer-feature.json new file mode 100644 index 0000000..06b9ff5 --- /dev/null +++ b/.devcontainer/claude-code/devcontainer-feature.json @@ -0,0 +1,22 @@ +{ + "name": "Claude Code CLI", + "id": "claude-code", + "version": "0.2.0", + "description": "Installs Claude Code CLI via pixi with persistent configuration", + "options": {}, + "documentationURL": "https://github.com/anthropics/devcontainer-features", + "licenseURL": "https://github.com/anthropics/devcontainer-features/blob/main/LICENSE", + "customizations": { + "vscode": { + "extensions": [ + "anthropic.claude-code" + ] + } + }, + "containerEnv": { + "CLAUDE_CONFIG_DIR": "/home/vscode/.claude" + }, + "mounts": [ + "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind" + ] +} diff --git a/.devcontainer/claude-code/init-host.sh b/.devcontainer/claude-code/init-host.sh new file mode 100755 index 0000000..7e123bf --- /dev/null +++ b/.devcontainer/claude-code/init-host.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Initialize Claude Code host directory for devcontainer bind mount +# This script runs on the HOST before the container is created. +# mkdir -p is idempotent - it only creates if missing, won't clobber existing. + +mkdir -p "$HOME/.claude" diff --git a/.devcontainer/claude-code/install.sh b/.devcontainer/claude-code/install.sh new file mode 100755 index 0000000..a52d2b4 --- /dev/null +++ b/.devcontainer/claude-code/install.sh @@ -0,0 +1,184 @@ +#!/bin/bash +set -euo pipefail + +# Claude Code CLI Local Feature Install Script +# Installs Claude Code via pixi and sets up configuration directories + +# Global variables set by resolve_target_home +TARGET_USER="" +TARGET_HOME="" + +# Function to resolve target user and home directory with validation +# Sets TARGET_USER and TARGET_HOME global variables +resolve_target_home() { + TARGET_USER="${_REMOTE_USER:-vscode}" + TARGET_HOME="${_REMOTE_USER_HOME:-}" + + # If _REMOTE_USER_HOME is not set, try to infer from current user or /home/ + if [ -z "${TARGET_HOME}" ]; then + if [ "$(id -un 2>/dev/null)" = "${TARGET_USER}" ] && [ -n "${HOME:-}" ]; then + TARGET_HOME="${HOME}" + elif [ -d "/home/${TARGET_USER}" ]; then + TARGET_HOME="/home/${TARGET_USER}" + fi + fi + + # If TARGET_HOME is set but doesn't exist, try fallbacks + if [ -n "${TARGET_HOME}" ] && [ ! -d "${TARGET_HOME}" ]; then + if [ -n "${HOME:-}" ] && [ -d "$HOME" ]; then + echo "Warning: TARGET_HOME '${TARGET_HOME}' does not exist, falling back to \$HOME: $HOME" >&2 + TARGET_HOME="$HOME" + elif [ -d "/home/${TARGET_USER}" ]; then + echo "Warning: TARGET_HOME '${TARGET_HOME}' does not exist, falling back to /home/${TARGET_USER}" >&2 + TARGET_HOME="/home/${TARGET_USER}" + fi + fi + + # Ensure we ended up with a valid, existing home directory + if [ -z "${TARGET_HOME}" ] || [ ! -d "${TARGET_HOME}" ]; then + echo "Error: could not determine a valid home directory for user '${TARGET_USER}'." >&2 + echo "Checked _REMOTE_USER_HOME ('${_REMOTE_USER_HOME:-}'), \$HOME ('${HOME:-}'), and /home/${TARGET_USER}." >&2 + exit 1 + fi +} + +# Function to install pixi if not found +install_pixi() { + echo "Installing pixi..." + + # Detect architecture + case "$(uname -m)" in + x86_64|amd64) ARCH="x86_64" ;; + aarch64|arm64) ARCH="aarch64" ;; + *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; + esac + + # Download and install pixi + curl -fsSL "https://github.com/prefix-dev/pixi/releases/latest/download/pixi-${ARCH}-unknown-linux-musl" -o /usr/local/bin/pixi + chmod +x /usr/local/bin/pixi + + echo "pixi installed successfully" + pixi --version +} + +# Function to install Claude Code CLI via pixi +install_claude_code() { + echo "Installing Claude Code CLI via pixi..." + + # Install pixi if not available + if ! command -v pixi >/dev/null; then + install_pixi + fi + + # Resolve target user and home (sets TARGET_USER and TARGET_HOME) + resolve_target_home + + # Install with pixi global from blooop channel + # Run as target user so it installs to their home directory + if [ "$(id -u)" -eq 0 ] && [ "$TARGET_USER" != "root" ]; then + su - "$TARGET_USER" -c "pixi global install --channel https://prefix.dev/blooop claude-shim" + else + pixi global install --channel https://prefix.dev/blooop claude-shim + fi + + # Add pixi bin path to user's profile if not already there + local profile="$TARGET_HOME/.profile" + # shellcheck disable=SC2016 + local pixi_path_line='export PATH="$HOME/.pixi/bin:$PATH"' + if [ -f "$profile" ] && ! grep -q '\.pixi/bin' "$profile"; then + echo "$pixi_path_line" >> "$profile" + elif [ ! -f "$profile" ]; then + echo "$pixi_path_line" > "$profile" + chown "$TARGET_USER:$TARGET_USER" "$profile" 2>/dev/null || true + fi + + # Workaround: pixi trampoline fails for bash scripts, so add env bin directly + # This conditionally adds the path only if the env exists + # shellcheck disable=SC2016 + local env_path_line='[ -d "$HOME/.pixi/envs/claude-shim/bin" ] && export PATH="$HOME/.pixi/envs/claude-shim/bin:$PATH"' + if [ -f "$profile" ] && ! grep -q 'pixi/envs/claude-shim' "$profile"; then + echo "# Workaround: pixi trampoline fails for bash scripts" >> "$profile" + echo "$env_path_line" >> "$profile" + fi + + # Verify installation by checking the trampoline exists (don't run it - that triggers download) + local pixi_bin_path="$TARGET_HOME/.pixi/bin" + local claude_bin="$pixi_bin_path/claude" + if [ -x "$claude_bin" ]; then + echo "Claude Code CLI installed successfully!" + echo "(Claude binary will be downloaded on first run)" + return 0 + else + echo "ERROR: Claude Code CLI installation failed! Binary not found at $claude_bin" + return 1 + fi +} + +# Function to create Claude configuration directories +create_claude_directories() { + echo "Creating Claude configuration directories..." + + # Resolve target user and home (sets TARGET_USER and TARGET_HOME) + resolve_target_home + + echo "Target home directory: $TARGET_HOME" + echo "Target user: $TARGET_USER" + + # Create the main .claude directory and subdirectories + mkdir -p "$TARGET_HOME/.claude" + mkdir -p "$TARGET_HOME/.claude/agents" + mkdir -p "$TARGET_HOME/.claude/commands" + mkdir -p "$TARGET_HOME/.claude/hooks" + + # Create empty config files if they don't exist + if [ ! -f "$TARGET_HOME/.claude/.credentials.json" ]; then + echo "{}" > "$TARGET_HOME/.claude/.credentials.json" + chmod 600 "$TARGET_HOME/.claude/.credentials.json" + fi + + if [ ! -f "$TARGET_HOME/.claude/.claude.json" ]; then + echo "{}" > "$TARGET_HOME/.claude/.claude.json" + chmod 600 "$TARGET_HOME/.claude/.claude.json" + fi + + # Set proper ownership + if [ "$(id -u)" -eq 0 ]; then + chown -R "$TARGET_USER:$TARGET_USER" "$TARGET_HOME/.claude" || true + fi + + echo "Claude directories created successfully" +} + +# Main script +main() { + echo "=========================================" + echo "Activating feature 'claude-code' (local)" + echo "=========================================" + + # Resolve target user and home (sets TARGET_USER and TARGET_HOME) + resolve_target_home + + local claude_bin="$TARGET_HOME/.pixi/bin/claude" + + # Install Claude Code CLI + if [ -x "$claude_bin" ]; then + echo "Claude Code CLI is already installed" + else + install_claude_code || exit 1 + fi + + # Create Claude configuration directories + create_claude_directories + + echo "=========================================" + echo "Claude Code feature activated successfully!" + echo "=========================================" + echo "" + echo "Configuration is bind-mounted from the host (~/.claude)" + echo "and persists across container rebuilds." + echo "" + echo "To authenticate, run 'claude' and follow the OAuth flow." + echo "" +} + +main diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2dd3d63..956e8a5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,48 +1,117 @@ -// // For format details, see https://aka.ms/devcontainer.json. For config options, see the -// // README at: https://github.com/devcontainers/templates/tree/main/src/python -// { -// "name": "Python 3", -// // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile -// "image": "mcr.microsoft.com/devcontainers/python:0-3.10", -// // Features to add to the dev container. More info: https://containers.dev/features. -// // "features": {}, -// // Use 'forwardPorts' to make a list of ports inside the container available locally. -// // "forwardPorts": [], -// // Use 'postCreateCommand' to run commands after the container is created. -// "postCreateCommand": "pip3 install --user -r requirements.txt && pip install -e .", -// "customizations": { -// "vscode": { -// } -// } -// // Configure tool-specific properties. -// // "customizations": {}, -// // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. -// // "remoteUser": "root" -// } { - "name": "Python Environment", - "build": { - "dockerfile": "Dockerfile", - "context": ".." - }, - "postCreateCommand": "flit install --symlink", - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "ms-python.pylint", - "njpwerner.autodocstring", - "charliermarsh.ruff", - "mhutchie.git-graph", - "eamodio.gitlens", - "tamasfe.even-better-toml", - "Codium.codium", - "ms-azuretools.vscode-docker", - "ryanluker.vscode-coverage-gutters", - "tomoki1207.pdf" - ] - } - }, - // "onCreateCommand": "pre-commit install-hooks" -} \ No newline at end of file + // Uses the prebuilt image of blooop/python_template for fast startup. + // This repo has no Dockerfile and builds no image of its own. + "image": "ghcr.io/blooop/python_template/devcontainer:latest", + + // There is deliberately no "features" block. The claude-code feature is + // already baked into the image above: python_template's + // .devcontainer/ci/devcontainer.json, the config its CI builds that image + // from, declares "../claude-code". Declaring it again here made the devcontainer spec + // build a derived image on the first launch of every branch, reinstalling + // something the pulled image already carried -- so the "prebuilt image for + // fast startup" above still paid for a build. With this block gone the + // launch is a pull and nothing else. + // + // Adding a feature back here is allowed and costs that derived build again. + // If that ever becomes the normal case, the fix is devlaunch's design -- + // a "build:" block plus customizations.devpod.prebuildRepository, which + // caches the fully assembled image, features included. That needs CI to + // publish with `devpod build` rather than the devcontainers/ci action; + // devpod's prebuild hash is computed from the Dockerfile and build context, + // so it does not apply to an "image:" config like this one at all. + + "initializeCommand": ".devcontainer/claude-code/init-host.sh", + + // There is deliberately no "runArgs": ["--network=host"]. + // + // A container per branch is the reason these repos are launched with `dl`, + // and host networking takes it away: the container joins the host's network + // namespace, so every port a test or dev server binds is a host port and + // two branches of this repo collide on the first one they share. The + // default bridge network keeps them apart at no cost -- nothing in this + // template reaches for the host's network. + // + // Two sibling repos keep the flag on purpose and should not be "fixed" to + // match this file: homeassistant-config (mDNS/discovery needs the host LAN) + // and colcon-runner (ROS 2 DDS multicast discovery). + + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "jjjermiah.pixi-vscode", + "charliermarsh.ruff", + "tamasfe.even-better-toml", + "mhutchie.git-graph", + "anthropic.claude-code" + ] + } + }, + + "containerEnv": { + "CLAUDE_CONFIG_DIR": "/home/vscode/.claude", + "XDG_CONFIG_HOME": "/home/vscode/.config", + "XDG_CACHE_HOME": "/home/vscode/.cache", + "XDG_DATA_HOME": "/home/vscode/.local/share" + }, + + // Three mounts. The pixi volume keeps the environment out of the bind- + // mounted workspace; the other two share host credentials. + // + // ~/.config/gh is here because it works. `gh` uses a system keyring when + // one is available and falls back to hosts.yml when it is not, and on this + // host it falls back: hosts.yml carries a real oauth_token, and inside a + // container built from this config -- with GH_TOKEN and GITHUB_TOKEN unset + // -- `gh auth status` reports "Logged in to github.com account blooop + // (/home/vscode/.config/gh/hosts.yml)". This mount is the only thing that + // gives `gh` a login in a container opened WITHOUT `dl`: a plain + // `devpod up`, or VS Code's Reopen in Container. Under `dl` it is + // redundant but harmless -- `dl` forwards GH_TOKEN from the host (from + // GH_TOKEN, GITHUB_TOKEN or `gh auth token`, whichever answers first), and + // devpod applies workspace env after the devcontainer's own, so where both + // are present the forwarded token is the one `gh` uses. + // + // ~/.ssh is deliberately not mounted, for reasons that have nothing to do + // with the above. devpod forwards an ssh agent of its own, at a socket path + // it chooses -- verified in a live container: `ssh-add -l` lists the host's + // key, so the private key does not need to be in here at all. What the + // agent cannot supply is known_hosts: on a genuinely fresh container the + // first ssh to github.com dies with `Host key verification failed`, which + // an interactive user can click through and a script cannot. That is what + // the ssh-keyscan in postCreateCommand below is for -- auth comes from the + // forwarded agent, host identity from keyscan, and neither needs the + // host's ~/.ssh in the container. + // Mounting the directory also wrote `Host .devpod` blocks onto the + // developer's real ssh config, naming a ProxyCommand binary that exists + // only inside the container, and those outlived the container. SSH_AUTH_SOCK + // is gone from containerEnv for the same reason: hardcoding + // /home/vscode/.ssh/agent.sock overrode the socket devpod actually + // forwards with a path nothing fills. + "mounts": [ + "source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume", + "source=${localEnv:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind", + "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind" + ], + + "postCreateCommand": ".devcontainer/post-create.sh", + + // Last in the file on purpose, and it is the one line here that is load + // bearing for every repo cut from this template. + // + // "name" is the only per-repo value in this file, so it is the only line a + // child repo edits -- and while it sat on the line above the image/build + // block, which is the block this template changes most, every + // `pixi run update-from-template-repo` conflicted on this file. git cannot + // split adjacent hunks, so the child's one-line name edit collided with the + // template's block edit every time. Measured against blooop/dbw: reverting + // only the name made the same merge clean. + // + // At the end of the file the two edits are separate hunks and merge without + // conflict -- the child keeps its name, and template changes to the image, + // the mounts and postCreateCommand all land on their own. Moving it costs + // one restructuring conflict per child, once; leaving it here costs a + // conflict on this file forever. + "name": "Python Environment" +} diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 0000000..8adfeee --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# postCreateCommand for this repo and every repo cut from this template. +# +# It lives in a script rather than inline in devcontainer.json for two reasons: +# the steps below have to differ per repo (not every descendant defines every +# pixi task), and a one-line string in the JSON is a permanent merge-conflict +# surface for children pulling template updates. +set -euo pipefail + +# 1. The .pixi volume is created by docker, owned by root. +sudo chown vscode .pixi + +# 2. Seed known_hosts for the forge this clone actually uses. +# +# devpod forwards an ssh agent, so auth works without the host's ~/.ssh being +# mounted -- but host identity does not come with it. Without a known_hosts +# entry the first git operation over an ssh remote fails with "Host key +# verification failed": an interactive user gets a yes/no prompt, anything +# non-interactive (a script, an agent, CI in the container) just dies. +host=$(git config --get remote.origin.url 2>/dev/null | + sed -nE 's#^(ssh://)?git@([^:/]+).*#\2#p') || true +if [ -n "${host:-}" ]; then + mkdir -p ~/.ssh && chmod 700 ~/.ssh + touch ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts + if ! ssh-keygen -F "$host" >/dev/null 2>&1; then + if scanned=$(ssh-keyscan -T 10 -t rsa,ecdsa,ed25519 "$host" 2>/dev/null) && + [ -n "$scanned" ]; then + printf '%s\n' "$scanned" >> ~/.ssh/known_hosts + sort -u -o ~/.ssh/known_hosts ~/.ssh/known_hosts + echo "post-create: seeded known_hosts for $host" + else + # Non-fatal: no network at postCreate must not fail container creation. + echo "post-create: could not reach $host, skipping known_hosts" >&2 + fi + fi +fi + +# 3. The environment itself, installed from the committed lock as it stands. +# +# --frozen, because a plain `pixi install` lets the image's pixi rewrite +# pixi.lock -- pixi 0.83 turns a version-6 lock into version 7 -- and a clone +# that is dirty before anyone has touched it makes `dl rm` refuse it as +# unsaved work. --locked is not the answer either: it fails container creation +# whenever the lock's format is older than this pixi writes. To change +# dependencies, run `pixi install` (or `pixi add`) yourself and commit the lock. +pixi install --frozen + +# 4. Optional tasks. A descendant that does not define one simply skips it -- +# hardcoding `pixi run prek-install` here fails container creation outright with +# exit 127 on every repo that lacks the task, which is most of them. This list is +# the one place a child repo adds its own; it stays an array so adding a second +# entry is a one-word edit. +optional_tasks=(prek-install) + +# `pixi task list` prints to stderr, not stdout -- redirecting it to /dev/null +# silently yields an empty list and skips tasks the repo really does define. The +# summary is ` (by design): a, b, c` per line, so split on both separators +# to get one task per line (tr pads the shorter set2 out to match set1). +tasks=$(pixi task list --summary 2>&1 | tr ' ,' '\n' || true) +for task in "${optional_tasks[@]}"; do + if grep -qx "$task" <<<"$tasks"; then + echo "post-create: running '$task'" + pixi run --frozen "$task" + else + echo "post-create: no '$task' task in this repo, skipping" + fi +done diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8725af6..89c64f7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,10 +13,8 @@ updates: dev-dependencies: #try to group all development dependencies updates into a single pr patterns: - - "black" - "check-manifest" - "pre-commit" - - "pylint" - "pytest*" - "hypothesis" - "ruff" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0d794d..e7668f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,17 +14,14 @@ permissions: jobs: - black: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: psf/black@stable ruff: runs-on: ubuntu-latest - needs: [black] steps: - uses: actions/checkout@v3 - uses: chartboost/ruff-action@v1 + - uses: chartboost/ruff-action@v1 + with: + args: format --check build: runs-on: ubuntu-latest needs: [ruff] @@ -39,8 +36,6 @@ jobs: python -m pip install --upgrade pip pip install flit flit install --extras test - - run: | - pylint $(git ls-files '*.py') - name: Test with pytest run: | coverage run -m pytest diff --git a/.gitignore b/.gitignore index ff6d5fa..c186e64 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,6 @@ cython_debug/ #.idea/ .vscode/active_file.cfg + +# pixi environments +.pixi/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 87f818d..a0a4680 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,7 @@ "python.testing.pytestEnabled": true, "editor.formatOnSave": true, "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter" + "editor.defaultFormatter": "charliermarsh.ruff" }, "files.exclude": { "**/__pycache__/**": true diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a5e4267..d42c069 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,25 +3,19 @@ "tasks": [ { "label": "autoformat", - "detail": "Use ruff and black to automatically fix and format the code", + "detail": "Use ruff to automatically fix and format the code", "type": "shell", - "command": "ruff . --fix && black ." + "command": "ruff check . --fix && ruff format ." }, { "label": "autoformat and commit", - "detail": "Use ruff and black to automatically fix and format the code and commit changes", + "detail": "Use ruff to automatically fix and format the code and commit changes", "type": "shell", "dependsOn": [ "autoformat" ], "command": "git commit -a -m 'autoformatted and ruff --fix all code' || true" }, - { - "label": "pylint", - "detail": "Run pylint on files tracked by git", - "type": "shell", - "command": "pylint $(git ls-files '*.py') " - }, { "label": "code coverage", "detail": "Run code coverage and print a coverage report, also update coverage.xml for in the in-editor coverage gutter", @@ -49,7 +43,6 @@ "type": "shell", "dependsOn": [ "autoformat", - "pylint", "code coverage report" ], "dependsOrder": "sequence", diff --git a/arjan_codes_sw_design_mindset/appy_composition_to_car_example/blooop/exercise.py b/arjan_codes_sw_design_mindset/appy_composition_to_car_example/blooop/exercise.py index 2f9496a..8a5028c 100644 --- a/arjan_codes_sw_design_mindset/appy_composition_to_car_example/blooop/exercise.py +++ b/arjan_codes_sw_design_mindset/appy_composition_to_car_example/blooop/exercise.py @@ -16,8 +16,7 @@ class TruckCabStyle(Enum): class Price(Protocol): - def compute_price(self): - ... + def compute_price(self): ... @dataclass diff --git a/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_1.py b/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_1.py index a0e36fa..4f8da89 100644 --- a/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_1.py +++ b/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_1.py @@ -1,5 +1,4 @@ -from typing import Callable - +from collections.abc import Callable Retrieve = Callable[[], str] Connect = Callable[[], None] diff --git a/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_2.py b/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_2.py index c542291..0f32bb4 100644 --- a/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_2.py +++ b/arjan_codes_sw_design_mindset/depend_on_abstractions/giggus/exercise_2.py @@ -10,17 +10,13 @@ class Server(Protocol): default_email: str - def connect(self, host: str, port: int) -> None: - ... + def connect(self, host: str, port: int) -> None: ... - def login(self, user_name: str, password: str) -> None: - ... + def login(self, user_name: str, password: str) -> None: ... - def send_mail(self, message: str, to_address: str, from_address: str) -> None: - ... + def send_mail(self, message: str, to_address: str, from_address: str) -> None: ... - def quit(self) -> None: - ... + def quit(self) -> None: ... def send_email( diff --git a/arjan_codes_sw_design_mindset/high_cohesion/blooop/exercise/exercise.py b/arjan_codes_sw_design_mindset/high_cohesion/blooop/exercise/exercise.py index c9b7809..8076be9 100644 --- a/arjan_codes_sw_design_mindset/high_cohesion/blooop/exercise/exercise.py +++ b/arjan_codes_sw_design_mindset/high_cohesion/blooop/exercise/exercise.py @@ -1,5 +1,5 @@ import csv -from typing import Any, List +from typing import Any ### # Why is this code not very cohesive? How can you refactor it to increase cohesion? @@ -8,14 +8,14 @@ Record = dict[str, Any] -def read_data(path: str) -> List[Record]: +def read_data(path: str) -> list[Record]: with open(path) as f: reader = csv.DictReader(f) data: list[Record] = list(reader) return data -def process_data(data: List[Record]): +def process_data(data: list[Record]): processed_data: list[Record] = [] for row in data: row_copy = row.copy() @@ -27,7 +27,7 @@ def process_data(data: List[Record]): return processed_data -def write_data(processed_data: List[Record], path: str = "processed.csv") -> None: +def write_data(processed_data: list[Record], path: str = "processed.csv") -> None: with open(path, "w") as f: writer = csv.DictWriter(f, fieldnames=["name", "status", "is_active"]) writer.writeheader() diff --git a/arjan_codes_sw_design_mindset/high_cohesion/giggus/exercise.py b/arjan_codes_sw_design_mindset/high_cohesion/giggus/exercise.py index caca7f6..cd34755 100644 --- a/arjan_codes_sw_design_mindset/high_cohesion/giggus/exercise.py +++ b/arjan_codes_sw_design_mindset/high_cohesion/giggus/exercise.py @@ -1,7 +1,6 @@ import csv from typing import Any - Record = dict[str, Any] diff --git a/arjan_codes_sw_design_mindset/inheritance_abc_protocol/blooop/exercise_1_v1.py b/arjan_codes_sw_design_mindset/inheritance_abc_protocol/blooop/exercise_1_v1.py index 349f8aa..ecb8dea 100644 --- a/arjan_codes_sw_design_mindset/inheritance_abc_protocol/blooop/exercise_1_v1.py +++ b/arjan_codes_sw_design_mindset/inheritance_abc_protocol/blooop/exercise_1_v1.py @@ -1,5 +1,5 @@ -from time import time from dataclasses import dataclass, field +from time import time @dataclass diff --git a/arjan_codes_sw_design_mindset/low_coupling/blooop/exercise.py b/arjan_codes_sw_design_mindset/low_coupling/blooop/exercise.py index 95d790b..27c5969 100644 --- a/arjan_codes_sw_design_mindset/low_coupling/blooop/exercise.py +++ b/arjan_codes_sw_design_mindset/low_coupling/blooop/exercise.py @@ -1,7 +1,5 @@ from dataclasses import dataclass -from typing import List - @dataclass class VehicleData: @@ -26,7 +24,7 @@ def compute_rental_cost(self, days: int, km: int) -> int: } -def read_vehicle_type(veh_types: List[str]) -> str: +def read_vehicle_type(veh_types: list[str]) -> str: """Reads the vehicle type from the user.""" vehicle_type = "" while vehicle_type not in veh_types: diff --git a/arjan_codes_sw_design_mindset/pure_functions/blooop/exercise/exercise_1.py b/arjan_codes_sw_design_mindset/pure_functions/blooop/exercise/exercise_1.py index 9fb2d36..f3afd0c 100644 --- a/arjan_codes_sw_design_mindset/pure_functions/blooop/exercise/exercise_1.py +++ b/arjan_codes_sw_design_mindset/pure_functions/blooop/exercise/exercise_1.py @@ -13,7 +13,7 @@ def weekday(today: datetime) -> str: def main() -> None: - print(f"Today is a {weekday(datetime.today())}") + print(f"Today is a {weekday(datetime.today())}") # noqa: DTZ002 print(f"Your id = {generate_id(10)}") diff --git a/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise1.py b/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise1.py index eb37cd7..73d239a 100644 --- a/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise1.py +++ b/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise1.py @@ -1,4 +1,5 @@ from dataclasses import dataclass + from strenum import StrEnum diff --git a/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise2.py b/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise2.py index 8599498..d883cc9 100644 --- a/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise2.py +++ b/arjan_codes_sw_design_mindset/separate_creation_from_use/blooop/exercise2.py @@ -1,7 +1,8 @@ from dataclasses import dataclass -from strenum import StrEnum from enum import auto +from strenum import StrEnum + class EnemyType(StrEnum): KNIGHT = auto() diff --git a/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise1.py b/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise1.py index bc78b0a..57f4672 100644 --- a/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise1.py +++ b/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise1.py @@ -1,4 +1,5 @@ from dataclasses import dataclass + from strenum import StrEnum diff --git a/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise2.py b/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise2.py index 41cbf64..e11d5fb 100644 --- a/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise2.py +++ b/arjan_codes_sw_design_mindset/separate_creation_from_use/giggus/exercise2.py @@ -1,6 +1,7 @@ +from collections.abc import Callable from dataclasses import dataclass + from strenum import StrEnum -from typing import Callable class EnemyType(StrEnum): diff --git a/arjan_codes_sw_design_mindset/start_with_the_data/blooop/exercise.py b/arjan_codes_sw_design_mindset/start_with_the_data/blooop/exercise.py index 77bcfb0..56f5485 100644 --- a/arjan_codes_sw_design_mindset/start_with_the_data/blooop/exercise.py +++ b/arjan_codes_sw_design_mindset/start_with_the_data/blooop/exercise.py @@ -1,5 +1,5 @@ -from enum import Enum, auto from dataclasses import dataclass, field +from enum import Enum, auto class PaymentStatus(Enum): diff --git a/arjan_codes_sw_design_mindset/start_with_the_data/giggus/exercise.py b/arjan_codes_sw_design_mindset/start_with_the_data/giggus/exercise.py index 4897371..b17b185 100644 --- a/arjan_codes_sw_design_mindset/start_with_the_data/giggus/exercise.py +++ b/arjan_codes_sw_design_mindset/start_with_the_data/giggus/exercise.py @@ -1,5 +1,5 @@ -from enum import Enum, auto from dataclasses import dataclass +from enum import Enum, auto class PaymentStatus(Enum): diff --git a/pixi.lock b/pixi.lock new file mode 100644 index 0000000..b10c817 --- /dev/null +++ b/pixi.lock @@ -0,0 +1,726 @@ +version: 7 +platforms: +- name: linux-64 + virtual-packages: + - __unix=0=0 + - __linux=4.18 + - __glibc=2.28 + - __archspec=0=x86_64 +environments: + default: + channels: + - url: https://conda.anaconda.org/conda-forge/ + indexes: + - https://pypi.org/simple + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_103.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.5-hd2095e1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h81df57d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.2.0-ha9f2e26_7.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.2.0-he0feb66_7.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hb9d3cd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libpython-3.12.15-ha57cdbe_2_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.54.1-h0737f62_100.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.4-hcfc3c73_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.38-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.5-h781a0a9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.15-h5f976f7_2_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h1df4ec4_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.10.23-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026e-h5d301ff_0.conda + - pypi: ./ + - pypi: https://files.pythonhosted.org/packages/07/c0/ccbb2a4c75b283d6100400a907087bfa4d89cee9df73fa6af85268115d81/numpy-1.26.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/42/7b/1cec26caae4bf44bb9911e1119d5d1a35171571e100b728a2ccd8719a3b1/pytest_runner-6.0.0-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/54/c8/12811c9b48fde162bb72b6f2e78fada9a247a09d7bb5be2050a5d099c77b/nodeenv-1.11.0-py2.py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/60/91/1aa70d3dfcab0dbcf88a2cbc3bce7f7c69562287a90216e617eaa4937e25/python_discovery-1.6.4-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/6c/75/526915fedf462e05eeb1c75ceaf7e3f9cde7b5ce6f62740fe5f7f19a0050/pre_commit-3.5.0-py2.py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/6c/8a/1d8cb3842909dc193a73835adedf412e32e18f8ffd59f43983949622fe6f/platformdirs-4.13.5-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/81/69/297302c5f5f59c862faa31e6cb9a4cd74721cd1e052b38e464c5b402df8b/StrEnum-0.4.15-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/83/bb/2e3c1fec1d098dfbca419bb9493188cf9cbd2929cef6ad8887006c6d51d2/hypothesis-6.88.1-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/85/11/044d1ae1b4ec0d7af88ee5bc91e081be1022533032b906a7bdabdbb60977/pyproject_hooks-1.3.3-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/86/42/5220a120cd50b1483c17d303e95d579047ae0d85150eedba7417574db29e/check_manifest-0.49-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/a7/4b/8b78d126e275efa2379b1c2e09dc52cf70df16fc3b90613ef82531499d73/pytest_cov-4.1.0-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ac/c7/8bbeb18581fa94beb01646a8434e58ea48e9cec45d7768e258e16d43f247/ruff-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/ad/9b/9fb3585dabcd73a1b2a6267f63f62649347c9e6d072c9fde365b105abb2c/build-1.6.1-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/b9/25/b29fd10dd062cf41e66787a7951b3842881a2a2d7e3a41fcbb58a8466046/pytest_mock-3.12.0-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/bb/a9/c10d8a44a29fb94a18b43fdf11f38caca53ae7c9406f11a72b1cb8f624f1/virtualenv-21.14.13-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/c1/2b/238f02a4927fa2e27aa995371d240a468b52e42eae44a678434aff736b38/distlib-0.4.4-py2.py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/e0/1b/5e74289a1878e666bb4b65fe5805a04cafcac2aa5f519ef1ead67ef91c56/filelock-4.2.4-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/ef/55/6dc6d6bb953bdfc52519a0059592c52b6e3b8ad51cf8256dffceb55b0610/setuptools-84.2.1-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/f2/f7/066ac34162f711a18abf90b6c2f277a976c9804c548bcd81f543e0996b27/coverage-7.3.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/f3/8c/f16efd81ca8e293b2cc78f111190a79ee539d0d5d36ccd49975cb3beac60/pytest-7.4.3-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/fa/70/fffc9613501877c0a10a1ef73a165e6ded3e53f6e7502227fef56d973933/identify-2.6.20-py2.py3-none-any.whl +packages: +- conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + build_number: 20 + sha256: 1dd3fffd892081df9726d7eb7e0dea6198962ba775bd88842135a4ddb4deb3c9 + md5: a9f577daf3de00bca7c3c76c0ecbd1de + depends: + - __glibc >=2.17,<3.0.a0 + - libgomp >=7.5.0 + constrains: + - openmp_impl <0.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 28948 + timestamp: 1770939786096 +- conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_10.conda + sha256: 1a0d382c515ebf55f8ee1f38c8b81bc95af5c2acc42ad53b66bc5df932032f96 + md5: e675fabcf81499adc7edf58124fb1e01 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: bzip2-1.0.6 + license_family: BSD + purls: [] + run_exports: + weak: + - bzip2 >=1.0.8,<2.0a0 + size: 257808 + timestamp: 1785906269155 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_103.conda + sha256: 901649b1edbe841fd4ee7e2d491a05184ed540eb01cdae506872f344babc1d28 + md5: 2362c70e7e79827c32db35547d9c179b + depends: + - __glibc >=2.17,<3.0.a0 + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-64 2.46.1 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 742109 + timestamp: 1791565468810 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.5-hd2095e1_0.conda + sha256: 6de73033a7c5f712c9c5a54124e4581e025691029835e5bceaf10a333a7e7bc0 + md5: 72cfd2b95b0540247220b42f58a148d7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + constrains: + - expat 2.8.5.* + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 77893 + timestamp: 1790346247149 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h81df57d_1.conda + sha256: c8c7583ef063bc3c430f1d48298e5ad24f796a35c22ed5b14183325825a61106 + md5: 6525a0b06aa4fd390795f0740636a9dd + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libffi >=3.7.0,<3.8.0a0 + size: 68004 + timestamp: 1787753412298 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.2.0-ha9f2e26_7.conda + sha256: e031634c3a928f9594eba868bc46ef5230d6571a364a0c63215b06c4563bfcea + md5: 735629b400b70eeab21a2ba8f5b1c2ce + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + constrains: + - libgcc-ng ==16.2.0=*_7 + - libgomp 16.2.0 he0feb66_7 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 1058444 + timestamp: 1790303109576 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.2.0-he0feb66_7.conda + sha256: 92a0bb350c7be6a4eedcb4e111c60aefd176018e6b1c009a6e025dbe9bbcd758 + md5: d904c7ddd95e026254b4b80808ee9e12 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 640566 + timestamp: 1790303046034 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + sha256: 9787df8c22a59c9a70d3e5a10db9ad663485e75e9ccc3f09bd092cb7b95e0dab + md5: 1390b7c5ac0b1d8e447bc5efa6d3c8c2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - xz 5.8.3.* + license: 0BSD + purls: [] + run_exports: + weak: + - liblzma >=5.8.3,<6.0a0 + size: 112995 + timestamp: 1786348617826 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hb9d3cd8_1.conda + sha256: 927fe72b054277cde6cb82597d0fcf6baf127dcbce2e0a9d8925a68f1265eef5 + md5: d864d34357c3b65a4b731f78c0801dc4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.1-only + license_family: GPL + purls: [] + run_exports: + weak: + - libnsl >=2.0.1,<2.1.0a0 + size: 33731 + timestamp: 1750274110928 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libpython-3.12.15-ha57cdbe_2_cpython.conda + build_number: 2 + sha256: 37017ac4a784c50f1fc73c7b0eb090c7f29f4541c9014c4b4e10daa275488fdd + md5: fe256863f652549334a81a8e49fdf097 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + license: Python-2.0 + purls: [] + run_exports: + weak: + - libpython >=3.12,<4.0a0 + size: 8775924 + timestamp: 1791911120563 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.54.1-h0737f62_100.conda + sha256: 107ba2f9134b45a6fdaf8d2485f432e3a643fdfaf711a325d0c9139b580b3523 + md5: 5fdfd335c3d653e41c1eea1353d827d0 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - libzlib >=1.3.2,<2.0a0 + constrains: + - icu <0.0a0 + license: blessing + purls: [] + run_exports: + weak: + - libsqlite >=3.54.1,<4.0a0 + size: 980418 + timestamp: 1792175610911 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.4-hcfc3c73_0.conda + sha256: f34b8d1de9a2bf62476d8608057d9b8a918d97444236dc53a47128f2fae79041 + md5: 54a948337e66706380ff24d6b5fde63f + depends: + - libgcc >=15 + - __glibc >=2.17,<3.0.a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libuuid >=2.42.4,<3.0a0 + size: 34442 + timestamp: 1790121449161 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.38-h280c20c_0.conda + sha256: f7e9292dd219a6435bbb1223da9586c3e70d66d169c5a92f08db3f2127df04e9 + md5: f7a7ff5a6ab331e037abd34f379a631d + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libxcrypt >=4.4.38 + size: 101957 + timestamp: 1785887123445 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + sha256: eb8a0db0aa570124f7d2a93d7c7f596e3390df5e047818d873baad32985fc736 + md5: 0de0122d9570a8ab637c6b73db268389 + depends: + - __glibc >=2.17,<3.0.a0 + constrains: + - zlib 1.3.2 *_3 + license: Zlib + license_family: Other + purls: [] + run_exports: + weak: + - libzlib >=1.3.2,<2.0a0 + size: 63713 + timestamp: 1785362952714 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + sha256: 5d46557214ed184381dafe835b7c94a474a1c3b307a08a250b1ea4779b44ffb3 + md5: ee6c0cd80a60961a1f48aa3e0b91f986 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: X11 AND BSD-3-Clause + purls: [] + run_exports: + weak: + - ncurses >=6.6,<7.0a0 + size: 911196 + timestamp: 1786355078102 +- conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.5-h781a0a9_0.conda + sha256: 9c1533f1cf784f0e250919c0c9762d0b0e6bc727a79290ffb7cea1ceca1d038c + md5: 5a51a2ea653f120240b1a9bf76e0aae9 + depends: + - __glibc >=2.17,<3.0.a0 + - ca-certificates + - libgcc >=15 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - openssl >=3.6.5,<4.0a0 + size: 3195299 + timestamp: 1791098052301 +- conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.15-h5f976f7_2_cpython.conda + build_number: 2 + sha256: f8a38c33f627c68e35d02cc5a11eff25eadb853791ac40bf9cc569315d25bc54 + md5: 13cef25ee4055b1fec19d35d20aadda2 + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.8.5,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=15 + - liblzma >=5.8.3,<6.0a0 + - libnsl >=2.0.1,<2.1.0a0 + - libpython 3.12.15 ha57cdbe_2_cpython + - libsqlite >=3.54.0,<4.0a0 + - libuuid >=2.42.4,<3.0a0 + - libxcrypt >=4.4.38 + - libzlib >=1.3.2,<2.0a0 + - ncurses >=6.6,<7.0a0 + - openssl >=3.5.9,<4.0a0 + - readline >=8.3,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + constrains: + - python_abi 3.12.* *_cp312 + license: Python-2.0 + purls: [] + run_exports: + weak: + - python_abi 3.12.* *_cp312 + noarch: + - python + size: 23065587 + timestamp: 1791911147011 +- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + sha256: 01b3fe073a66e321970d09e04b388708f8cbdca5cdfbfcb7c9eeb470ad10383d + md5: 69c01c781e7c8190bbdaf79e3848c5ca + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - ncurses >=6.6,<7.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: + weak: + - readline >=8.3,<9.0a0 + size: 348899 + timestamp: 1787033801506 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h1df4ec4_4.conda + build_number: 104 + sha256: a1a241d172c1ccab067ba245206dd048bc3c2d1b84504b53c9468e99adfc16a1 + md5: 676a2f9b1c4fcf57b70aa5c65f6c60d0 + depends: + - libgcc >=15 + - __glibc >=2.17,<3.0.a0 + - libzlib >=1.3.2,<2.0a0 + constrains: + - xorg-libx11 >=1.8.13,<2.0a0 + license: TCL + purls: [] + run_exports: + weak: + - tk >=8.6.13,<8.7.0a0 + size: 3566806 + timestamp: 1787272857910 +- conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + sha256: 47d682b9f6d6ec9eb1a6e6c3e75ea6273e899e78fb7fc59f81d39745009fbc60 + md5: aa459086047c0e5e27023ab19f8cb86a + depends: + - __glibc >=2.17,<3.0.a0 + - libzlib >=1.3.2,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + size: 601301 + timestamp: 1786599621503 +- conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.10.23-hbd8a1cb_0.conda + sha256: 95619b9c1184be7175392eeb0ee7eeb5ccf25d280951f4225f2d62e725790be3 + md5: 3fd02989038a1e1cee627c14c2d73f29 + depends: + - __unix + license: ISC + purls: [] + run_exports: {} + size: 130057 + timestamp: 1792772446739 +- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026e-h5d301ff_0.conda + sha256: 2b7ca858879f183ce2dcc65b300f48a0133d5430550f35b23d80d405a0788dbf + md5: abccc3810d2b97e570dee487f2b46e38 + license: LicenseRef-Public-Domain + purls: [] + run_exports: {} + size: 119208 + timestamp: 1792758382821 +- pypi: ./ + name: arjan-codes-sw-design-mindset + requires_dist: + - numpy>=1.2,<=1.26.1 + - strenum<=0.4.15,>=0.4.15 + - check-manifest<=0.49,>=0.49 ; extra == 'test' + - pre-commit>=3.3.3,<=3.5.0 ; extra == 'test' + - pytest-cov<=4.1,>=4.1 ; extra == 'test' + - pytest-mock>=3.10,<=3.12.0 ; extra == 'test' + - pytest-runner<=6.0,>=6.0 ; extra == 'test' + - pytest>=7.4,<=7.4.3 ; extra == 'test' + - hypothesis>=6.82,<=6.88.1 ; extra == 'test' + - ruff>=0.0.280,<=0.1.3 ; extra == 'test' + - coverage>=7.2.7,<=7.3.2 ; extra == 'test' + requires_python: '>=3.10' +- pypi: https://files.pythonhosted.org/packages/07/c0/ccbb2a4c75b283d6100400a907087bfa4d89cee9df73fa6af85268115d81/numpy-1.26.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + name: numpy + version: 1.26.1 + sha256: dcfaf015b79d1f9f9c9fd0731a907407dc3e45769262d657d754c3a028586124 + requires_python: '>=3.9,<3.13' +- pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl + name: sortedcontainers + version: 2.4.0 + sha256: a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 +- pypi: https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl + name: pluggy + version: 1.7.0 + sha256: 7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec + requires_python: '>=3.10' +- pypi: https://files.pythonhosted.org/packages/42/7b/1cec26caae4bf44bb9911e1119d5d1a35171571e100b728a2ccd8719a3b1/pytest_runner-6.0.0-py3-none-any.whl + name: pytest-runner + version: 6.0.0 + sha256: 4c059cf11cf4306e369c0f8f703d1eaf8f32fad370f41deb5f007044656aca6b + requires_dist: + - sphinx ; extra == 'docs' + - jaraco-packaging>=9 ; extra == 'docs' + - rst-linker>=1.9 ; extra == 'docs' + - jaraco-tidelift>=1.4 ; extra == 'docs' + - pytest>=6 ; extra == 'testing' + - pytest-checkdocs>=2.4 ; extra == 'testing' + - pytest-flake8 ; extra == 'testing' + - pytest-cov ; extra == 'testing' + - pytest-enabler>=1.0.1 ; extra == 'testing' + - pytest-virtualenv ; extra == 'testing' + - types-setuptools ; extra == 'testing' + - pytest-black>=0.3.7 ; platform_python_implementation != 'PyPy' and extra == 'testing' + - pytest-mypy>=0.9.1 ; platform_python_implementation != 'PyPy' and extra == 'testing' + requires_python: '>=3.7' +- pypi: https://files.pythonhosted.org/packages/54/c8/12811c9b48fde162bb72b6f2e78fada9a247a09d7bb5be2050a5d099c77b/nodeenv-1.11.0-py2.py3-none-any.whl + name: nodeenv + version: 1.11.0 + sha256: edaa16e6c14d7cf395d75d4bbd5a26390f4dc06501a33b4e76282b02cc688a25 + requires_dist: + - certifi ; extra == 'certifi' + requires_python: '>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*' +- pypi: https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl + name: iniconfig + version: 2.3.1 + sha256: 9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 + requires_python: '>=3.10' +- pypi: https://files.pythonhosted.org/packages/60/91/1aa70d3dfcab0dbcf88a2cbc3bce7f7c69562287a90216e617eaa4937e25/python_discovery-1.6.4-py3-none-any.whl + name: python-discovery + version: 1.6.4 + sha256: 530179cc51a1816d512b15635b3dc931295ae12efb183783ad31190a5d425d2b + requires_dist: + - filelock>=3.16.1 + requires_python: '>=3.9' +- pypi: https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl + name: packaging + version: '26.3' + sha256: d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + requires_python: '>=3.9' +- pypi: https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl + name: attrs + version: 26.1.0 + sha256: c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 + requires_python: '>=3.9' +- pypi: https://files.pythonhosted.org/packages/6c/75/526915fedf462e05eeb1c75ceaf7e3f9cde7b5ce6f62740fe5f7f19a0050/pre_commit-3.5.0-py2.py3-none-any.whl + name: pre-commit + version: 3.5.0 + sha256: 841dc9aef25daba9a0238cd27984041fa0467b4199fc4852e27950664919f660 + requires_dist: + - cfgv>=2.0.0 + - identify>=1.0.0 + - nodeenv>=0.11.1 + - pyyaml>=5.1 + - virtualenv>=20.10.0 + requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/6c/8a/1d8cb3842909dc193a73835adedf412e32e18f8ffd59f43983949622fe6f/platformdirs-4.13.5-py3-none-any.whl + name: platformdirs + version: 4.13.5 + sha256: 53d3ec4280b815c1e0b02edad7f9ee8fda1ba9c0865dd9c2e6e63849ce82fc1e + requires_python: '>=3.11' +- pypi: https://files.pythonhosted.org/packages/81/69/297302c5f5f59c862faa31e6cb9a4cd74721cd1e052b38e464c5b402df8b/StrEnum-0.4.15-py3-none-any.whl + name: strenum + version: 0.4.15 + sha256: a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659 + requires_dist: + - sphinx ; extra == 'docs' + - sphinx-rtd-theme ; extra == 'docs' + - myst-parser[linkify] ; extra == 'docs' + - twine ; extra == 'release' + - pytest ; extra == 'test' + - pytest-black ; extra == 'test' + - pytest-cov ; extra == 'test' + - pytest-pylint ; extra == 'test' + - pylint ; extra == 'test' +- pypi: https://files.pythonhosted.org/packages/83/bb/2e3c1fec1d098dfbca419bb9493188cf9cbd2929cef6ad8887006c6d51d2/hypothesis-6.88.1-py3-none-any.whl + name: hypothesis + version: 6.88.1 + sha256: b45b8a651dfe4ce26f900ce6ccbce997d4fbec39ba03dd243516bf81fea8c0b8 + requires_dist: + - attrs>=19.2.0 + - sortedcontainers>=2.1.0,<3.0.0 + - exceptiongroup>=1.0.0 ; python_full_version < '3.11' + - black>=19.10b0 ; extra == 'all' + - click>=7.0 ; extra == 'all' + - django>=3.2 ; extra == 'all' + - dpcontracts>=0.4 ; extra == 'all' + - lark>=0.10.1 ; extra == 'all' + - libcst>=0.3.16 ; extra == 'all' + - numpy>=1.17.3 ; extra == 'all' + - pandas>=1.1 ; extra == 'all' + - pytest>=4.6 ; extra == 'all' + - python-dateutil>=1.4 ; extra == 'all' + - pytz>=2014.1 ; extra == 'all' + - redis>=3.0.0 ; extra == 'all' + - rich>=9.0.0 ; extra == 'all' + - backports-zoneinfo>=0.2.1 ; python_full_version < '3.9' and extra == 'all' + - tzdata>=2023.3 ; sys_platform == 'win32' and extra == 'all' + - click>=7.0 ; extra == 'cli' + - black>=19.10b0 ; extra == 'cli' + - rich>=9.0.0 ; extra == 'cli' + - libcst>=0.3.16 ; extra == 'codemods' + - python-dateutil>=1.4 ; extra == 'dateutil' + - django>=3.2 ; extra == 'django' + - dpcontracts>=0.4 ; extra == 'dpcontracts' + - black>=19.10b0 ; extra == 'ghostwriter' + - lark>=0.10.1 ; extra == 'lark' + - numpy>=1.17.3 ; extra == 'numpy' + - pandas>=1.1 ; extra == 'pandas' + - pytest>=4.6 ; extra == 'pytest' + - pytz>=2014.1 ; extra == 'pytz' + - redis>=3.0.0 ; extra == 'redis' + - backports-zoneinfo>=0.2.1 ; python_full_version < '3.9' and extra == 'zoneinfo' + - tzdata>=2023.3 ; sys_platform == 'win32' and extra == 'zoneinfo' + requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/85/11/044d1ae1b4ec0d7af88ee5bc91e081be1022533032b906a7bdabdbb60977/pyproject_hooks-1.3.3-py3-none-any.whl + name: pyproject-hooks + version: 1.3.3 + sha256: 5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b + requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/86/42/5220a120cd50b1483c17d303e95d579047ae0d85150eedba7417574db29e/check_manifest-0.49-py3-none-any.whl + name: check-manifest + version: '0.49' + sha256: 058cd30057714c39b96ce4d83f254fc770e3145c7b1932b5940b4e3efb5521ef + requires_dist: + - build>=0.1 + - setuptools + - tomli ; python_full_version < '3.11' + - pytest ; extra == 'test' + - mock>=3.0.0 ; python_full_version == '3.7.*' and extra == 'test' + requires_python: '>=3.7' +- pypi: https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl + name: pyyaml + version: 6.0.3 + sha256: ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc + requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/a7/4b/8b78d126e275efa2379b1c2e09dc52cf70df16fc3b90613ef82531499d73/pytest_cov-4.1.0-py3-none-any.whl + name: pytest-cov + version: 4.1.0 + sha256: 6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a + requires_dist: + - pytest>=4.6 + - coverage[toml]>=5.2.1 + - fields ; extra == 'testing' + - hunter ; extra == 'testing' + - process-tests ; extra == 'testing' + - six ; extra == 'testing' + - pytest-xdist ; extra == 'testing' + - virtualenv ; extra == 'testing' + requires_python: '>=3.7' +- pypi: https://files.pythonhosted.org/packages/ac/c7/8bbeb18581fa94beb01646a8434e58ea48e9cec45d7768e258e16d43f247/ruff-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + name: ruff + version: 0.1.3 + sha256: 0f75e670d529aa2288cd00fc0e9b9287603d95e1536d7a7e0cafe00f75e0dd9d + requires_python: '>=3.7' +- pypi: https://files.pythonhosted.org/packages/ad/9b/9fb3585dabcd73a1b2a6267f63f62649347c9e6d072c9fde365b105abb2c/build-1.6.1-py3-none-any.whl + name: build + version: 1.6.1 + sha256: ecd351a4be9d35a9eaaba244a7687143c9c7d4aea6ac964e7e7ddab20cbcf4e7 + requires_dist: + - packaging>=24.0 + - pyproject-hooks + - colorama ; os_name == 'nt' + - importlib-metadata>=4.6 ; python_full_version < '3.10.2' + - tomli>=1.1.0 ; python_full_version < '3.11' + - keyring ; extra == 'keyring' + - uv>=0.1.18 ; extra == 'uv' + - virtualenv>=20.36.1 ; extra == 'virtualenv' + requires_python: '>=3.10' +- pypi: https://files.pythonhosted.org/packages/b9/25/b29fd10dd062cf41e66787a7951b3842881a2a2d7e3a41fcbb58a8466046/pytest_mock-3.12.0-py3-none-any.whl + name: pytest-mock + version: 3.12.0 + sha256: 0972719a7263072da3a21c7f4773069bcc7486027d7e8e1f81d98a47e701bc4f + requires_dist: + - pytest>=5.0 + - pre-commit ; extra == 'dev' + - tox ; extra == 'dev' + - pytest-asyncio ; extra == 'dev' + requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/bb/a9/c10d8a44a29fb94a18b43fdf11f38caca53ae7c9406f11a72b1cb8f624f1/virtualenv-21.14.13-py3-none-any.whl + name: virtualenv + version: 21.14.13 + sha256: 5fbb04138a4861580b78ba9110d529a26bc48fcc93c8ec36bc0202eeed96a788 + requires_dist: + - distlib>=0.4.3,<1 + - filelock>=3.24.2,<5 ; python_full_version >= '3.10' + - filelock<=3.19.1,>=3.19.1 ; python_full_version < '3.10' + - packaging>=26.3 + - platformdirs>=4.4,<5 + - python-discovery>=1.6.1 + - typing-extensions>=4.16 ; python_full_version < '3.11' + requires_python: '>=3.9' +- pypi: https://files.pythonhosted.org/packages/c1/2b/238f02a4927fa2e27aa995371d240a468b52e42eae44a678434aff736b38/distlib-0.4.4-py2.py3-none-any.whl + name: distlib + version: 0.4.4 + sha256: cf09d55b1e85a89576b036aeb71550bfd68320f3f21761ca329eadadad918638 +- pypi: https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl + name: cfgv + version: 3.5.0 + sha256: a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0 + requires_python: '>=3.10' +- pypi: https://files.pythonhosted.org/packages/e0/1b/5e74289a1878e666bb4b65fe5805a04cafcac2aa5f519ef1ead67ef91c56/filelock-4.2.4-py3-none-any.whl + name: filelock + version: 4.2.4 + sha256: 301241438c57936ef93f4243a94f2559022268bfcf9b375a9a72eb0f8db8358e + requires_python: '>=3.11' +- pypi: https://files.pythonhosted.org/packages/ef/55/6dc6d6bb953bdfc52519a0059592c52b6e3b8ad51cf8256dffceb55b0610/setuptools-84.2.1-py3-none-any.whl + name: setuptools + version: 84.2.1 + sha256: ca140b45d5325a9478f880e351484f62fef15f336462e449ca0c03c873d589c2 + requires_dist: + - pytest>=6,!=8.1.* ; extra == 'test' + - virtualenv>=13.0.0 ; extra == 'test' + - wheel>=0.44.0 ; extra == 'test' + - pip>=19.1 ; extra == 'test' + - packaging>=26.3 ; extra == 'test' + - jaraco-envs>=2.2 ; extra == 'test' + - pytest-xdist>=3 ; extra == 'test' + - jaraco-path>=3.7.2 ; extra == 'test' + - build[virtualenv]>=1.0.3 ; extra == 'test' + - filelock>=3.4.0 ; extra == 'test' + - ini2toml[lite]>=0.14 ; extra == 'test' + - tomli-w>=1.0.0 ; extra == 'test' + - pytest-timeout ; extra == 'test' + - pytest-perf ; sys_platform != 'cygwin' and extra == 'test' + - jaraco-develop>=7.21 ; python_full_version >= '3.9' and sys_platform != 'cygwin' and extra == 'test' + - pytest-home>=0.5 ; extra == 'test' + - pytest-subprocess ; extra == 'test' + - pyproject-hooks!=1.1 ; extra == 'test' + - jaraco-test>=5.5 ; extra == 'test' + - sphinx>=3.5 ; extra == 'doc' + - jaraco-packaging>=9.3 ; extra == 'doc' + - rst-linker>=1.9 ; extra == 'doc' + - furo ; extra == 'doc' + - sphinx-lint ; extra == 'doc' + - jaraco-tidelift>=1.4 ; extra == 'doc' + - pygments-github-lexers==0.0.5 ; extra == 'doc' + - sphinx-favicon ; extra == 'doc' + - sphinx-inline-tabs ; extra == 'doc' + - sphinx-reredirects ; extra == 'doc' + - sphinxcontrib-towncrier ; extra == 'doc' + - sphinx-notfound-page>=1,<2 ; extra == 'doc' + - pyproject-hooks!=1.1 ; extra == 'doc' + - towncrier<24.7 ; extra == 'doc' + - packaging>=26.3 ; extra == 'core' + - more-itertools>=8.8 ; extra == 'core' + - jaraco-text>=3.7 ; extra == 'core' + - importlib-metadata>=6 ; python_full_version < '3.10' and extra == 'core' + - tomli>=2.0.1 ; python_full_version < '3.11' and extra == 'core' + - wheel>=0.43.0 ; extra == 'core' + - jaraco-functools>=4 ; extra == 'core' + - more-itertools ; extra == 'core' + - pytest-checkdocs>=2.14 ; extra == 'check' + - pytest-ruff>=0.2.1 ; sys_platform != 'cygwin' and extra == 'check' + - ruff>=0.13.0 ; sys_platform != 'cygwin' and extra == 'check' + - pytest-cov ; extra == 'cover' + - pytest-enabler>=3.4 ; extra == 'enabler' + - pytest-mypy>=1.0.1 ; platform_python_implementation != 'PyPy' and extra == 'type' + - mypy==1.18.* ; extra == 'type' + - importlib-metadata>=7.0.2 ; python_full_version < '3.10' and extra == 'type' + - jaraco-develop>=7.21 ; sys_platform != 'cygwin' and extra == 'type' + requires_python: '>=3.10' +- pypi: https://files.pythonhosted.org/packages/f2/f7/066ac34162f711a18abf90b6c2f277a976c9804c548bcd81f543e0996b27/coverage-7.3.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl + name: coverage + version: 7.3.2 + sha256: f6e9589bd04d0461a417562649522575d8752904d35c12907d8c9dfeba588faf + requires_dist: + - tomli ; python_full_version <= '3.11' and extra == 'toml' + requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/f3/8c/f16efd81ca8e293b2cc78f111190a79ee539d0d5d36ccd49975cb3beac60/pytest-7.4.3-py3-none-any.whl + name: pytest + version: 7.4.3 + sha256: 0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac + requires_dist: + - iniconfig + - packaging + - pluggy>=0.12,<2.0 + - exceptiongroup>=1.0.0rc8 ; python_full_version < '3.11' + - tomli>=1.0.0 ; python_full_version < '3.11' + - importlib-metadata>=0.12 ; python_full_version < '3.8' + - colorama ; sys_platform == 'win32' + - argcomplete ; extra == 'testing' + - attrs>=19.2.0 ; extra == 'testing' + - hypothesis>=3.56 ; extra == 'testing' + - mock ; extra == 'testing' + - nose ; extra == 'testing' + - pygments>=2.7.2 ; extra == 'testing' + - requests ; extra == 'testing' + - setuptools ; extra == 'testing' + - xmlschema ; extra == 'testing' + requires_python: '>=3.7' +- pypi: https://files.pythonhosted.org/packages/fa/70/fffc9613501877c0a10a1ef73a165e6ded3e53f6e7502227fef56d973933/identify-2.6.20-py2.py3-none-any.whl + name: identify + version: 2.6.20 + sha256: 6a16b69b93187244e0548cbfd25b3e4a6f9a7a2ad784625c3bec2b8d27b81aaa + requires_dist: + - ukkonen ; extra == 'license' + requires_python: '>=3.10' diff --git a/pyproject.toml b/pyproject.toml index b762d75..8585a35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,10 +11,8 @@ requires-python = ">=3.10" dependencies = ["numpy>=1.2,<=1.26.1", "strenum>=0.4.15,<=0.4.15"] [project.optional-dependencies] test = [ - "black>=23,<=23.10.1", "check-manifest>=0.49,<=0.49", "pre-commit>=3.3.3,<=3.5.0", - "pylint>=2.16,<=3.0.2", "pytest-cov>=4.1,<=4.1", "pytest-mock>=3.10,<=3.12.0", "pytest-runner>=6.0,<=6.0", @@ -37,26 +35,13 @@ requires = ["flit_core >=3.2,<4"] build-backend = "flit_core.buildapi" -[tool.pylint] -extension-pkg-whitelist = ["numpy"] -jobs = 16 #detect number of cores -ignore-paths = [".*official.*"] - -[tool.pylint.'MESSAGES CONTROL'] -disable = "C,logging-fstring-interpolation,line-too-long,fixme,broad-exception-caught,missing-module-docstring,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,use-dict-literal,cyclic-import,duplicate-code,too-many-public-methods,unused-argument,unspecified-encoding" -enable = "no-else-return,consider-using-in" - -[tool.black] -line-length = 100 - [tool.ruff] # Never enforce `E501` (line length violations). -#"F841" will auto remove unused variables which is annoying during development, pylint catches this anyway +#"F841" will auto remove unused variables which is annoying during development ignore = ["E501", "E902", "F841"] exclude = ["**/official/**"] -# Same as Black. line-length = 100 target-version = "py310" @@ -81,3 +66,22 @@ exclude_also = [ "raise NotImplementedError", "if __name__ == .__main__.:", ] + +# pixi supplies Python and the dev environment in the devcontainer +# (ghcr.io/blooop/python_template/devcontainer has no pip-based Python setup). +# The package build stays on flit, so CI and publishing do not change. +[tool.pixi.workspace] +channels = ["conda-forge"] +platforms = ["linux-64"] + +[tool.pixi.dependencies] +python = "3.12.*" + +[tool.pixi.pypi-dependencies] +arjan_codes_sw_design_mindset = { path = ".", editable = true } + +[tool.pixi.environments] +default = { features = ["test"], solve-group = "default" } + +[tool.pixi.tasks] +test = "pytest" diff --git a/test/test_basic.py b/test/test_basic.py index d3540a3..bcf5192 100644 --- a/test/test_basic.py +++ b/test/test_basic.py @@ -1,7 +1,7 @@ -from arjan_codes_sw_design_mindset.basic_class import BasicClass - from unittest import TestCase +from arjan_codes_sw_design_mindset.basic_class import BasicClass + class TestBasicClass(TestCase): def test_init(self):