Skip to content

Commit 3172c02

Browse files
feat(pychecksumcache): init repository
0 parents  commit 3172c02

24 files changed

+1720
-0
lines changed

.github/actions/test/action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run Tests
2+
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Checkout code
7+
uses: actions/checkout@v4
8+
with:
9+
fetch-depth: 10
10+
- name: Set up Python
11+
uses: actions/setup-python@v5
12+
with:
13+
python-version: ${{ matrix.python-version }}
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v2
16+
- name: Use uv with Python version
17+
run: uv venv --python ${{ matrix.python-version }}
18+
shell: bash
19+
- name: Install dependencies
20+
run: make install
21+
shell: bash
22+
- name: Build
23+
env:
24+
VERSION: 0.0.1
25+
run: make build
26+
shell: bash
27+
- name: Run tests
28+
run: |
29+
make test
30+
shell: bash
31+
env:
32+
PYTHON_VERSION: ${{ matrix.python-version }}

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 10
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.13'
22+
- name: Extract version from tag
23+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
- name: Use uv with Python version
27+
run: uv venv --python 3.13
28+
- run: make install
29+
- run: make build
30+
- run: |
31+
source .venv/bin/activate
32+
sudo echo "172.17.0.1 host.docker.internal" | sudo tee -a /etc/hosts
33+
ping -c 2 host.docker.internal
34+
35+
make test
36+
- name: mint API token
37+
id: mint-token
38+
run: |
39+
# retrieve the ambient OIDC token
40+
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
41+
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
42+
oidc_token=$(jq -r '.value' <<< "${resp}")
43+
44+
# exchange the OIDC token for an API token
45+
resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
46+
api_token=$(jq -r '.token' <<< "${resp}")
47+
48+
# mask the newly minted API token, so that we don't accidentally leak it
49+
echo "::add-mask::${api_token}"
50+
51+
# see the next step in the workflow for an example of using this step output
52+
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
53+
- name: publish
54+
# gh-action-pypi-publish uses TWINE_PASSWORD automatically
55+
uses: pypa/gh-action-pypi-publish@release/v1
56+
with:
57+
password: ${{ steps.mint-token.outputs.api-token }}
58+

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch:
11+
12+
13+
jobs:
14+
15+
test-ubuntu:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.ref }}
24+
- uses: ./.github/actions/test

.github/workflows/update-deps.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Update PYTHON Dependencies
2+
3+
on:
4+
schedule:
5+
- cron: '0 7 * * *' # Runs every day at 7:00 AM
6+
workflow_dispatch: # Allows manual triggering of the workflow
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update-deps:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.13
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
- name: Use uv with Python version
27+
run: uv venv --python 3.13
28+
29+
# - name: Install dependencies
30+
# run: make install
31+
32+
- name: Save check dependencies output (before)
33+
id: check_deps_before
34+
run: |
35+
BEFORE=$(make check-deps) || true
36+
echo "BEFORE=${BEFORE}"
37+
38+
echo "BEFORE<<EOF" >> $GITHUB_ENV
39+
echo "$BEFORE" >> $GITHUB_ENV
40+
echo "EOF" >> $GITHUB_ENV
41+
42+
43+
- name: Run make update
44+
run: make update
45+
46+
- name: Run make check dependencies (after)
47+
id: check_deps_after
48+
run: |
49+
after=$(make check-deps) || true
50+
echo "AFTER=${AFTER}"
51+
52+
echo "AFTER<<EOF" >> $GITHUB_ENV
53+
echo "$AFTER" >> $GITHUB_ENV
54+
echo "EOF" >> $GITHUB_ENV
55+
56+
- name: Create or Update Pull Request
57+
uses: peter-evans/create-pull-request@v7
58+
with:
59+
title: 'chore(deps): update python dependencies'
60+
body: |
61+
Automated update of uv.lock
62+
63+
**Before:**
64+
${{env.BEFORE}}
65+
66+
**After:**
67+
${{env.AFTER}}
68+
base: main
69+
branch: update-python-dependencies
70+

.gitignore

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
/.idea/*
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+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
# .python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# poetry
100+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
101+
# This is especially recommended for binary packages to ensure reproducibility, and is more
102+
# commonly ignored for libraries.
103+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
104+
#poetry.lock
105+
106+
# pdm
107+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
108+
#pdm.lock
109+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
110+
# in version control.
111+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
112+
.pdm.toml
113+
.pdm-python
114+
.pdm-build/
115+
116+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117+
__pypackages__/
118+
119+
# Celery stuff
120+
celerybeat-schedule
121+
celerybeat.pid
122+
123+
# SageMath parsed files
124+
*.sage.py
125+
126+
# Environments
127+
.env
128+
.venv
129+
env/
130+
venv/
131+
ENV/
132+
env.bak/
133+
venv.bak/
134+
135+
# Spyder project settings
136+
.spyderproject
137+
.spyproject
138+
139+
# Rope project settings
140+
.ropeproject
141+
142+
# mkdocs documentation
143+
/site
144+
145+
# mypy
146+
.mypy_cache/
147+
.dmypy.json
148+
dmypy.json
149+
150+
# Pyre type checker
151+
.pyre/
152+
153+
# pytype static type analyzer
154+
.pytype/
155+
156+
# Cython debug symbols
157+
cython_debug/
158+
159+
# PyCharm
160+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162+
# and can be added to the global gitignore or merged into this file. For a more nuclear
163+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
164+
#.idea/
165+
166+
.terraform/
167+
*.tfstate
168+
.terraform.lock.hcl

.python-version

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

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 pychecksumcache
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.

0 commit comments

Comments
 (0)