Skip to content

Commit d9dd752

Browse files
fix safety check and copilot instructions (#265)
* fix safety check and copilot instructions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove the safety check workflow --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 70572be commit d9dd752

3 files changed

Lines changed: 13 additions & 28 deletions

File tree

.github/copilot-instructions.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# GitHub Copilot Custom Instructions for Cachier
2+
3+
- Cachier is a Python package providing persistent, stale-free memoization decorators for Python functions, supporting local (pickle), cross-machine (MongoDB), and in-memory caching backends.
4+
- Always refer to the main decorator as `@cachier`, and note that it can be configured via parameters such as `stale_after`, `backend`, `mongetter`, `cache_dir`, `pickle_reload`, `separate_files`, `wait_for_calc_timeout`, and `allow_none`.
5+
- Arguments to cached functions must be hashable; custom hash functions can be provided via the `hash_func` parameter for unhashable arguments.
6+
- The default backend is pickle-based, storing cache files in `~/.cachier/` unless otherwise specified. MongoDB and memory backends are also supported.
7+
- Cachier is thread-safe and supports per-function cache clearing via the `clear_cache()` method on decorated functions.
8+
- Global configuration is possible via `set_default_params` and `enable_caching`/`disable_caching` functions.
9+
- When reviewing code, ensure new features or bugfixes maintain compatibility with Python 3.9+, preserve thread safety, and follow the numpy docstring conventions for documentation.
10+
- Tests are located in the `tests/` directory and should be run with `pytest`. MongoDB-related tests require either a mocked or live MongoDB instance.
11+
- When discussing or generating code, prefer concise, readable, and well-documented Python code, and follow the established conventions in the codebase and README.
12+
- For documentation, follow numpy docstring conventions and validate changes to `README.rst` with `python setup.py checkdocs`.

.github/workflows/safety.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Features
4444
========
4545

4646
* Pure Python.
47-
* Compatible with Python 3.8+ (Python 2.7 was discontinued in version 1.2.8).
47+
* Compatible with Python 3.9+ (Python 2.7 was discontinued in version 1.2.8).
4848
* Supported and `tested on Linux, OS X and Windows <https://travis-ci.org/shaypal5/cachier>`_.
4949
* A simple interface.
5050
* Defining "shelf life" for cached values.

0 commit comments

Comments
 (0)