Skip to content

Commit

Permalink
Add bump_version.py script, set version to 0.0.1-a1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Jan 30, 2024
1 parent a3e1d67 commit e05f130
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 55 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions automation/bump_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import click
from pathlib import Path
import toml

root = Path(__file__).parent.parent.absolute()


@click.command()
@click.argument('version')
def bump_version(version):
print(f"Updating version to {version}")

# Handle Cargo.toml files
cargo_packages = [
"avenger",
"avenger-vega",
"avenger-wgpu",
"avenger-vega-test-data",
"avenger-python",
]

for package in cargo_packages:
cargo_toml_path = (root / package / "Cargo.toml")
cargo_toml = toml.loads(cargo_toml_path.read_text())
# Update this package's version
cargo_toml["package"]["version"] = version

# Look for local workspace dependencies and update their versions
for dep_type in ["dependencies", "dev-dependencies", "build-dependencies"]:
for p, props in cargo_toml.get(dep_type, {}).items():
if isinstance(props, dict) and props.get("path", "").startswith("../avenger"):
props["version"] = version

# Fix quotes in target so that they don't get double escaped when written back out
new_target = {}
for target, val in cargo_toml.get("target", {}).items():
unescaped_target = target.replace(r'\"', '"')
new_target[unescaped_target] = val
if new_target:
cargo_toml["target"] = new_target

cargo_toml_path.write_text(toml.dumps(cargo_toml))
print(f"Updated version in {cargo_toml_path}")


if __name__ == '__main__':
bump_version()
35 changes: 27 additions & 8 deletions avenger-python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
[package]
name = "avenger-python"
version = "0.0.1"
version = "0.0.1-a1"
edition = "2021"
license = "BSD-3-Clause"
publish = false

[lib]
name = "avenger"
crate-type = ["cdylib"]
crate-type = [ "cdylib",]

[dependencies]
avenger = { path = "../avenger", features = ["pyo3"] }
avenger-vega = { path = "../avenger-vega", features = ["pyo3"] }
avenger-wgpu = { path = "../avenger-wgpu", features = ["pyo3"] }
pyo3 = { workspace = true, features = ["extension-module", "abi3-py38"] }
pythonize = "0.20.0"
serde = {workspace = true}
pollster = "0.3"
image = {workspace = true}

[dependencies.avenger]
path = "../avenger"
features = [ "pyo3",]
version = "0.0.1-a1"

[dependencies.avenger-vega]
path = "../avenger-vega"
features = [ "pyo3",]
version = "0.0.1-a1"

[dependencies.avenger-wgpu]
path = "../avenger-wgpu"
features = [ "pyo3",]
version = "0.0.1-a1"

[dependencies.pyo3]
workspace = true
features = [ "extension-module", "abi3-py38",]

[dependencies.serde]
workspace = true

[dependencies.image]
workspace = true
10 changes: 5 additions & 5 deletions avenger-vega-test-data/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "avenger-vega-test-data"
version = "0.1.0"
version = "0.0.1-a1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde_json = {workspace = true}
vl-convert-rs = "1.2.3"
pollster = "0.3"
pollster = "0.3"

[dependencies.serde_json]
workspace = true
48 changes: 36 additions & 12 deletions avenger-vega/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
[package]
name = "avenger-vega"
version = "0.1.0"
version = "0.0.1-a1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
image-request = ["reqwest"]
image-request = [ "reqwest",]

[dependencies]
avenger = { path = "../avenger" }
cfg-if = "1"
thiserror = { workspace = true }
serde = { workspace = true }
csscolorparser = "0.6.2"
serde_json = { version = "1.0.111" }
lyon_extra = { workspace = true }
lyon_path = { workspace = true, features = ["serialization"]}
image = { workspace = true, default-features = false, features = ["png"] }
reqwest = { version = "0.11.23", features = ["blocking", "rustls"], optional = true }
pyo3 = { workspace = true, optional = true }

[dependencies.avenger]
path = "../avenger"
version = "0.0.1-a1"

[dependencies.thiserror]
workspace = true

[dependencies.serde]
workspace = true

[dependencies.serde_json]
version = "1.0.111"

[dependencies.lyon_extra]
workspace = true

[dependencies.lyon_path]
workspace = true
features = [ "serialization",]

[dependencies.image]
workspace = true
default-features = false
features = [ "png",]

[dependencies.reqwest]
version = "0.11.23"
features = [ "blocking", "rustls",]
optional = true

[dependencies.pyo3]
workspace = true
optional = true
53 changes: 37 additions & 16 deletions avenger-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,63 @@
[package]
name = "avenger-wgpu"
version = "0.1.0"
version = "0.0.1-a1"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
crate-type = [ "cdylib", "rlib",]

[features]
text-glyphon = ["glyphon"]
default = ["text-glyphon"]
text-glyphon = [ "glyphon",]
default = [ "text-glyphon",]

[dependencies]
avenger = { path = "../avenger" }

thiserror = { workspace = true }
cfg-if = "1"
winit = "0.28"
env_logger = "0.10"
log = "0.4"
wgpu = "0.18"
pollster = "0.3"
bytemuck = { version = "1.14", features = [ "derive" ] }
cgmath = "0.18.0"
itertools = "0.12.0"
image = "0.24.7"
futures-intrusive = "^0.5"
etagere = "0.2.10"
colorgrad = "0.6.2"
lazy_static = { workspace=true }
pyo3 = { workspace = true, optional = true }

# glyphon branch that includes text rotation support: https://github.com/jonmmease/glyphon/pull/1
glyphon = { git = "https://github.com/jonmmease/glyphon.git", rev="c468f5dacd4130b27a29b098c4de3f4d5c146209", optional = true }
lyon = { workspace = true }

[dev-dependencies]
avenger-vega = { path = "../avenger-vega", features = ["image-request"] }
serde_json = { version = "1.0.111" }
dssim = "3.2.4"
rstest = "0.18.2"

[dependencies.avenger]
path = "../avenger"
version = "0.0.1-a1"

[dependencies.thiserror]
workspace = true

[dependencies.bytemuck]
version = "1.14"
features = [ "derive",]

[dependencies.lazy_static]
workspace = true

[dependencies.pyo3]
workspace = true
optional = true

[dependencies.glyphon]
git = "https://github.com/jonmmease/glyphon.git"
rev = "c468f5dacd4130b27a29b098c4de3f4d5c146209"
optional = true

[dependencies.lyon]
workspace = true

[dev-dependencies.avenger-vega]
path = "../avenger-vega"
features = [ "image-request",]
version = "0.0.1-a1"

[dev-dependencies.serde_json]
version = "1.0.111"
25 changes: 17 additions & 8 deletions avenger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
[package]
name = "avenger"
version = "0.1.0"
version = "0.0.1-a1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies.thiserror]
workspace = true

[dependencies]
thiserror = { workspace = true }
serde = { workspace = true }
lyon_path = { workspace = true, features = ["serialization"] }
image = { workspace = true, features = ["png"] }
pyo3 = { workspace = true, optional = true }
[dependencies.serde]
workspace = true

[dependencies.lyon_path]
workspace = true
features = [ "serialization",]

[dependencies.image]
workspace = true
features = [ "png",]

[dependencies.pyo3]
workspace = true
optional = true
45 changes: 45 additions & 0 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e05f130

Please sign in to comment.