### Sync Dependencies with uv Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Synchronizes project dependencies using the 'uv' package manager. This is typically a one-time setup step. ```shell uv sync ``` -------------------------------- ### Install Git Hook with pre-commit Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Installs the 'pre-commit' git hook manager. This ensures that code quality checks are run automatically before each commit. ```shell uv run pre-commit install ``` ```shell pre-commit install ``` -------------------------------- ### Fetch context with context7 tool Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Demonstrates how to use the 'context7' tool to fetch documentation and information for specific packages or Python versions. It emphasizes targeted queries and referencing official sources. ```shell context7: docs package=requests topics=install,quickstart,api,examples ``` ```shell context7: python version=3.12 topic=typing changes summary for "" ``` ```shell context7: python version=3.12 topic="pattern matching" examples minimal ``` -------------------------------- ### Format and run pre-commit after fixing TODOs Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Runs code formatting with 'ruff format' and then executes 'pre-commit' hooks after addressing any 'TODO' comments or other issues. This is a final check before committing. ```shell uv run ruff format . && uv run pre-commit run --all-files ``` -------------------------------- ### Define Public API with __all__ Source: https://github.com/tonkintaylor/templafy/blob/master/src/templafy/AGENTS.md Packages must define a clear public API in their `__init__.py` file. Use the `__all__` attribute to explicitly declare which classes, functions, or constants are part of the public interface. Internal utilities should be prefixed with an underscore. ```python # __init__.py from .module_a import public_function_a from .module_b import PublicClassB __all__ = [ "public_function_a", "PublicClassB" ] # Internal utility, not exposed publicly def _internal_helper(): pass ``` -------------------------------- ### Run pre-commit hooks Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Executes all configured 'pre-commit' hooks on all files in the repository. This is a crucial step to ensure code quality and consistency before committing. ```shell uv run pre-commit run --all-files ``` -------------------------------- ### Run All Unit Tests with Pytest Source: https://github.com/tonkintaylor/templafy/blob/master/tests/AGENTS.md Executes all unit tests in the tests directory using pytest. Useful for a comprehensive test run. ```bash python -m pytest tests/ -v ``` -------------------------------- ### Run Pytest test suite Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Executes the project's test suite using 'pytest'. This is essential for verifying code functionality and catching regressions. ```shell uv run python -m pytest tests/ -v ``` ```shell python -m pytest tests/ -v ``` -------------------------------- ### Search for TODO comments Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Searches the codebase for 'TODO' comments or their variants using 'git grep'. This is part of a policy to avoid 'TODO' comments and encourage GitHub issue referencing. ```shell git grep -n -E '\bT[O0]\s?DO\b|@todo' || true ``` -------------------------------- ### Auto-format code with ruff Source: https://github.com/tonkintaylor/templafy/blob/master/AGENTS.md Applies code formatting using 'ruff format'. This is an optional step to speed up the commit process by pre-formatting files. ```shell uv run ruff format . ``` -------------------------------- ### Export Project Dependencies with UV Source: https://github.com/tonkintaylor/templafy/blob/master/requirements.txt This command exports the project's dependencies to a requirements.txt file. The --frozen and --offline flags ensure that exact versions are used and no network requests are made, respectively. The -o=requirements.txt flag specifies the output file name. ```bash uv export --frozen --offline --no-default-groups -o=requirements.txt -e . annotated-types==0.7.0 \ --hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \ --hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89 # via pydantic anyio==4.10.0 \ --hash=sha256:3f3fae35c96039744587aa5b8371e7e8e603c0702999535961dd336026973ba6 \ --hash=sha256:60e474ac86736bbfd6f210f7a61218939c318f43f9972497381f1c5e930ed3d1 # via httpx certifi==2025.7.14 \ --hash=sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2 \ --hash=sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995 # via # httpcore # httpx exceptiongroup==1.3.0 ; python_full_version < '3.11' \ --hash=sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10 \ --hash=sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88 # via anyio h11==0.16.0 \ --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 # via httpcore httpcore==1.0.9 \ --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 \ --hash=sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8 # via httpx httpx==0.28.1 \ --hash=sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc \ --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad # via templafy idna==3.10 \ --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 # via # anyio # httpx pydantic==2.11.7 \ --hash=sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db \ --hash=sha256:dde5df002701f6de26248661f6835bbe296a47bf73990135c7d07ce741b9623b # via templafy pydantic-core==2.33.2 \ --hash=sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d \ --hash=sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac \ --hash=sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02 \ --hash=sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56 \ --hash=sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22 \ --hash=sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef \ --hash=sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec \ --hash=sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d \ --hash=sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a \ --hash=sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f \ --hash=sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052 \ --hash=sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab \ --hash=sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916 \ --hash=sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c \ --hash=sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf \ --hash=sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a \ --hash=sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8 \ --hash=sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7 \ --hash=sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612 \ --hash=sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1 \ --hash=sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7 \ --hash=sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a \ --hash=sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b \ --hash=sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7 \ --hash=sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025 \ --hash=sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849 \ --hash=sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b \ --hash=sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa \ --hash=sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e \ --hash=sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea \ --hash=sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac \ --hash=sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51 \ --hash=sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e \ --hash=sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162 \ --hash=sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65 ``` -------------------------------- ### Use httpx.codes for HTTP Status Codes Source: https://github.com/tonkintaylor/templafy/blob/master/src/templafy/AGENTS.md When communicating with APIs using httpx, utilize constants from the `httpx.codes` module for HTTP status codes instead of hardcoding them. This promotes consistency and readability. ```python from httpx import codes # Instead of: response = httpx.get(url, status_code=200) response = httpx.get(url) assert response.status_code == codes.OK ``` -------------------------------- ### Run Specific Unit Tests with Pytest Source: https://github.com/tonkintaylor/templafy/blob/master/tests/AGENTS.md Executes unit tests for a specific file within the tests directory using pytest. Ensures focus on recently modified code. ```bash .\venv\Scripts\activate; python -m pytest tests/path/to/test_file.py -v ``` -------------------------------- ### Correct Internal Module Imports Source: https://github.com/tonkintaylor/templafy/blob/master/src/templafy/AGENTS.md When importing internal modules within the templafy project, exclude the 'src' folder from the import path. The project structure in `pyproject.toml` already accounts for this. ```python # Correct import from templafy.auth import login # Incorrect import (do not include 'src') # from src.templafy.auth import login ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.