picoconf 0.2.0__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.
- picoconf-0.2.0/.github/workflows/bump-version.yml +105 -0
- picoconf-0.2.0/.github/workflows/ci.yml +151 -0
- picoconf-0.2.0/.github/workflows/release.yml +140 -0
- picoconf-0.2.0/.gitignore +80 -0
- picoconf-0.2.0/.pre-commit-config.yaml +9 -0
- picoconf-0.2.0/Cargo.lock +292 -0
- picoconf-0.2.0/Cargo.toml +14 -0
- picoconf-0.2.0/LICENSE +3 -0
- picoconf-0.2.0/PKG-INFO +182 -0
- picoconf-0.2.0/README.md +153 -0
- picoconf-0.2.0/picoconf/__init__.py +3 -0
- picoconf-0.2.0/pyproject.toml +149 -0
- picoconf-0.2.0/src/lib.rs +9 -0
- picoconf-0.2.0/src/picoconf.rs +715 -0
- picoconf-0.2.0/tests/data/animals/dog.pconf +6 -0
- picoconf-0.2.0/tests/data/animals/elephant.pconf +5 -0
- picoconf-0.2.0/tests/data/animals/lion.pconf +5 -0
- picoconf-0.2.0/tests/data/animals/panda.pconf +5 -0
- picoconf-0.2.0/tests/data/animals/penguin.pconf +5 -0
- picoconf-0.2.0/tests/data/nested.pconf +9 -0
- picoconf-0.2.0/tests/data/simple.pconf +8 -0
- picoconf-0.2.0/tests/test_nanoconf.py +131 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
name: Bump Version and Create Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
release_type:
|
|
7
|
+
description: 'Release type'
|
|
8
|
+
required: true
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- patch
|
|
12
|
+
- minor
|
|
13
|
+
- major
|
|
14
|
+
release_name:
|
|
15
|
+
description: 'Short release title (optional)'
|
|
16
|
+
required: false
|
|
17
|
+
type: string
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: write
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
bump-and-release:
|
|
24
|
+
name: Bump version and create release
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
# Use PAT to trigger release workflow on tag push
|
|
31
|
+
# If using GITHUB_TOKEN, the release workflow won't trigger automatically
|
|
32
|
+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
|
33
|
+
|
|
34
|
+
- name: Set up Rust
|
|
35
|
+
uses: dtolnay/rust-toolchain@stable
|
|
36
|
+
|
|
37
|
+
- name: Parse current version
|
|
38
|
+
id: current_version
|
|
39
|
+
run: |
|
|
40
|
+
CURRENT_VERSION=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
|
41
|
+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
42
|
+
echo "Current version: $CURRENT_VERSION"
|
|
43
|
+
|
|
44
|
+
- name: Calculate new version
|
|
45
|
+
id: new_version
|
|
46
|
+
run: |
|
|
47
|
+
CURRENT="${{ steps.current_version.outputs.version }}"
|
|
48
|
+
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT"
|
|
49
|
+
MAJOR="${VERSION_PARTS[0]}"
|
|
50
|
+
MINOR="${VERSION_PARTS[1]}"
|
|
51
|
+
PATCH="${VERSION_PARTS[2]}"
|
|
52
|
+
|
|
53
|
+
case "${{ inputs.release_type }}" in
|
|
54
|
+
major)
|
|
55
|
+
MAJOR=$((MAJOR + 1))
|
|
56
|
+
MINOR=0
|
|
57
|
+
PATCH=0
|
|
58
|
+
;;
|
|
59
|
+
minor)
|
|
60
|
+
MINOR=$((MINOR + 1))
|
|
61
|
+
PATCH=0
|
|
62
|
+
;;
|
|
63
|
+
patch)
|
|
64
|
+
PATCH=$((PATCH + 1))
|
|
65
|
+
;;
|
|
66
|
+
esac
|
|
67
|
+
|
|
68
|
+
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
|
|
69
|
+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
70
|
+
echo "New version: $NEW_VERSION"
|
|
71
|
+
|
|
72
|
+
- name: Update Cargo.toml
|
|
73
|
+
run: |
|
|
74
|
+
sed -i 's/^version = ".*"/version = "${{ steps.new_version.outputs.version }}"/' Cargo.toml
|
|
75
|
+
cat Cargo.toml | grep -A 2 '\[package\]'
|
|
76
|
+
|
|
77
|
+
- name: Configure Git
|
|
78
|
+
run: |
|
|
79
|
+
git config user.name "github-actions[bot]"
|
|
80
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
81
|
+
|
|
82
|
+
- name: Commit version bump
|
|
83
|
+
run: |
|
|
84
|
+
git add Cargo.toml
|
|
85
|
+
git commit -m "Bump version to ${{ steps.new_version.outputs.version }}"
|
|
86
|
+
git push
|
|
87
|
+
|
|
88
|
+
- name: Create and push tag
|
|
89
|
+
run: |
|
|
90
|
+
git tag "v${{ steps.new_version.outputs.version }}"
|
|
91
|
+
git push origin "v${{ steps.new_version.outputs.version }}"
|
|
92
|
+
|
|
93
|
+
- name: Create GitHub Release
|
|
94
|
+
env:
|
|
95
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
96
|
+
run: |
|
|
97
|
+
RELEASE_NAME="${{ inputs.release_name }}"
|
|
98
|
+
if [ -z "$RELEASE_NAME" ]; then
|
|
99
|
+
RELEASE_NAME="v${{ steps.new_version.outputs.version }}"
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
gh release create "v${{ steps.new_version.outputs.version }}" \
|
|
103
|
+
--title "$RELEASE_NAME" \
|
|
104
|
+
--generate-notes \
|
|
105
|
+
--verify-tag
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '**.md'
|
|
8
|
+
- '.gitignore'
|
|
9
|
+
pull_request:
|
|
10
|
+
types: [opened, synchronize, reopened]
|
|
11
|
+
paths-ignore:
|
|
12
|
+
- '**.md'
|
|
13
|
+
- '.gitignore'
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
code-checks:
|
|
17
|
+
name: Code Quality Checks
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install Rust toolchain
|
|
23
|
+
uses: dtolnay/rust-toolchain@stable
|
|
24
|
+
with:
|
|
25
|
+
components: rustfmt, clippy
|
|
26
|
+
|
|
27
|
+
- name: Check formatting
|
|
28
|
+
run: cargo fmt --all -- --check
|
|
29
|
+
|
|
30
|
+
- name: Run clippy
|
|
31
|
+
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
32
|
+
|
|
33
|
+
- name: Set up Python
|
|
34
|
+
uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: '3.11'
|
|
37
|
+
|
|
38
|
+
- name: Run pre-commit checks
|
|
39
|
+
uses: pre-commit/action@v3.0.1
|
|
40
|
+
|
|
41
|
+
test-linux:
|
|
42
|
+
name: Test on Linux
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
needs: code-checks
|
|
45
|
+
strategy:
|
|
46
|
+
matrix:
|
|
47
|
+
python-version: ['3.11', '3.12', '3.13', '3.14']
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
52
|
+
uses: actions/setup-python@v5
|
|
53
|
+
with:
|
|
54
|
+
python-version: ${{ matrix.python-version }}
|
|
55
|
+
allow-prereleases: true
|
|
56
|
+
|
|
57
|
+
- name: Install Rust toolchain
|
|
58
|
+
uses: dtolnay/rust-toolchain@stable
|
|
59
|
+
|
|
60
|
+
- name: Build wheel
|
|
61
|
+
uses: PyO3/maturin-action@v1
|
|
62
|
+
with:
|
|
63
|
+
command: build
|
|
64
|
+
args: --release --out dist
|
|
65
|
+
|
|
66
|
+
- name: Install and test
|
|
67
|
+
run: |
|
|
68
|
+
pip install picoconf --find-links dist --force-reinstall
|
|
69
|
+
pip install pytest
|
|
70
|
+
pytest tests/ -v
|
|
71
|
+
|
|
72
|
+
- name: Upload wheels
|
|
73
|
+
uses: actions/upload-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: wheels-linux-${{ matrix.python-version }}
|
|
76
|
+
path: dist/*.whl
|
|
77
|
+
|
|
78
|
+
test-macos:
|
|
79
|
+
name: Test on macOS
|
|
80
|
+
runs-on: ${{ matrix.os }}
|
|
81
|
+
needs: code-checks
|
|
82
|
+
strategy:
|
|
83
|
+
matrix:
|
|
84
|
+
os: [macos-15, macos-14]
|
|
85
|
+
python-version: ['3.11', '3.12', '3.13', '3.14']
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v4
|
|
88
|
+
|
|
89
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
90
|
+
uses: actions/setup-python@v5
|
|
91
|
+
with:
|
|
92
|
+
python-version: ${{ matrix.python-version }}
|
|
93
|
+
allow-prereleases: true
|
|
94
|
+
|
|
95
|
+
- name: Install Rust toolchain
|
|
96
|
+
uses: dtolnay/rust-toolchain@stable
|
|
97
|
+
|
|
98
|
+
- name: Build wheel
|
|
99
|
+
uses: PyO3/maturin-action@v1
|
|
100
|
+
with:
|
|
101
|
+
command: build
|
|
102
|
+
args: --release --out dist
|
|
103
|
+
|
|
104
|
+
- name: Install and test
|
|
105
|
+
run: |
|
|
106
|
+
pip install picoconf --find-links dist --force-reinstall
|
|
107
|
+
pip install pytest
|
|
108
|
+
pytest tests/ -v
|
|
109
|
+
|
|
110
|
+
- name: Upload wheels
|
|
111
|
+
uses: actions/upload-artifact@v4
|
|
112
|
+
with:
|
|
113
|
+
name: wheels-macos-${{ matrix.os }}-${{ matrix.python-version }}
|
|
114
|
+
path: dist/*.whl
|
|
115
|
+
|
|
116
|
+
test-windows:
|
|
117
|
+
name: Test on Windows
|
|
118
|
+
runs-on: windows-latest
|
|
119
|
+
needs: code-checks
|
|
120
|
+
strategy:
|
|
121
|
+
matrix:
|
|
122
|
+
python-version: ['3.11', '3.12', '3.13', '3.14']
|
|
123
|
+
steps:
|
|
124
|
+
- uses: actions/checkout@v4
|
|
125
|
+
|
|
126
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
127
|
+
uses: actions/setup-python@v5
|
|
128
|
+
with:
|
|
129
|
+
python-version: ${{ matrix.python-version }}
|
|
130
|
+
allow-prereleases: true
|
|
131
|
+
|
|
132
|
+
- name: Install Rust toolchain
|
|
133
|
+
uses: dtolnay/rust-toolchain@stable
|
|
134
|
+
|
|
135
|
+
- name: Build wheel
|
|
136
|
+
uses: PyO3/maturin-action@v1
|
|
137
|
+
with:
|
|
138
|
+
command: build
|
|
139
|
+
args: --release --out dist
|
|
140
|
+
|
|
141
|
+
- name: Install and test
|
|
142
|
+
run: |
|
|
143
|
+
pip install picoconf --find-links dist --force-reinstall
|
|
144
|
+
pip install pytest
|
|
145
|
+
pytest tests/ -v
|
|
146
|
+
|
|
147
|
+
- name: Upload wheels
|
|
148
|
+
uses: actions/upload-artifact@v4
|
|
149
|
+
with:
|
|
150
|
+
name: wheels-windows-${{ matrix.python-version }}
|
|
151
|
+
path: dist/*.whl
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
attestations: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build-wheels-linux:
|
|
15
|
+
name: Build wheels for Linux
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
target: [x86_64, aarch64]
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Build wheels
|
|
24
|
+
uses: PyO3/maturin-action@v1
|
|
25
|
+
with:
|
|
26
|
+
target: ${{ matrix.target }}
|
|
27
|
+
args: --release --out dist --find-interpreter
|
|
28
|
+
sccache: 'true'
|
|
29
|
+
manylinux: auto
|
|
30
|
+
|
|
31
|
+
- name: Upload wheels
|
|
32
|
+
uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: wheels-linux-${{ matrix.target }}
|
|
35
|
+
path: dist
|
|
36
|
+
|
|
37
|
+
build-wheels-macos:
|
|
38
|
+
name: Build wheels for macOS
|
|
39
|
+
runs-on: ${{ matrix.os }}
|
|
40
|
+
strategy:
|
|
41
|
+
matrix:
|
|
42
|
+
include:
|
|
43
|
+
- os: macos-15
|
|
44
|
+
target: x86_64
|
|
45
|
+
- os: macos-14
|
|
46
|
+
target: aarch64
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@v4
|
|
49
|
+
|
|
50
|
+
- name: Build wheels
|
|
51
|
+
uses: PyO3/maturin-action@v1
|
|
52
|
+
with:
|
|
53
|
+
target: ${{ matrix.target }}
|
|
54
|
+
args: --release --out dist --find-interpreter
|
|
55
|
+
sccache: 'true'
|
|
56
|
+
|
|
57
|
+
- name: Upload wheels
|
|
58
|
+
uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: wheels-macos-${{ matrix.target }}
|
|
61
|
+
path: dist
|
|
62
|
+
|
|
63
|
+
build-wheels-windows:
|
|
64
|
+
name: Build wheels for Windows
|
|
65
|
+
runs-on: windows-latest
|
|
66
|
+
strategy:
|
|
67
|
+
matrix:
|
|
68
|
+
target: [x64]
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Build wheels
|
|
73
|
+
uses: PyO3/maturin-action@v1
|
|
74
|
+
with:
|
|
75
|
+
target: ${{ matrix.target }}
|
|
76
|
+
args: --release --out dist --find-interpreter
|
|
77
|
+
sccache: 'true'
|
|
78
|
+
|
|
79
|
+
- name: Upload wheels
|
|
80
|
+
uses: actions/upload-artifact@v4
|
|
81
|
+
with:
|
|
82
|
+
name: wheels-windows-${{ matrix.target }}
|
|
83
|
+
path: dist
|
|
84
|
+
|
|
85
|
+
build-sdist:
|
|
86
|
+
name: Build source distribution
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v4
|
|
90
|
+
|
|
91
|
+
- name: Build sdist
|
|
92
|
+
uses: PyO3/maturin-action@v1
|
|
93
|
+
with:
|
|
94
|
+
command: sdist
|
|
95
|
+
args: --out dist
|
|
96
|
+
|
|
97
|
+
- name: Upload sdist
|
|
98
|
+
uses: actions/upload-artifact@v4
|
|
99
|
+
with:
|
|
100
|
+
name: sdist
|
|
101
|
+
path: dist
|
|
102
|
+
|
|
103
|
+
publish:
|
|
104
|
+
name: Publish to PyPI
|
|
105
|
+
runs-on: ubuntu-latest
|
|
106
|
+
needs: [build-wheels-linux, build-wheels-macos, build-wheels-windows, build-sdist]
|
|
107
|
+
environment:
|
|
108
|
+
name: pypi
|
|
109
|
+
url: https://pypi.org/p/picoconf
|
|
110
|
+
steps:
|
|
111
|
+
- uses: actions/checkout@v4
|
|
112
|
+
|
|
113
|
+
- name: Download all artifacts
|
|
114
|
+
uses: actions/download-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
path: dist
|
|
117
|
+
pattern: wheels-*
|
|
118
|
+
merge-multiple: true
|
|
119
|
+
|
|
120
|
+
- name: Download sdist
|
|
121
|
+
uses: actions/download-artifact@v4
|
|
122
|
+
with:
|
|
123
|
+
name: sdist
|
|
124
|
+
path: dist
|
|
125
|
+
|
|
126
|
+
- name: List distribution files
|
|
127
|
+
run: ls -lh dist/
|
|
128
|
+
|
|
129
|
+
- name: Generate artifact attestation
|
|
130
|
+
uses: actions/attest-build-provenance@v2
|
|
131
|
+
with:
|
|
132
|
+
subject-path: 'dist/*'
|
|
133
|
+
|
|
134
|
+
- name: Publish to PyPI
|
|
135
|
+
uses: PyO3/maturin-action@v1
|
|
136
|
+
with:
|
|
137
|
+
command: upload
|
|
138
|
+
args: --non-interactive --skip-existing dist/*
|
|
139
|
+
env:
|
|
140
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Experimental
|
|
2
|
+
src/diy
|
|
3
|
+
|
|
4
|
+
# Rust
|
|
5
|
+
/target
|
|
6
|
+
Cargo.lock
|
|
7
|
+
|
|
8
|
+
# Byte-compiled / optimized / DLL files
|
|
9
|
+
__pycache__/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
|
|
13
|
+
# C extensions
|
|
14
|
+
*.so
|
|
15
|
+
|
|
16
|
+
# Distribution / packaging
|
|
17
|
+
.Python
|
|
18
|
+
.venv/
|
|
19
|
+
env/
|
|
20
|
+
bin/
|
|
21
|
+
build/
|
|
22
|
+
develop-eggs/
|
|
23
|
+
dist/
|
|
24
|
+
eggs/
|
|
25
|
+
lib/
|
|
26
|
+
lib64/
|
|
27
|
+
parts/
|
|
28
|
+
sdist/
|
|
29
|
+
var/
|
|
30
|
+
include/
|
|
31
|
+
man/
|
|
32
|
+
venv/
|
|
33
|
+
*.egg-info/
|
|
34
|
+
.installed.cfg
|
|
35
|
+
*.egg
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
pip-selfcheck.json
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.coverage
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
|
|
50
|
+
# Translations
|
|
51
|
+
*.mo
|
|
52
|
+
|
|
53
|
+
# Mr Developer
|
|
54
|
+
.mr.developer.cfg
|
|
55
|
+
.project
|
|
56
|
+
.pydevproject
|
|
57
|
+
|
|
58
|
+
# Rope
|
|
59
|
+
.ropeproject
|
|
60
|
+
|
|
61
|
+
# Django stuff:
|
|
62
|
+
*.log
|
|
63
|
+
*.pot
|
|
64
|
+
|
|
65
|
+
.DS_Store
|
|
66
|
+
|
|
67
|
+
# Sphinx documentation
|
|
68
|
+
docs/_build/
|
|
69
|
+
|
|
70
|
+
# PyCharm
|
|
71
|
+
.idea/
|
|
72
|
+
|
|
73
|
+
# VSCode
|
|
74
|
+
.vscode/
|
|
75
|
+
|
|
76
|
+
# Zed
|
|
77
|
+
.zed/
|
|
78
|
+
|
|
79
|
+
# Pyenv
|
|
80
|
+
.python-version
|