This file defines the default operating guide for coding agents working in this repository.
Follow repository standards in this order:
CONTRIBUTING.md.github/pull_request_template.md- CI workflows in
.github/workflows/*.yml - Tooling config:
pyproject.toml,setup.cfg,Makefile,requirements-dev.txt .env.exampleanddocs/docs/authentication.md- Existing patterns in
cloudpathlib/,tests/, andtests/mock_clients/
Notes:
- Edit root docs as the source of truth:
README.md,HISTORY.md, andCONTRIBUTING.md. docs/docs/index.md,docs/docs/changelog.md, anddocs/docs/contributing.mdare generated from those root files viamake docs-setup/make docs.- Do not introduce new workflows, linters, formatters, or build tools unless explicitly requested.
- Keep changes focused and task-specific.
- Generic functionality should be replicated across providers when appropriate.
- If working as an outside contributor, make sure an issue exists and has maintainer sign-off before starting substantial work.
- CI covers Linux, macOS, and Windows.
- CI covers Python 3.9 through 3.14.
- Preserve the repository's existing compatibility patterns (
typing_extensions, version guards,pathlibshims) instead of rewriting toward newer-version-only syntax. - Do not introduce Python 3.10+/3.11+ syntax or stdlib dependencies unless they are properly guarded and compatible with the supported matrix.
- Put provider-agnostic behavior in
cloudpathlib/cloudpath.pyorcloudpathlib/client.pywhen possible. - Keep provider
*Path/*Clientcode focused on backend-specific properties or materially better backend-specific implementations. - When a failure mode is understood and should be backend-agnostic, translate provider errors to
cloudpathlib.exceptions. - If adding or extending a provider, update dispatch/registration, exports, tests, mocks, and docs together.
- Install dev dependencies with
make reqs. - Use the existing project commands:
make formatmake lintmake testmake test-live-cloudmake docsmake distmake perf
- Use
make distwhenever a change touches packaging, optional dependencies, imports, or installability. - If CloudPath method support changes, run
python docs/make_support_table.pyand updateREADME.md. - Notebook-backed docs are not executed by the docs build; if you edit a notebook under
docs/docs/, re-run all cells before commit.
- Default development loop:
make test. - Prefer the provider-agnostic rigs from
tests/conftest.py. - In tests, use
rig.create_cloud_path(...)and rig-backed clients unless the test is specifically about dispatch, direct instantiation, or client construction. - If a change adds or alters SDK calls, update the corresponding mock implementation in
tests/mock_clients/. - Temporary local shortcuts like commenting out rigs in
tests/conftest.pyare fine during development, but must not be committed. - Validate affected providers, not just one backend.
- For performance-sensitive changes (
_list_dir,glob,rglob,walk), runmake perfand include before/after results in PR notes.
- Encourage contributors to run live backend tests locally when they have access.
- Copy
.env.exampleto.envand usedocs/docs/authentication.mdas the canonical credential guide. - Common live-test variables include:
- AWS:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_PROFILE,AWS_ENDPOINT_URL,LIVE_S3_BUCKET - Azure:
AZURE_STORAGE_CONNECTION_STRING,AZURE_STORAGE_GEN2_CONNECTION_STRING,LIVE_AZURE_CONTAINER,AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_CLIENT_SECRET - GCS:
GOOGLE_APPLICATION_CREDENTIALS,GCP_PROJECT_ID,GCP_SA_KEY,LIVE_GS_BUCKET - Custom S3:
CUSTOM_S3_BUCKET,CUSTOM_S3_ENDPOINT,CUSTOM_S3_KEY_ID,CUSTOM_S3_SECRET_KEY
- AWS:
- Run live tests with
USE_LIVE_CLOUD=1 make test-live-cloud. - Live tests create and delete cloud files.
- If live backend access is unavailable, run mocked tests locally and document the live-test gap clearly for maintainers.
Before each commit:
- Inspect the staged diff and keep only task-relevant files.
- Confirm no secrets or local credential files are included (
.env, keys, tokens, bucket creds). - Confirm the appropriate formatting, linting, tests, and docs updates were completed for the changed surface.
- Make atomic commits with clear intent.
Before opening or updating a PR:
- Rebase onto the latest base branch.
- Confirm an issue exists and include
Closes #<issue>in the PR body. - Confirm the change is demonstrated by failure-before/fix-after evidence.
- Update
HISTORY.mdunder## UNRELEASEDto satisfy this repo's PR checklist; include issue and PR references when they are known. - Verify API changes include doc/docstring updates and generated-doc refresh as needed.
- If working from an external contributor context, note any live-backend limitations that maintainers need to validate on a repo-local branch.