nix-base32 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nix_base32-0.4.2/.envrc +11 -0
- nix_base32-0.4.2/.github/dependabot.yml +8 -0
- nix_base32-0.4.2/.github/workflows/ci.yml +62 -0
- nix_base32-0.4.2/.github/workflows/tag-release.yml +119 -0
- nix_base32-0.4.2/.gitignore +210 -0
- nix_base32-0.4.2/.ruff.toml +107 -0
- nix_base32-0.4.2/DEVELOPMENT.md +36 -0
- nix_base32-0.4.2/LICENSE +21 -0
- nix_base32-0.4.2/PKG-INFO +94 -0
- nix_base32-0.4.2/README.md +55 -0
- nix_base32-0.4.2/pyproject.toml +77 -0
- nix_base32-0.4.2/src/base32/__init__.py +47 -0
- nix_base32-0.4.2/src/base32/cli/__init__.py +32 -0
- nix_base32-0.4.2/src/base32/cli/__main__.py +9 -0
- nix_base32-0.4.2/src/base32/cli/io.py +26 -0
- nix_base32-0.4.2/src/base32/cli/ops.py +100 -0
- nix_base32-0.4.2/src/base32/decode.py +148 -0
- nix_base32-0.4.2/src/base32/detail/__init__.py +32 -0
- nix_base32-0.4.2/src/base32/detail/lengths.py +58 -0
- nix_base32-0.4.2/src/base32/detail/reverse_lookup.py +71 -0
- nix_base32-0.4.2/src/base32/detail/types.py +54 -0
- nix_base32-0.4.2/src/base32/encode.py +136 -0
- nix_base32-0.4.2/tests/conftest.py +35 -0
- nix_base32-0.4.2/tests/test_cli.py +290 -0
- nix_base32-0.4.2/tests/test_encode_decode.py +82 -0
- nix_base32-0.4.2/tests/test_lengths.py +23 -0
- nix_base32-0.4.2/tests/test_reverse_lookup.py +27 -0
- nix_base32-0.4.2/tests/test_streaming.py +227 -0
- nix_base32-0.4.2/tests/test_types.py +103 -0
- nix_base32-0.4.2/uv.lock +281 -0
nix_base32-0.4.2/.envrc
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- "**"
|
|
10
|
+
workflow_call:
|
|
11
|
+
|
|
12
|
+
permissions: {}
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
# github.workflow names the caller during workflow_call; keep this group distinct.
|
|
16
|
+
group: ci-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: true
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
checks:
|
|
21
|
+
name: Checks
|
|
22
|
+
runs-on: ubuntu-24.04
|
|
23
|
+
permissions:
|
|
24
|
+
contents: read
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout repository
|
|
28
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.14"
|
|
36
|
+
|
|
37
|
+
- name: Set up uv
|
|
38
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
39
|
+
|
|
40
|
+
- name: Sync dependencies
|
|
41
|
+
run: uv sync --locked
|
|
42
|
+
|
|
43
|
+
- name: Run checks
|
|
44
|
+
run: uv run --locked poe check
|
|
45
|
+
|
|
46
|
+
- name: Run tests
|
|
47
|
+
run: uv run --locked poe test
|
|
48
|
+
|
|
49
|
+
zizmor:
|
|
50
|
+
name: zizmor
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
permissions:
|
|
53
|
+
contents: read
|
|
54
|
+
security-events: write # Upload zizmor SARIF results
|
|
55
|
+
steps:
|
|
56
|
+
- name: Checkout repository
|
|
57
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
58
|
+
with:
|
|
59
|
+
persist-credentials: false
|
|
60
|
+
|
|
61
|
+
- name: Run zizmor
|
|
62
|
+
uses: its-me/action.zizmor@ff06ae628ae4304e6d711c1c61c761b9d097c96e # v1.0.1
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
name: Tag Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
env:
|
|
16
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
validate:
|
|
20
|
+
name: Validate release
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
security-events: write # Upload zizmor SARIF results
|
|
24
|
+
uses: ./.github/workflows/ci.yml
|
|
25
|
+
|
|
26
|
+
build:
|
|
27
|
+
name: Build (sdist + wheel)
|
|
28
|
+
needs: [validate]
|
|
29
|
+
runs-on: ubuntu-24.04
|
|
30
|
+
permissions:
|
|
31
|
+
contents: read
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout repository
|
|
35
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
36
|
+
with:
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
persist-credentials: false
|
|
39
|
+
ref: ${{ env.RELEASE_TAG }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Python
|
|
42
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.14"
|
|
45
|
+
|
|
46
|
+
- name: Set up uv
|
|
47
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
48
|
+
with:
|
|
49
|
+
enable-cache: false
|
|
50
|
+
|
|
51
|
+
- name: Build sdist + wheel
|
|
52
|
+
run: uv build
|
|
53
|
+
|
|
54
|
+
- name: Upload dist artifacts
|
|
55
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
56
|
+
with:
|
|
57
|
+
name: dist
|
|
58
|
+
path: dist/*
|
|
59
|
+
|
|
60
|
+
publish-github:
|
|
61
|
+
name: Create GitHub Release
|
|
62
|
+
needs: [build]
|
|
63
|
+
runs-on: ubuntu-24.04
|
|
64
|
+
|
|
65
|
+
permissions:
|
|
66
|
+
contents: write # create and upload the release
|
|
67
|
+
|
|
68
|
+
steps:
|
|
69
|
+
- name: Download dist artifacts
|
|
70
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
71
|
+
with:
|
|
72
|
+
name: dist
|
|
73
|
+
path: dist
|
|
74
|
+
|
|
75
|
+
- name: Create GitHub Release
|
|
76
|
+
run: >-
|
|
77
|
+
gh release create "$RELEASE_TAG" dist/*
|
|
78
|
+
--repo "$GITHUB_REPOSITORY"
|
|
79
|
+
--title "$RELEASE_TAG"
|
|
80
|
+
--generate-notes
|
|
81
|
+
--latest
|
|
82
|
+
env:
|
|
83
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
84
|
+
|
|
85
|
+
publish-pypi:
|
|
86
|
+
name: Publish to PyPI
|
|
87
|
+
needs: [build]
|
|
88
|
+
runs-on: ubuntu-24.04
|
|
89
|
+
|
|
90
|
+
environment:
|
|
91
|
+
name: pypi
|
|
92
|
+
url: https://pypi.org/p/nix-base32
|
|
93
|
+
|
|
94
|
+
permissions:
|
|
95
|
+
id-token: write # Trusted Publishing and PEP 740 attestations
|
|
96
|
+
contents: read
|
|
97
|
+
|
|
98
|
+
steps:
|
|
99
|
+
- name: Download dist artifacts
|
|
100
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
101
|
+
with:
|
|
102
|
+
name: dist
|
|
103
|
+
path: dist
|
|
104
|
+
|
|
105
|
+
- name: Set up Python
|
|
106
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
107
|
+
with:
|
|
108
|
+
python-version: "3.14"
|
|
109
|
+
|
|
110
|
+
- name: Set up uv
|
|
111
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
112
|
+
with:
|
|
113
|
+
enable-cache: false
|
|
114
|
+
|
|
115
|
+
- name: Generate PEP 740 attestations
|
|
116
|
+
uses: astral-sh/attest-action@f589a42a7efb6fe400b4f400de60b4bc90390027 # v0.0.6
|
|
117
|
+
|
|
118
|
+
- name: Publish to PyPI
|
|
119
|
+
run: uv publish
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
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
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.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/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
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
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.venv
|
|
140
|
+
env/
|
|
141
|
+
venv/
|
|
142
|
+
ENV/
|
|
143
|
+
env.bak/
|
|
144
|
+
venv.bak/
|
|
145
|
+
|
|
146
|
+
# Spyder project settings
|
|
147
|
+
.spyderproject
|
|
148
|
+
.spyproject
|
|
149
|
+
|
|
150
|
+
# Rope project settings
|
|
151
|
+
.ropeproject
|
|
152
|
+
|
|
153
|
+
# mkdocs documentation
|
|
154
|
+
/site
|
|
155
|
+
|
|
156
|
+
# mypy
|
|
157
|
+
.mypy_cache/
|
|
158
|
+
.dmypy.json
|
|
159
|
+
dmypy.json
|
|
160
|
+
|
|
161
|
+
# Pyre type checker
|
|
162
|
+
.pyre/
|
|
163
|
+
|
|
164
|
+
# pytype static type analyzer
|
|
165
|
+
.pytype/
|
|
166
|
+
|
|
167
|
+
# Cython debug symbols
|
|
168
|
+
cython_debug/
|
|
169
|
+
|
|
170
|
+
# PyCharm
|
|
171
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
172
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
173
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
174
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
175
|
+
#.idea/
|
|
176
|
+
|
|
177
|
+
# Abstra
|
|
178
|
+
# Abstra is an AI-powered process automation framework.
|
|
179
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
180
|
+
# Learn more at https://abstra.io/docs
|
|
181
|
+
.abstra/
|
|
182
|
+
|
|
183
|
+
# Visual Studio Code
|
|
184
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
185
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
186
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
187
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
188
|
+
# .vscode/
|
|
189
|
+
|
|
190
|
+
# Ruff stuff:
|
|
191
|
+
.ruff_cache/
|
|
192
|
+
|
|
193
|
+
# PyPI configuration file
|
|
194
|
+
.pypirc
|
|
195
|
+
|
|
196
|
+
# Cursor
|
|
197
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
198
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
199
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
200
|
+
.cursorignore
|
|
201
|
+
.cursorindexingignore
|
|
202
|
+
|
|
203
|
+
# Marimo
|
|
204
|
+
marimo/_static/
|
|
205
|
+
marimo/_lsp/
|
|
206
|
+
__marimo__/
|
|
207
|
+
|
|
208
|
+
.DS_Store
|
|
209
|
+
/.python-version
|
|
210
|
+
/src/base32/_version.py
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Python version target for modernizations
|
|
2
|
+
target-version = "py314"
|
|
3
|
+
line-length = 100 # From upgrade/pyproject.toml
|
|
4
|
+
#indent-width = 2
|
|
5
|
+
respect-gitignore = true
|
|
6
|
+
|
|
7
|
+
# Files to exclude
|
|
8
|
+
exclude = [
|
|
9
|
+
".git",
|
|
10
|
+
"__pycache__",
|
|
11
|
+
".venv",
|
|
12
|
+
"build",
|
|
13
|
+
"dist",
|
|
14
|
+
"*.egg-info",
|
|
15
|
+
".pytest_cache",
|
|
16
|
+
".mypy_cache",
|
|
17
|
+
".ruff_cache",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[lint]
|
|
21
|
+
# Comprehensive rule selection combining modernization + code quality
|
|
22
|
+
select = [
|
|
23
|
+
# Core Python modernization (our priority)
|
|
24
|
+
"UP", # pyupgrade - modernize Python code for target version
|
|
25
|
+
"FA", # flake8-future-annotations - add future annotations import
|
|
26
|
+
"ANN204", # flake8-annotations - require return type for __init__
|
|
27
|
+
"TCH", # flake8-type-checking - move imports under TYPE_CHECKING
|
|
28
|
+
"PYI", # flake8-pyi - type stub files best practices
|
|
29
|
+
|
|
30
|
+
# Code quality from upgrade/pyproject.toml
|
|
31
|
+
"E", # pycodestyle errors
|
|
32
|
+
"W", # pycodestyle warnings
|
|
33
|
+
"F", # pyflakes
|
|
34
|
+
"I", # isort - import sorting
|
|
35
|
+
"N", # pep8-naming
|
|
36
|
+
"B", # flake8-bugbear
|
|
37
|
+
"C4", # flake8-comprehensions
|
|
38
|
+
"SIM", # flake8-simplify
|
|
39
|
+
"RUF", # ruff-specific rules
|
|
40
|
+
"PT", # flake8-pytest-style
|
|
41
|
+
"PIE", # flake8-pie
|
|
42
|
+
"COM", # flake8-commas
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
# Specific modernization rules to enforce
|
|
46
|
+
extend-select = [
|
|
47
|
+
# Python 3.10+ type hint modernization
|
|
48
|
+
"UP006", # Use `list` instead of `List` for type annotations
|
|
49
|
+
"UP007", # Use `X | Y` for union types instead of `Optional`
|
|
50
|
+
"UP035", # Import from collections.abc instead of typing
|
|
51
|
+
"UP037", # Remove quotes from annotations when possible
|
|
52
|
+
"UP040", # Type alias with TypeAlias annotation
|
|
53
|
+
|
|
54
|
+
# Future annotations
|
|
55
|
+
"FA100", # Add `from __future__ import annotations` when needed
|
|
56
|
+
"FA102", # Add `from __future__ import annotations` for PEP 604 unions
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
ignore = [
|
|
60
|
+
# From upgrade/pyproject.toml (preserve these)
|
|
61
|
+
"E501", # line too long (handled by formatter)
|
|
62
|
+
"B008", # do not perform function calls in argument defaults
|
|
63
|
+
"N818", # exception name should be named with an Error suffix
|
|
64
|
+
"COM812", # trailing comma missing (handled by formatter)
|
|
65
|
+
"S101", # security issues
|
|
66
|
+
"PT011", # pytest-style
|
|
67
|
+
|
|
68
|
+
# Avoid conflicts with modernization goals
|
|
69
|
+
"T201", # print found (keep prints for now)
|
|
70
|
+
"T20", # Remove T20 from select since we're ignoring T201
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
# Allow automatic fixes including unsafe ones
|
|
74
|
+
unfixable = []
|
|
75
|
+
|
|
76
|
+
# Per-file ignores
|
|
77
|
+
[lint.per-file-ignores]
|
|
78
|
+
"test_*.py" = ["T201"] # Allow print in tests
|
|
79
|
+
"*_test.py" = ["T201"] # Allow print in tests
|
|
80
|
+
|
|
81
|
+
[lint.pyupgrade]
|
|
82
|
+
# Use Python 3.10+ style type hints
|
|
83
|
+
keep-runtime-typing = false
|
|
84
|
+
|
|
85
|
+
[lint.flake8-annotations]
|
|
86
|
+
# Configuration for annotation rules
|
|
87
|
+
allow-star-arg-any = true
|
|
88
|
+
suppress-none-returning = false
|
|
89
|
+
mypy-init-return = true # Require -> None for __init__
|
|
90
|
+
|
|
91
|
+
[lint.isort]
|
|
92
|
+
# Import sorting configuration
|
|
93
|
+
force-single-line = false
|
|
94
|
+
length-sort-straight = true
|
|
95
|
+
|
|
96
|
+
[lint.flake8-bugbear]
|
|
97
|
+
# Allow common patterns
|
|
98
|
+
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query", "pydantic.Field"]
|
|
99
|
+
|
|
100
|
+
[format]
|
|
101
|
+
# Code formatting options
|
|
102
|
+
quote-style = "double"
|
|
103
|
+
indent-style = "space"
|
|
104
|
+
skip-magic-trailing-comma = false
|
|
105
|
+
line-ending = "auto"
|
|
106
|
+
docstring-code-format = true # Format code in docstrings
|
|
107
|
+
docstring-code-line-length = 88 # Shorter lines in docstrings
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
______________________________________________________________________
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
\[uv\](https://docs.astral.sh/uv/
|
|
8
|
+
|
|
9
|
+
______________________________________________________________________
|
|
10
|
+
|
|
11
|
+
## Linting and tests
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
uv sync
|
|
15
|
+
uv pip install .[cli]
|
|
16
|
+
poe fix # format and lint
|
|
17
|
+
poe test # run tests with coverage
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
______________________________________________________________________
|
|
21
|
+
|
|
22
|
+
## Publishing
|
|
23
|
+
|
|
24
|
+
1. Tag a release:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git tag v0.1.0
|
|
28
|
+
git push --tags
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. GitHub Actions will build using *uv‑dynamic‑versioning* and publish to PyPI if
|
|
32
|
+
`PYPI_API_TOKEN` is defined in repository secrets.
|
|
33
|
+
|
|
34
|
+
______________________________________________________________________
|
|
35
|
+
|
|
36
|
+
## TODO
|
nix_base32-0.4.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Peter A.
|
|
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,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nix-base32
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: Pure Python implementation of nix variant of base32
|
|
5
|
+
Author-email: "Peter A." <ink.splatters@pm.me>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Peter A.
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Classifier: Development Status :: 4 - Beta
|
|
29
|
+
Classifier: Intended Audience :: Developers
|
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
32
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
33
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
34
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
35
|
+
Requires-Python: >=3.14
|
|
36
|
+
Provides-Extra: cli
|
|
37
|
+
Requires-Dist: click>=8.3.0; extra == 'cli'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# nix‑base32
|
|
41
|
+
|
|
42
|
+
Pure‑Python implementation of the Nix‑specific base32 variant.
|
|
43
|
+
|
|
44
|
+
______________________________________________________________________
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv tool install 'nix-base32[cli] @ git+https://github.com/ink-splatters/nix-base32'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
______________________________________________________________________
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
### Python
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from base32 import encode, decode
|
|
60
|
+
|
|
61
|
+
data = b"hello"
|
|
62
|
+
encoded = encode(data)
|
|
63
|
+
print(encoded) # -> NixBase32Str('nbswy3dp')
|
|
64
|
+
print(decode(encoded)) # -> b'hello'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### CLI
|
|
68
|
+
|
|
69
|
+
the CLI was inspired by BSD bintrans' `base64` util (now part of standard macOS distribution).
|
|
70
|
+
|
|
71
|
+
_Examples:_
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
❯ echo de2fc4ce5252da49a272fb22e68c73dcfa12ef08077ac26b40ad3a40dd31376e | base32
|
|
75
|
+
0vip67fl0fmd81mw4yh713pi5ynwff6fc8pvfai4knjjab7c8byy
|
|
76
|
+
|
|
77
|
+
❯ echo 0vip67fl0fmd81mw4yh713pi5ynwff6fc8pvfai4knjjab7c8byy | base32 --sri
|
|
78
|
+
sha256-3i/EzlJS2kmicvsi5oxz3PoS7wgHesJrQK06QN0xN24=
|
|
79
|
+
|
|
80
|
+
❯ echo de2fc4ce5252da49a272fb22e68c73dcfa12ef08077ac26b40ad3a40dd31376e | base32 | base32 -d
|
|
81
|
+
de2fc4ce5252da49a272fb22e68c73dcfa12ef08077ac26b40ad3a40dd31376e
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
______________________________________________________________________
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT — see [LICENSE](LICENSE).
|
|
89
|
+
|
|
90
|
+
## Contributions
|
|
91
|
+
|
|
92
|
+
Contributions are welcome at the author's discretion; please open an issue first.
|
|
93
|
+
See any standard open collaborative code of conduct such as
|
|
94
|
+
[Contributor Covenant](https://www.contributor-covenant.org/).
|