Skip to content

Commit 118f17e

Browse files
committed
init commit
0 parents  commit 118f17e

34 files changed

+4688
-0
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.11', '3.12']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install uv
25+
run: |
26+
curl -LsSf https://astral.sh/uv/install.sh | sh
27+
echo "$HOME/.local/bin" >> $GITHUB_PATH
28+
29+
- name: Set up virtual environment
30+
run: |
31+
uv venv
32+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
33+
34+
- name: Install dependencies
35+
run: uv sync
36+
37+
- name: Run checks
38+
run: make check
39+
40+
- name: Run tests
41+
run: make test

.gitignore

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
cover/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
db.sqlite3-journal
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
.pybuilder/
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
# For a library or package, you might want to ignore these files since the code is
85+
# intended to run in multiple environments; otherwise, check them in:
86+
# .python-version
87+
88+
# pipenv
89+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
91+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
92+
# install all needed dependencies.
93+
#Pipfile.lock
94+
95+
# poetry
96+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
97+
# This is especially recommended for binary packages to ensure reproducibility, and is more
98+
# commonly ignored for libraries.
99+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
100+
#poetry.lock
101+
102+
# pdm
103+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
104+
#pdm.lock
105+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
106+
# in version control.
107+
# https://pdm.fming.dev/#use-with-ide
108+
.pdm.toml
109+
110+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
111+
__pypackages__/
112+
113+
# Celery stuff
114+
celerybeat-schedule
115+
celerybeat.pid
116+
117+
# SageMath parsed files
118+
*.sage.py
119+
120+
# Environments
121+
.env
122+
.venv
123+
env/
124+
venv/
125+
ENV/
126+
env.bak/
127+
venv.bak/
128+
129+
# Spyder project settings
130+
.spyderproject
131+
.spyproject
132+
133+
# Rope project settings
134+
.ropeproject
135+
136+
# mkdocs documentation
137+
/site
138+
139+
# mypy
140+
.mypy_cache/
141+
.dmypy.json
142+
dmypy.json
143+
144+
# Pyre type checker
145+
.pyre/
146+
147+
# pytype static type analyzer
148+
.pytype/
149+
150+
# Cython debug symbols
151+
cython_debug/
152+
153+
# IDEs
154+
.idea/
155+
.vscode/
156+
*.swp
157+
*.swo
158+
*~
159+
160+
# OS
161+
.DS_Store
162+
Thumbs.db
163+
164+
# uv
165+
.uv/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 [Your Name]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.PHONY: init format check requirements test clean build publish dev-install lint type-check
2+
3+
init:
4+
export PATH="$$HOME/.local/bin:$$PATH"
5+
wget -qO- https://astral.sh/uv/install.sh | sh
6+
uv venv
7+
. .venv/bin/activate
8+
uv sync
9+
uvx pyrefly init
10+
11+
dev-install:
12+
uv pip install -e ".[dev,redis]"
13+
14+
format:
15+
uvx ruff format .
16+
17+
check:
18+
uvx ruff check base_cacheable_class --fix; \
19+
uvx ty check base_cacheable_class; \
20+
uvx pyrefly check base_cacheable_class
21+
22+
lint:
23+
uvx ruff check base_cacheable_class --fix
24+
25+
requirements:
26+
uv export -o requirements.txt --without-hashes --without dev
27+
uv export -o requirements-dev.txt --without-hashes
28+
29+
test:
30+
uv run pytest tests/ -v
31+
32+
test-cov:
33+
uv run pytest tests/ -v --cov=src/base_cacheable_class --cov-report=term-missing
34+
35+
test-watch:
36+
uv run pytest-watch tests/ -v
37+
38+
clean:
39+
rm -rf build/
40+
rm -rf dist/
41+
rm -rf *.egg-info
42+
rm -rf src/*.egg-info
43+
find . -type d -name __pycache__ -exec rm -rf {} +
44+
find . -type f -name "*.pyc" -delete
45+
46+
build: clean
47+
uv build
48+
49+
publish-test: build
50+
uvx twine upload --repository testpypi dist/*
51+
52+
publish: build
53+
uvx twine upload dist/*

0 commit comments

Comments
 (0)