Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .codespellignore
Empty file.
13 changes: 13 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"cookiecutter": {
"_checkout": null,
"_output_dir": "/Users/c0fec0de/projects",
"_repo_dir": "/Users/c0fec0de/.cookiecutters/python-template",
"_template": "gh:nbiotcloud/python-template",
"name": "anycache",
"snake_name": "anycache",
"title": "Cache any python object to file using improved pickling",
"user": "c0fec0de",
"year": "2017"
}
}
58 changes: 28 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,64 @@
name: test
name: main
on: [push, pull_request, release]
jobs:
build:
name: Continuous Integration
runs-on: ubuntu-latest
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Install uv and set the python version
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
version: "0.6.9"
python-version: ${{ matrix.python-version }}
version: "0.5.15"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: all
- name: Run all
run: make all
- name: Upload coverage data to coveralls.io
run: |
pip3 install --upgrade coveralls
coveralls --service=github
run: uv run --frozen -- coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true

coveralls:
name: Indicate completion to coveralls.io
needs: build
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
version: "0.6.9"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Upload coverage data to coveralls.io
run: uv run --frozen -- coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
if: github.event_name == 'push' && github.ref_type == 'tag'
name: Upload release to PyPI
needs: coveralls
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
version: "0.5.15"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: build
run: uv build
- name: publish
run: uv publish
- uses: pdm-project/setup-pdm@v4
- name: Publish package distributions to PyPI
run: pdm publish
25 changes: 13 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
*.egg-info/
*.xml
.*_cache/
.coverage*
.tox
.venv
.mypy_cache
/.vscode
__pycache__
build
.DS_Store
.hypothesis
.nox/
.pdm-python
.test2ref
.venv*
*.egg-info
*.pyc
build/
dist/
docs/_readthedocs/
poetry.lock
setup.py
.python-version
docs.zip
report.xml
site/
55 changes: 34 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.2
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-xml
- id: debug-statements
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.5.8

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: uv-lock
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.6
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/google/yamlfmt
rev: v0.10.0
- id: remove-tabs
args: [--whitespaces-count, "2"] # defaults to: 4
- id: insert-license
files: \.py$
args:
- --license-filepath
- LICENSE
- --use-current-year

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: yamlfmt
- id: codespell
args:
- "--write-changes"
- "--ignore-words=.codespellignore"
additional_dependencies:
- tomli
exclude: '^uv\.lock$'
11 changes: 7 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"

commands:
- pip install --upgrade --no-cache-dir pip
- pip install --no-cache-dir "uv==0.5.15"
- uv run make html -C docs
- cp -r docs/build _readthedocs
- pip install --no-cache-dir uv
- make doc
- mkdir _readthedocs
- cp -r site _readthedocs/html
56 changes: 39 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,56 @@
# Contribute
# CONTRIBUTING

## Testing
Please follow github workflow. Create a ticket and/or branch. Create a pull-request.

### Create Environment
## Local Development

Run these commands just the first time:
### Installation

```bash
# Ensure python3 is installed
python3 -m venv .venv
source .venv/bin/activate
pip install uv
```
Please install these tools:

* [`uv` Installation](https://docs.astral.sh/uv/getting-started/installation/)
* [`make`](https://www.gnu.org/software/make/)
* [`git`](https://git-scm.com/)
* [Visual Studio Code](https://code.visualstudio.com/)

### Enter Environment

Run this command once you open a new shell:
### Editor

Start Visual Studio Code:

```bash
source .venv/bin/activate
make code
```

### Test Your Changes
### Testing

Run auto-formatting, linting, tests and documentation build:

```bash
make all
```

### Release
See `make help` for any further details.


## Project Structure

The project contains these files and directories:

| File/Directory | Description |
|---|---|
| `src/` | Python Package Sources - the files this is all about |
| `pyproject.toml` | Python Package Meta File. Also contains all tool settings |
| `.gitignore` | Lists of files and directories ignored by version control system |
| `.github/` | Github Settings |
| `.readthedocs.yaml` | Documentation Server Configuration |
| `.pre-commit-config.yaml` | Pre-Commit Check Configuration |
| `uv.lock` | File with resolved python package dependencies |

Create release via
Next to that, there are some temporary files ignored by version control system.

https://github.com/c0fec0de/anycache/releases/new
| File/Directory | Description |
|---|---|
| `htmlcov/` | Test Execution Code Coverage Report in HTML format |
| `report.xml` | Test Execution Report |
| `.venv` | Virtual Environments |
Loading