Skip to content

Commit 83f09cf

Browse files
committed
Add version sync script
1 parent 1295fa1 commit 83f09cf

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

fastwarc-py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "FastWARC"
7-
version = "0.15.2"
7+
version = "0.16.0"
88
description = "A high-performance WARC parsing library for Python written in C++/Cython."
99
authors = [
1010
{ name = "Janek Bevendorff" }

resiliparse-py/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "Resiliparse"
8-
version = "0.15.2"
8+
version = "0.16.0"
99
description = "A collection of robust and fast processing tools for parsing and analyzing (not only) web archive data."
1010
authors = [
1111
{ name = "Janek Bevendorff" }
@@ -16,7 +16,7 @@ license = { text = "Apache License 2.0" }
1616
readme = "README.md"
1717
requires-python = ">=3.8"
1818
dependencies = [
19-
"fastwarc==0.15.2"
19+
"fastwarc==0.16.0"
2020
]
2121

2222
[project.urls]

sync-py-versions.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python3
2+
# Copyright 2025 Janek Bevendorff
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Keep Python package versions in sync with Rust workspace version
17+
18+
import tomllib
19+
import re
20+
from subprocess import run
21+
22+
cargo_ver = tomllib.load(open('Cargo.toml', 'rb'))['workspace']['package']['version']
23+
24+
print(f'Updating Python package versions to {cargo_ver}.')
25+
26+
run(['poetry', 'version', '--project=fastwarc-py', cargo_ver], check=True)
27+
run(['poetry', 'version', '--project=resiliparse-py', cargo_ver], check=True)
28+
29+
# Patch fastwarc dependency (cannot use `poetry add` for this if fastwarc is not yet published)
30+
with open('resiliparse-py/pyproject.toml', 'r') as f:
31+
resiliparse_toml = f.read()
32+
with open('resiliparse-py/pyproject.toml', 'w') as f:
33+
f.write(re.sub(r'"fastwarc==\d+\.\d+\.\d+"',
34+
f'"fastwarc=={cargo_ver}"',
35+
resiliparse_toml))

0 commit comments

Comments
 (0)