You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add justfile with op integration, restrict workflow permissions
Adds a justfile wrapping common tasks, with 1Password CLI injecting
secrets for integration tests. Adds explicit permissions blocks to all
GitHub Actions workflows to restrict GITHUB_TOKEN scope. Updates README
development docs to reflect just-based workflow.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+34-28Lines changed: 34 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -346,7 +346,7 @@ print(contract["recipient"]["display_name"]) # Nested fields too
346
346
347
347
## Development
348
348
349
-
This project uses [uv](https://docs.astral.sh/uv/) for dependency management and tooling.
349
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management and [just](https://github.com/casey/just) as a task runner. Integration tests use [1Password CLI](https://developer.1password.com/docs/cli/) (`op`) to inject the API key at runtime.
350
350
351
351
### Setup
352
352
@@ -357,11 +357,19 @@ cd tango-python
357
357
358
358
# Install dependencies with uv
359
359
uv sync --all-extras
360
+
```
361
+
362
+
### Secrets Management
363
+
364
+
API keys are stored in 1Password and injected at runtime via `op run`. The `.env` file uses secret references instead of real values:
360
365
361
-
# Or install dev dependencies only
362
-
uv sync --group dev
366
+
```bash
367
+
# .env
368
+
TANGO_API_KEY=op://Vault/tango-api/credential
363
369
```
364
370
371
+
Recipes that need the API key (integration tests, live tests, cassette refresh) handle this automatically through `just`.
372
+
365
373
### Testing
366
374
367
375
The SDK includes a comprehensive test suite with:
@@ -370,23 +378,19 @@ The SDK includes a comprehensive test suite with:
370
378
371
379
```bash
372
380
# Run all tests
373
-
uv run pytest
381
+
just test
374
382
375
383
# Run only unit tests
376
-
uv run pytest tests/ -m "not integration"
384
+
just test-unit
377
385
378
-
# Run only integration tests
379
-
uv run pytest tests/integration/
386
+
# Run integration tests (API key injected via 1Password)
387
+
just test-integration
380
388
381
-
# Run integration tests with live API (requires TANGO_API_KEY)
382
-
export TANGO_API_KEY=your-api-key
383
-
export TANGO_USE_LIVE_API=true
384
-
uv run pytest tests/integration/
389
+
# Run integration tests with live API
390
+
just test-live
385
391
386
392
# Refresh cassettes with fresh API responses
387
-
export TANGO_API_KEY=your-api-key
388
-
export TANGO_REFRESH_CASSETTES=true
389
-
uv run pytest tests/integration/
393
+
just refresh-cassettes
390
394
```
391
395
392
396
See [tests/integration/README.md](tests/integration/README.md) for detailed testing documentation.
@@ -395,16 +399,19 @@ See [tests/integration/README.md](tests/integration/README.md) for detailed test
395
399
396
400
```bash
397
401
# Format code
398
-
uv run ruff format tango/
402
+
just fmt
399
403
400
404
# Lint code
401
-
uv run ruff check tango/
405
+
just lint
402
406
403
407
# Type checking
404
-
uv run mypy tango/
408
+
just typecheck
409
+
410
+
# Security scan
411
+
just bandit
405
412
406
-
# Run all checks
407
-
uv run ruff format tango/ && uv run ruff check tango/ && uv run mypy tango/
413
+
# Run all checks (format, lint, typecheck, bandit)
414
+
just check
408
415
```
409
416
410
417
### Project Structure
@@ -482,6 +489,8 @@ tango-python/
482
489
483
490
- Python 3.12 or higher
484
491
- httpx >= 0.27.0
492
+
-[just](https://github.com/casey/just) (for development task runner)
@@ -501,12 +510,9 @@ Contributions are welcome! Please feel free to submit a Pull Request.
501
510
502
511
1. Fork the repository
503
512
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
504
-
3. Run lint and format: `uv run ruff format tango/ && uv run ruff check tango/`
505
-
4. Run type checking: `uv run mypy tango/`
506
-
5. Run tests: `uv run pytest`
507
-
6. (Optional) Run [filter and shape conformance](scripts/README.md#filter-and-shape-conformance) if you have the tango API manifest; CI will run it on push/PR
508
-
7. Commit your changes (`git commit -m 'Add amazing feature'`)
509
-
8. Push to the branch (`git push origin feature/amazing-feature`)
510
-
9. Open a Pull Request
511
-
512
-
For a single command that runs formatting, linting, type checking, and tests (and conformance when the manifest is present), use: `uv run python scripts/pr_review.py --mode full`
513
+
3. Run all checks: `just check`
514
+
4. Run tests: `just test`
515
+
5. (Optional) Run full PR review: `just pr-review`
516
+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
517
+
7. Push to the branch (`git push origin feature/amazing-feature`)
0 commit comments