File tree Expand file tree Collapse file tree 4 files changed +49
-2
lines changed Expand file tree Collapse file tree 4 files changed +49
-2
lines changed Original file line number Diff line number Diff line change
1
+ # From https://github.com/Intreecom/scyllapy/blob/05fdab32dd7468c26533de5fdfe9627fa3e38445/scripts/version_bumper.py
2
+
3
+ import argparse
4
+ import re
5
+ from pathlib import Path
6
+
7
+
8
+ def parse_args () -> argparse .Namespace :
9
+ """Parse command line arguments."""
10
+ parser = argparse .ArgumentParser ()
11
+ parser .add_argument (
12
+ "--target" ,
13
+ "-t" ,
14
+ dest = "target" ,
15
+ type = Path ,
16
+ default = "Cargo.toml" ,
17
+ )
18
+ parser .add_argument ("version" , type = str )
19
+ return parser .parse_args ()
20
+
21
+
22
+ def main () -> None :
23
+ """Main function."""
24
+ args = parse_args ()
25
+ with args .target .open ("r" ) as f :
26
+ contents = f .read ()
27
+
28
+ contents = re .sub (
29
+ r"version\s*=\s*\"(.*)\"" ,
30
+ f'version = "{ args .version } "' ,
31
+ contents ,
32
+ count = 1 ,
33
+ )
34
+
35
+ with args .target .open ("w" ) as f :
36
+ f .write (contents )
37
+
38
+
39
+ if __name__ == "__main__" :
40
+ main ()
Original file line number Diff line number Diff line change 21
21
with :
22
22
python-version : ' 3.10'
23
23
24
+ - name : Bump Cargo version
25
+ run : |
26
+ python ./.github/scripts/cargo_version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
27
+
24
28
- name : Set up QEMU
25
29
if : runner.os == 'Linux'
26
30
uses : docker/setup-qemu-action@v3
69
73
CIBW_TEST_COMMAND : python -c "import outlines_core; print(outlines_core.__version__)"
70
74
CMAKE_PREFIX_PATH : ./dist
71
75
72
-
73
76
- uses : actions/upload-artifact@v3
74
77
with :
75
78
path : ./wheelhouse/*.whl
Original file line number Diff line number Diff line change 13
13
- name : Checkout
14
14
uses : actions/checkout@v2
15
15
16
+ - name : Bump Cargo version
17
+ run : |
18
+ python ./.github/scripts/cargo_version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
19
+
16
20
- name : Install Rust
17
21
uses : actions-rs/toolchain@v1
18
22
with :
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " outlines-core"
3
- version = " 0.1.21 "
3
+ version = " 0.0.0 "
4
4
edition = " 2021"
5
5
description = " Structured Generation"
6
6
license = " Apache-2.0"
You can’t perform that action at this time.
0 commit comments