bencode-rs 0.0.7__tar.gz → 0.0.9__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.
Files changed (39) hide show
  1. bencode_rs-0.0.9/.github/mergify.yml +34 -0
  2. bencode_rs-0.0.9/.github/renovate.json +27 -0
  3. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/.github/workflows/_build_wheels.yaml +38 -26
  4. bencode_rs-0.0.9/.github/workflows/autofix.yaml +26 -0
  5. bencode_rs-0.0.9/.github/workflows/ci.yaml +197 -0
  6. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/.github/workflows/release.yaml +2 -2
  7. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/.pre-commit-config.yaml +6 -7
  8. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/Cargo.lock +61 -69
  9. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/Cargo.toml +6 -5
  10. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/PKG-INFO +10 -2
  11. bencode_rs-0.0.9/dprint.json +15 -0
  12. bencode_rs-0.0.9/pyproject.toml +49 -0
  13. bencode_rs-0.0.9/rust-toolchain.toml +4 -0
  14. bencode_rs-0.0.9/rustfmt.toml +12 -0
  15. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/src/decode.rs +22 -21
  16. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/src/encode.rs +129 -106
  17. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/tests/bench.py +16 -1
  18. bencode_rs-0.0.9/tests/fixtures/multiple-files.torrent.bin +311 -2
  19. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/tests/test_1_encode.py +8 -1
  20. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/tests/test_2_decode.py +1 -0
  21. bencode_rs-0.0.9/uv.lock +895 -0
  22. bencode_rs-0.0.7/.github/renovate.json +0 -13
  23. bencode_rs-0.0.7/.github/workflows/ci.yaml +0 -159
  24. bencode_rs-0.0.7/pyproject.toml +0 -29
  25. bencode_rs-0.0.7/requirements.txt +0 -10
  26. bencode_rs-0.0.7/rust-toolchain.toml +0 -4
  27. bencode_rs-0.0.7/rustfmt.toml +0 -12
  28. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/.coveragerc +0 -0
  29. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/.gitattributes +0 -0
  30. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/.gitignore +0 -0
  31. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/LICENSE +0 -0
  32. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/leak.py +0 -0
  33. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/py/bencode_rs/__init__.py +0 -0
  34. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/py/bencode_rs/__init__.pyi +0 -0
  35. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/py/bencode_rs/py.typed +0 -0
  36. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/readme.md +0 -0
  37. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/src/lib.rs +0 -0
  38. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/tests/fixtures/56507.torrent.bin +0 -0
  39. {bencode_rs-0.0.7 → bencode_rs-0.0.9}/tests/fixtures/ubuntu-22.04.2-desktop-amd64.iso.torrent.bin +0 -0
@@ -0,0 +1,34 @@
1
+ merge_queue:
2
+ max_parallel_checks: 1
3
+ queued_label: 'ci:queued'
4
+ dequeued_label: 'ci:dequeued'
5
+
6
+ queue_rules:
7
+ - name: renovate
8
+ update_method: merge
9
+
10
+ pull_request_rules:
11
+ - name: label conflicts
12
+ conditions:
13
+ - conflict
14
+ actions:
15
+ label:
16
+ toggle:
17
+ - conflict
18
+
19
+ - name: Automatic merge on approval
20
+ conditions:
21
+ - or:
22
+ - '#approved-reviews-by>=1'
23
+ - label=ci:auto-merge
24
+ - or:
25
+ - not:
26
+ and:
27
+ - 'head*=renovate/lockfile-maintenance-*'
28
+ - 'created-at<=24h ago'
29
+ - base=master
30
+ - check-success=cargo-fmt
31
+ - check-success=all-ci-jobs
32
+ actions:
33
+ queue:
34
+ name: renovate
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "github>trim21/renovate-config",
5
+ "github>trim21/renovate-config:python",
6
+ "github>trim21/renovate-config:rust"
7
+ ],
8
+ "labels": [
9
+ "ci:auto-merge",
10
+ "dependencies"
11
+ ],
12
+ "lockFileMaintenance": {
13
+ "enabled": true
14
+ },
15
+ "cargo": {
16
+ "enabled": true
17
+ },
18
+ "rangeStrategy": "bump",
19
+ "packageRules": [
20
+ {
21
+ "matchDepTypes": [
22
+ "requires-python"
23
+ ],
24
+ "enabled": false
25
+ }
26
+ ]
27
+ }
@@ -7,18 +7,18 @@ jobs:
7
7
  sdist:
8
8
  runs-on: ubuntu-24.04
9
9
  steps:
10
- - uses: actions/checkout@v4
10
+ - uses: actions/checkout@v6
11
11
  - name: Set up Python ${{ matrix.python-version }}
12
- uses: actions/setup-python@v5
12
+ uses: actions/setup-python@v6
13
13
  with:
14
- python-version: "3.x"
14
+ python-version: '3.14.4'
15
15
  - name: Build sdist
16
16
  uses: PyO3/maturin-action@v1
17
17
  with:
18
18
  command: sdist
19
19
  args: --out dist
20
20
  - name: Upload sdist
21
- uses: actions/upload-artifact@v4
21
+ uses: actions/upload-artifact@v7
22
22
  with:
23
23
  name: wheels-sdist
24
24
  path: dist
@@ -29,67 +29,79 @@ jobs:
29
29
  fail-fast: false
30
30
  matrix:
31
31
  platform:
32
- - runner: macos-13
33
- target: x86_64
34
- py: x64
35
-
36
- - runner: macos-14
32
+ - runner: macos-15
37
33
  target: aarch64
38
34
  py: arm64
35
+ manylinux: auto
39
36
 
40
37
  - runner: windows-latest
41
38
  target: x64
42
39
  py: x64
43
-
44
- - runner: windows-latest
45
- target: x86
46
- py: x86
40
+ manylinux: auto
47
41
 
48
42
  - runner: ubuntu-24.04
49
43
  target: x86_64
50
- - runner: ubuntu-24.04
51
- target: x86
52
- - runner: ubuntu-24.04
44
+ manylinux: auto
45
+ - runner: ubuntu-24.04-arm
53
46
  target: aarch64
47
+ manylinux: auto
54
48
  - runner: ubuntu-24.04
55
49
  target: armv7
50
+ manylinux: auto
56
51
  - runner: ubuntu-24.04
57
52
  target: s390x
53
+ manylinux: auto
58
54
  - runner: ubuntu-24.04
59
55
  target: ppc64le
56
+ manylinux: auto
57
+ - runner: ubuntu-24.04
58
+ target: x86_64-unknown-linux-musl
59
+ manylinux: musllinux_1_2
60
+ - runner: ubuntu-24.04-arm
61
+ target: aarch64-unknown-linux-musl
62
+ manylinux: musllinux_1_2
60
63
 
61
64
  steps:
62
- - uses: actions/checkout@v4
65
+ - uses: actions/checkout@v6
63
66
 
64
67
  - uses: actions-rust-lang/setup-rust-toolchain@v1
65
68
  if: ${{ runner.os != 'Linux' }}
66
69
 
67
- - uses: actions/setup-python@v5
70
+ - uses: actions/setup-python@v6
71
+ if: ${{ runner.os != 'Linux' }}
72
+ with:
73
+ python-version: '3.10'
74
+ architecture: ${{ matrix.platform.py }}
75
+
76
+ - uses: actions/setup-python@v6
68
77
  if: ${{ runner.os != 'Linux' }}
69
78
  with:
70
- python-version: "3.x"
79
+ python-version: '3.11'
71
80
  architecture: ${{ matrix.platform.py }}
72
81
 
73
- - name: Build wheels
82
+ - name: Build wheels (cp310, non-abi3)
74
83
  uses: PyO3/maturin-action@v1
75
84
  with:
76
85
  target: ${{ matrix.platform.target }}
77
- args: --release --out dist
78
- sccache: "true"
79
- manylinux: auto
86
+ args: --release --out dist --interpreter '3.11' --interpreter '3.10'
87
+ sccache: 'true'
88
+ manylinux: ${{ matrix.platform.manylinux }}
89
+
90
+ - run: ls -ahl dist
91
+ shell: bash
80
92
 
81
93
  - name: Upload wheels
82
- uses: actions/upload-artifact@v4
94
+ uses: actions/upload-artifact@v7
83
95
  with:
84
96
  name: wheels-${{ runner.os }}-${{ matrix.platform.target }}
85
97
  path: dist
86
98
 
87
99
  merge-wheel-artifact:
88
100
  runs-on: ubuntu-24.04
89
- needs: ["sdist", "wheel"]
101
+ needs: ['sdist', 'wheel']
90
102
  steps:
91
103
  - name: Merge Artifacts
92
- uses: actions/upload-artifact/merge@v4
104
+ uses: actions/upload-artifact/merge@v7
93
105
  with:
94
106
  name: wheel
95
107
  pattern: wheels-*
@@ -0,0 +1,26 @@
1
+ name: autofix.ci
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ cargo:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v6
17
+
18
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
19
+ with:
20
+ components: rustfmt,clippy
21
+
22
+ - run: cargo fmt || true
23
+ - run: cargo clippy --fix --allow-dirty || true
24
+ - uses: trim21/actions/prek@master
25
+
26
+ - uses: autofix-ci/action@v1
@@ -0,0 +1,197 @@
1
+ name: ci
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ workflow_dispatch:
8
+ push:
9
+ branches:
10
+ - master
11
+ tags-ignore:
12
+ - '*'
13
+
14
+ jobs:
15
+ build:
16
+ concurrency:
17
+ group: '${{ github.workflow }}-${{ github.ref }}'
18
+ cancel-in-progress: true
19
+ uses: ./.github/workflows/_build_wheels.yaml
20
+
21
+ cargo-fmt:
22
+ runs-on: ubuntu-24.04
23
+ steps:
24
+ - uses: actions/checkout@v6
25
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
26
+ with:
27
+ components: rustfmt,clippy
28
+ - run: cargo fmt --check --all
29
+ - run: cargo clippy
30
+
31
+ all-ci-jobs:
32
+ needs: ['test', 'bench-cp', 'coverage', 'audit']
33
+ runs-on: ubuntu-slim
34
+ steps:
35
+ - run: echo 1
36
+
37
+ test:
38
+ strategy:
39
+ matrix:
40
+ os: ['ubuntu-24.04', 'macos-15', 'windows-latest']
41
+ python-version:
42
+ - '3.10'
43
+ - '3.11'
44
+ - '3.12'
45
+ - '3.13'
46
+ - '3.14'
47
+
48
+ runs-on: '${{ matrix.os }}'
49
+
50
+ needs: [build]
51
+
52
+ steps:
53
+ - uses: actions/checkout@v6
54
+ - uses: actions/download-artifact@v8
55
+ with:
56
+ name: wheel
57
+ path: dist
58
+ - name: Set up Python ${{ matrix.python-version }}
59
+ uses: actions/setup-python@v6
60
+ with:
61
+ python-version: ${{ matrix.python-version }}
62
+
63
+ - name: Set up uv
64
+ uses: astral-sh/setup-uv@v8.0.0
65
+ with:
66
+ enable-cache: true
67
+ activate-environment: true
68
+
69
+ - name: Install Python deps from lock (dev)
70
+ run: |
71
+ uv sync --locked --group dev
72
+
73
+ - run: uv pip install bencode-rs --no-index --find-links ./dist/
74
+
75
+ - run: pytest -sv
76
+ env:
77
+ RUST_BACKTRACE: 'full'
78
+
79
+ bench-cp:
80
+ strategy:
81
+ matrix:
82
+ python-version:
83
+ - '3.12'
84
+
85
+ runs-on: 'ubuntu-24.04'
86
+
87
+ steps:
88
+ - uses: actions/checkout@v6
89
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
90
+
91
+ - name: Set up Python ${{ matrix.python-version }}
92
+ uses: actions/setup-python@v6
93
+ with:
94
+ python-version: ${{ matrix.python-version }}
95
+
96
+ - name: Set up uv
97
+ uses: astral-sh/setup-uv@v8.0.0
98
+ with:
99
+ enable-cache: true
100
+ activate-environment: true
101
+
102
+ - name: Install Python deps from lock (dev)
103
+ run: |
104
+ uv sync --locked --group dev
105
+
106
+ - run: maturin build --release --out dist
107
+ - run: uv pip install bencode-rs --no-index --find-links ./dist/
108
+
109
+ - name: Run benchmarks
110
+ uses: CodSpeedHQ/action@v4
111
+ with:
112
+ token: ${{ secrets.CODSPEED_TOKEN }}
113
+ mode: 'simulation'
114
+ run: python -m pytest tests/bench.py --codspeed
115
+
116
+ audit:
117
+ name: Audit
118
+ needs: [build]
119
+ runs-on: ubuntu-24.04
120
+ steps:
121
+ - uses: actions/checkout@v6
122
+
123
+ - name: Set up Python 3.14.2
124
+ uses: actions/setup-python@v6
125
+ with:
126
+ python-version: '3.14.4'
127
+
128
+ - name: Set up uv
129
+ uses: astral-sh/setup-uv@v8.0.0
130
+ with:
131
+ enable-cache: true
132
+ activate-environment: true
133
+
134
+ - run: uv sync --dev
135
+
136
+ - uses: actions/download-artifact@v8
137
+ with:
138
+ name: wheel
139
+ path: dist
140
+
141
+ - run: abi3audit --verbose dist/*abi3*.whl
142
+ - run: twine check --strict dist/*
143
+
144
+ coverage:
145
+ name: Coverage for ${{ matrix.python-version }}
146
+ strategy:
147
+ matrix:
148
+ python-version:
149
+ - '3.10'
150
+ - '3.11'
151
+ - '3.12'
152
+ - '3.13'
153
+ - '3.14'
154
+
155
+ runs-on: ubuntu-24.04
156
+ steps:
157
+ - uses: actions/checkout@v6
158
+ - name: Set up Python ${{ matrix.python-version }}
159
+ uses: actions/setup-python@v6
160
+ with:
161
+ python-version: '${{ matrix.python-version }}'
162
+
163
+ - name: Set up uv
164
+ uses: astral-sh/setup-uv@v8.0.0
165
+ with:
166
+ enable-cache: true
167
+ activate-environment: true
168
+
169
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
170
+ with:
171
+ components: llvm-tools
172
+
173
+ - name: Install cargo-llvm-cov
174
+ uses: taiki-e/install-action@v2
175
+ with:
176
+ tool: cargo-llvm-cov
177
+
178
+ - run: uv sync --dev
179
+ - run: uv tool install maturin
180
+
181
+ - name: Run coverage
182
+ run: |
183
+ set -euxo pipefail
184
+ source <(cargo llvm-cov show-env --export-prefix)
185
+ export CARGO_TARGET_DIR=$CARGO_LLVM_COV_TARGET_DIR
186
+ if [ "${{ matrix.python-version }}" = "3.10" ]; then
187
+ maturin develop --uv --no-default-features
188
+ else
189
+ maturin develop --uv
190
+ fi
191
+ pytest tests
192
+ cargo llvm-cov report --lcov --output-path coverage.lcov
193
+
194
+ - uses: codecov/codecov-action@v6
195
+ with:
196
+ files: coverage.lcov
197
+ token: '${{ secrets.CODECOV_TOKEN }}'
@@ -17,9 +17,9 @@ jobs:
17
17
  permissions:
18
18
  id-token: write
19
19
  steps:
20
- - uses: actions/download-artifact@v4.1.8
20
+ - uses: actions/download-artifact@v8
21
21
  with:
22
22
  name: wheel
23
23
  path: dist
24
24
 
25
- - uses: pypa/gh-action-pypi-publish@v1.12.3
25
+ - uses: pypa/gh-action-pypi-publish@v1.14.0
@@ -1,14 +1,13 @@
1
- exclude: '^.*\.bin$'
1
+ exclude: '^.*\.(bin|torrent)$'
2
2
 
3
3
  repos:
4
- - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
5
- rev: v2.14.0
4
+ - repo: https://github.com/trim21/dprint-pre-commit
5
+ rev: 'v0.51.1.0'
6
6
  hooks:
7
- - id: pretty-format-yaml
8
- args: [--autofix, --indent, '2', '--preserve-quotes', --offset, '2']
7
+ - id: dprint
9
8
 
10
9
  - repo: https://github.com/pre-commit/pre-commit-hooks
11
- rev: v5.0.0
10
+ rev: v6.0.0
12
11
  hooks:
13
12
  - id: check-case-conflict
14
13
  - id: check-ast
@@ -22,6 +21,6 @@ repos:
22
21
  - id: end-of-file-fixer
23
22
 
24
23
  - repo: https://github.com/psf/black
25
- rev: 24.10.0
24
+ rev: 26.3.1
26
25
  hooks:
27
26
  - id: black