Skip to content

Commit bcc1ed8

Browse files
committed
Release v0.1.0
1 parent b5f1bdc commit bcc1ed8

File tree

9 files changed

+421
-0
lines changed

9 files changed

+421
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
name: 'Package - Build'
3+
run-name: 'Package: Build from ${{github.ref}}'
4+
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
paths:
10+
- 'pkg/pyproject.toml'
11+
12+
jobs:
13+
14+
publish-pypi:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
18+
environment:
19+
name: PyPI
20+
steps:
21+
- name: 'Checkout repository from ${{github.ref}}'
22+
uses: actions/checkout@v4
23+
24+
- name: 'Build sdist'
25+
run: |
26+
cd pkg
27+
pipx run build --sdist --wheel --outdir dist/
28+
29+
- name: 'Upload package'
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
# https://github.com/marketplace/actions/pypi-publish
32+
with:
33+
packages-dir: pkg/dist
34+
verify-metadata: false
35+
verbose: true
36+
print-hash: true
37+
skip-existing: false
38+
39+
publish-testpypi:
40+
runs-on: ubuntu-latest
41+
permissions:
42+
id-token: write
43+
environment:
44+
name: TestPyPI
45+
steps:
46+
- name: 'Checkout repository from ${{github.ref}}'
47+
uses: actions/checkout@v4
48+
49+
- name: 'Build sdist'
50+
run: |
51+
cd pkg
52+
pipx run build --sdist --wheel --outdir dist/
53+
54+
- name: 'Upload package'
55+
uses: pypa/gh-action-pypi-publish@release/v1
56+
# https://github.com/marketplace/actions/pypi-publish
57+
with:
58+
packages-dir: pkg/dist
59+
repository-url: https://test.pypi.org/legacy/
60+
verify-metadata: false
61+
verbose: true
62+
print-hash: true
63+
skip-existing: false

.gitignore

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Ref: https://github.com/github/gitignore
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
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+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/website/_build/
73+
docs/website/source/api/_autosummary
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
.python-version
88+
89+
# Celery stuff
90+
celerybeat-schedule
91+
celerybeat.pid
92+
93+
# SageMath parsed files
94+
*.sage.py
95+
96+
# Environments
97+
.env
98+
.venv
99+
env/
100+
venv/
101+
ENV/
102+
env.bak/
103+
venv.bak/
104+
105+
# Spyder project settings
106+
.spyderproject
107+
.spyproject
108+
109+
# Rope project settings
110+
.ropeproject
111+
112+
# mkdocs documentation
113+
/site
114+
115+
# mypy
116+
.mypy_cache/
117+
.dmypy.json
118+
dmypy.json
119+
120+
# Pyre type checker
121+
# There are reports this comes from LLVM profiling, but also Xcode 9.
122+
.pyre/
123+
124+
# pytype static type analyzer
125+
.pytype/
126+
127+
# Cython debug symbols
128+
cython_debug/
129+
130+
# profraw files from LLVM? Unclear exactly what triggers this
131+
# There are reports this comes from LLVM profiling, but also Xcode 9.
132+
*profraw
133+
134+
# In-tree generated files
135+
*/_version.py
136+
137+
# VSCode
138+
.vscode/
139+
140+
# PyCharm
141+
.idea/
142+
143+
# MacOS system files
144+
.DS_Store
145+
146+
# PyPackIT
147+
data/_local_reports/
148+
data/_cache/
149+
!/dev/build/

pkg/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
graft src/pycacheman

pkg/pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "versioningit"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
# ----------------------------------------- setuptools -------------------------------------------
7+
[tool.setuptools]
8+
include-package-data = true
9+
zip-safe = false
10+
11+
[tool.setuptools.packages.find]
12+
where = ["src"]
13+
namespaces = true
14+
15+
16+
# ----------------------------------------- Project Metadata -------------------------------------
17+
[project]
18+
version = "0.1.0"
19+
name = "PyCacheMan"
20+
requires-python = ">=3.10"
21+
dependencies = [
22+
"loggerman >=0.1,<0.2",
23+
"mdit >=0.1,<0.2",
24+
"pkgdata >=0.1,<0.2",
25+
"pyserials >=0.1,<0.2",
26+
]

pkg/src/pycacheman/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"""PyCacheMan"""
2+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$schema: https://json-schema.org/draft/2020-12/schema
2+
title: Serializable Cache
3+
description: |
4+
Cached data that can be serialized to a file.
5+
type: object
6+
additionalProperties:
7+
title: Cache Category
8+
description: A group of cached data with a common retention time.
9+
type: object
10+
additionalProperties:
11+
title: Cached Datapoint
12+
description: |
13+
A specific cached data within the group.
14+
type: object
15+
required: [ timestamp, data ]
16+
additionalProperties: false
17+
properties:
18+
timestamp:
19+
description: Timestamp of the last update.
20+
type: string
21+
data:
22+
description: Cached data.

pkg/src/pycacheman/exception.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Exceptions raised by PyCacheMan."""
2+
3+
4+
class PyCacheManError(Exception):
5+
"""Base class for all exceptions raised by PyCacheMan."""
6+
def __init__(self, message: str):
7+
super().__init__(message)
8+
self.message = message
9+
return

pkg/src/pycacheman/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)