Skip to content

Commit c5ee0a2

Browse files
authored
Merge pull request #1 from TechPrismatica/feature/mem-db-init
Feature/mem db init
2 parents 6fdf23b + bf9524f commit c5ee0a2

15 files changed

Lines changed: 1402 additions & 0 deletions

.github/workflows/linter.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Linter
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Lint
12+
uses: chartboost/ruff-action@v1
13+
- name: Check Format
14+
uses: chartboost/ruff-action@v1
15+
with:
16+
args: 'format --check'
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Publish Package
2+
3+
on:
4+
push:
5+
tags: ['*']
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
name: Build and Publish Package
11+
if: startsWith(github.ref, 'refs/tags/')
12+
13+
steps:
14+
- name: Check out the code
15+
uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
20+
- name: Install dependencies
21+
run: pip install twine build
22+
- name: Build the package
23+
run: python -m build
24+
- name: Upload package to artifact
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: python-package-distributions
28+
path: dist/
29+
- name: Add PyPI Config
30+
run: echo ${{ secrets.PYRC_CONFIG }} | base64 -d > ~/.pypirc
31+
- name: Publish package to PyPI
32+
run: twine upload --repository forwarder dist/*
33+
34+
sign-release:
35+
runs-on: ubuntu-latest
36+
name: Sign and Release the Package to GitHub
37+
needs: build-and-publish
38+
39+
permissions:
40+
contents: write
41+
id-token: write
42+
43+
steps:
44+
- name: Download the package distributions
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Sign the dists with Sigstore
50+
uses: sigstore/gh-action-sigstore-python@v3.0.0
51+
with:
52+
inputs:
53+
./dist/*.tar.gz
54+
./dist/*.whl
55+
- name: Create GitHub Release
56+
env:
57+
GITHUB_TOKEN: ${{ github.token }}
58+
run: gh release create '${{ github.ref_name }}' --repo '${{ github.repository }}' --generate-notes
59+
- name: Upload artifact signatures to GitHub Release
60+
env:
61+
GITHUB_TOKEN: ${{ github.token }}
62+
run: gh release upload '${{ github.ref_name }}' --repo '${{ github.repository }}' dist/**

.gitignore

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Python template
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
/.idea
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
pip-wheel-metadata/
26+
share/python-wheels/
27+
*.egg-info/
28+
.installed.cfg
29+
*.egg
30+
MANIFEST
31+
32+
# PyInstaller
33+
# Usually these files are written by a python script from a template
34+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
35+
*.manifest
36+
*.spec
37+
38+
# Installer logs
39+
pip-log.txt
40+
pip-delete-this-directory.txt
41+
42+
# Unit test / coverage reports
43+
htmlcov/
44+
.tox/
45+
.nox/
46+
.coverage
47+
.coverage.*
48+
.cache
49+
nosetests.xml
50+
coverage.xml
51+
*.cover
52+
.hypothesis/
53+
.pytest_cache/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
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+
# celery beat schedule file
96+
celerybeat-schedule
97+
98+
# SageMath parsed files
99+
*.sage.py
100+
101+
# Environments
102+
.env
103+
.venv
104+
env/
105+
venv/
106+
ENV/
107+
env.bak/
108+
venv.bak/
109+
110+
# Spyder project settings
111+
.spyderproject
112+
.spyproject
113+
114+
# Rope project settings
115+
.ropeproject
116+
117+
# mkdocs documentation
118+
/site
119+
120+
# mypy
121+
.mypy_cache/
122+
.dmypy.json
123+
dmypy.json
124+
125+
# Pyre type checker
126+
.pyre/
127+
128+
.vscode/settings.json
129+
.vscode
130+
131+
data
132+
.env
133+
assets
134+
__pycache__

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: requirements-txt-fixer
8+
- repo: https://github.com/charliermarsh/ruff-pre-commit
9+
rev: v0.13.0
10+
hooks:
11+
- id: ruff
12+
args:
13+
- --fix
14+
- id: ruff-format

.python-version

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

pyproject.toml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[project]
2+
name = "mem-db-utils"
3+
version = "0.1.0"
4+
description = "Python package for in memory database to be used for cache, fast-access storages."
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"pydantic>=2.11.7",
9+
"pydantic-settings>=2.10.1",
10+
"python-dotenv>=1.1.1",
11+
"redis>=6.2.0",
12+
]
13+
authors = [{ name = "Faizan Azim", email = "faizanazim11@gmail.com" }]
14+
15+
[[tool.uv.index]]
16+
name = "prismatica-pypi"
17+
url = "https://readUser:hh(iBaf71$icV63@pypi.prismatica.in/simple"
18+
19+
[build-system]
20+
requires = ["uv_build>=0.8.0,<0.9"]
21+
build-backend = "uv_build"
22+
23+
[dependency-groups]
24+
dev = [
25+
"coverage>=7.10.2",
26+
"pre-commit>=4.2.0",
27+
"pytest>=8.4.1",
28+
"pytest-cov>=6.2.1",
29+
"pytest-dotenv>=0.5.2",
30+
]
31+
32+
[tool.pytest.ini_options]
33+
pythonpath = ["src", "."]
34+
env_files = [".env"]
35+
36+
[tool.ruff]
37+
lint.select = [
38+
"E", # pycodestyle errors
39+
"W", # pycodestyle warnings
40+
"F", # pyflakes
41+
"I", # isort
42+
"C", # flake8-comprehensions
43+
"B", # flake8-bugbear
44+
]
45+
lint.ignore = [
46+
# "E501", # line too long, handled by black
47+
"B008", # do not perform function calls in argument defaults
48+
"C901", # too complex
49+
"E402",
50+
"B904",
51+
"B905",
52+
"B009",
53+
"C417",
54+
55+
]
56+
line-length = 120
57+
target-version = "py312"
58+
59+
[tool.ruff.lint.per-file-ignores]
60+
"__init__.py" = ["F401"]
61+
62+
[tool.ruff.lint.pyupgrade]
63+
keep-runtime-typing = true
64+
65+
[tool.coverage.report]
66+
precision = 2
67+
fail_under = 50
68+
show_missing = true
69+
skip_covered = true
70+
exclude_lines = [
71+
"pragma: no cover",
72+
"pragma: nocover",
73+
"if TYPE_CHECKING:",
74+
"if typing.TYPE_CHECKING:",
75+
"raise NotImplementedError",
76+
]
77+
78+
[tool.coverage.run]
79+
omit = [
80+
"*/tests/*",
81+
"*/src/constants/*",
82+
"*/src/db/*",
83+
"app.py",
84+
"main.py",
85+
]

0 commit comments

Comments
 (0)