Skip to content

Commit 015eb61

Browse files
authored
Merge pull request #377 from adamcrume/master
Post-release cleanup
2 parents 3ae2ac5 + c3ff0ff commit 015eb61

File tree

8 files changed

+49
-25
lines changed

8 files changed

+49
-25
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ jobs:
2828
toolchain: stable
2929
override: true
3030
components: rustfmt
31+
- name: Setup Python # Set Python version
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: 3.8
35+
# Install pip and pytest
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install -r .github/workflows/requirements.txt
3140
- name: Execute test-all
3241
run: ./test-all
3342
shell: bash

.github/workflows/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tensorflow == 2.9.1

Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
repository = "https://github.com/tensorflow/rust"
1010
documentation = "https://tensorflow.github.io/rust/tensorflow"
1111
edition = "2018"
12+
rust-version = "1.59.0"
1213

1314
[lib]
1415
# We want to run doctests, but they're broken by https://github.com/rust-lang/cargo/issues/8531.
@@ -19,22 +20,22 @@ doctest = false
1920
features = ["private-docs-rs", "tensorflow_unstable", "ndarray", "eager"]
2021

2122
[dependencies]
22-
libc = "0.2.98"
23-
num-complex = { version = "0.4.0", default-features = false }
23+
libc = "0.2.132"
24+
num-complex = { version = "0.4.2", default-features = false }
2425
tensorflow-internal-macros = { version = "=0.0.3", path = "tensorflow-internal-macros" }
2526
tensorflow-sys = { version = "0.22.1", path = "tensorflow-sys" }
2627
byteorder = "1.4.3"
27-
crc = "2.0.0"
28-
half = "1.7.1"
28+
crc = "3.0.0"
29+
half = "2.1.0"
2930
# This is used internally but not intended to be exposed through the API.
3031
protobuf = "=2.27.1"
3132
# Enables conversions between ndarray::Array objects and tensorflow::Tensor
32-
ndarray = { version = "0.15.3", optional = true }
33-
rustversion = "1.0.5"
33+
ndarray = { version = "0.15.6", optional = true }
34+
rustversion = "1.0.9"
3435

3536
[dev-dependencies]
3637
random = "0.12.2"
37-
serial_test = "0.5.1"
38+
serial_test = "0.9.0"
3839

3940
[features]
4041
tensorflow_gpu = ["tensorflow-sys/tensorflow_gpu"]

RELEASING.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
## Pre-release
22

3+
1. Clean up clippy lints
4+
1. Run `cargo audit` and fix any issues
35
1. Generate protos
4-
1. Run `cd tensorflow-proto-codegen; cargo run -- $PATH_TO_TENSORFLOW $PWD/..`
6+
1. Run `cd tensorflow-proto-codegen; cargo run -- ${PATH_TO_TENSORFLOW?} $PWD/..`
57
1. Update Cargo.toml in root and tensorflow-op-codegen to ensure version of protobuf exactly equals version of protoc_rust used
68
1. Generate ops
7-
1. Run `cd tensorflow-op-codegen; cargo run -- $PATH_TO_TENSORFLOW $PWD/..`
8-
1. Run `cd tensorflow-op-codegen; cargo run --bin eager -- $PATH_TO_TENSORFLOW $PWD/..`
9+
1. Run `cd tensorflow-op-codegen; cargo run -- ${PATH_TO_TENSORFLOW?} $PWD/..`
10+
1. Run `cd tensorflow-op-codegen; cargo run --bin eager -- ${PATH_TO_TENSORFLOW?} $PWD/..`
911
1. Run `cargo fmt` to format generated code
1012
1. Commit and push changes
1113

@@ -19,12 +21,12 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
1921
1. Ensure that the minimum supported Rust version in the README is up to date
2022
1. Update changelog.
2123
1. Bump version number of `tensorflow-sys` if necessary
22-
1. Run `git log v${PREVIOUS_VERSION}..HEAD tensorflow-sys` and see if there were any changes. If not, skip.
24+
1. Run `git log v${PREVIOUS_VERSION?}..HEAD tensorflow-sys` and see if there were any changes. If not, skip.
2325
1. Bump the version in `tensorflow-sys/Cargo.toml`
2426
1. Bump the version in `tensorflow-sys/README.md`
2527
1. Bump the version for `tensorflow-sys` in the root `Cargo.toml`
2628
1. Bump version number of `tensorflow-internal-macros` if necessary
27-
1. Run `git log v${PREVIOUS_VERSION}..HEAD tensorflow-internal-macros` and see if there were any changes. If not, skip.
29+
1. Run `git log v${PREVIOUS_VERSION?}..HEAD tensorflow-internal-macros` and see if there were any changes. If not, skip.
2830
1. Bump the version in `tensorflow-internal-macros/Cargo.toml`
2931
1. Bump the version for `tensorflow-internal-macros` in the root `Cargo.toml`
3032
1. Bump the version number in `Cargo.toml`
@@ -36,7 +38,7 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
3638
1. If the version of tensorflow-sys was bumped, run `cargo publish` for tensorflow-sys. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
3739
1. If the version of tensorflow-internal-macros was bumped, run `cargo publish` for tensorflow-internal-macros. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
3840
1. Run `cargo publish`. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
39-
1. Add a `v${VERSION}` tag and push it
41+
1. Add a `v${VERSION?}` tag and push it
4042
1. Run `./update-docs`
4143
1. Announce the release to the mailing list
4244

run-valgrind

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ for example in addition regression expressions regression_checkpoint regression_
4646
run valgrind --leak-check=full target/debug/examples/"$example" >> "$valgrind_log" 2>&1
4747
done
4848

49+
echo "Testing tensorflow eager examples"
50+
for example in mobilenetv3; do
51+
run cargo build --features='examples_system_alloc tensorflow_unstable eager' --example="$example"
52+
run valgrind --leak-check=full target/debug/examples/"$example" >> "$valgrind_log" 2>&1
53+
done
54+
4955
echo "Testing tensorflow-sys examples"
5056
for example in multiplication; do
5157
cargo build --features=examples_system_alloc --example="$example" -p tensorflow-sys

tensorflow-proto-codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ authors = ["Adam Crume <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
protoc-rust = "2.24.1"
8+
protoc-rust = "2.27.1"
99

1010
[workspace]

tensorflow-sys/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ edition = "2018"
1919
features = ["private-docs-rs"]
2020

2121
[dependencies]
22-
libc = "0.2.98"
23-
lazy_static = { version = "1.4", optional = true }
24-
libloading = { version = "0.7", optional = true }
25-
cfg-if = { version = "1.0", optional = true }
26-
log = { version = "0.4", optional = true }
22+
libc = "0.2.132"
23+
lazy_static = { version = "1.4.0", optional = true }
24+
libloading = { version = "0.7.3", optional = true }
25+
cfg-if = { version = "1.0.0", optional = true }
26+
log = { version = "0.4.17", optional = true }
2727

2828
[build-dependencies]
29-
curl = "0.4.38"
30-
flate2 = "1.0.20"
31-
pkg-config = "0.3.19"
32-
semver = "1.0.3"
33-
tar = "0.4.35"
29+
curl = "0.4.44"
30+
flate2 = "1.0.24"
31+
pkg-config = "0.3.25"
32+
semver = "1.0.13"
33+
tar = "0.4.38"
3434
zip = "0.6.2"
3535

3636
[features]

test-all

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ function run {
1313
# the run-valgrind script.
1414
version_build_script=`grep "const VERSION" tensorflow-sys/build.rs | sed 's|.*"\([^"]*\)";|\1|g'`
1515
version_run_valgrind=`grep "tensorflow_version=" run-valgrind | sed "s|.*=\(.*\)|\1|g"`
16-
if [[ "${version_build_script}" != "${version_run_valgrind}" ]]; then
16+
version_requirements=`grep "tensorflow\s*=" .github/workflows/requirements.txt | sed "s|.*== \(.*\)|\1|g"`
17+
if [[ "${version_build_script}" != "${version_run_valgrind}" || \
18+
"${version_build_script}" != "${version_requirements}" ]]; then
1719
echo "ERROR: Tensorflow version specified in build script does not match the one in the"
1820
echo " valgrind run script."
1921
echo " tensorflow-sys/build.rs: ${version_build_script}"
2022
echo " run-valgrind: ${version_run_valgrind}"
23+
echo " ./github/workflows/requirements.txt: ${version_requirements}"
2124
exit 1
2225
fi
2326

@@ -44,6 +47,7 @@ if [[ "${version_tensorflow_sys_crate}" != "${version_tensorflow_sys_readme}" ]]
4447
exit 1
4548
fi
4649

50+
run python3 examples/mobilenetv3/create_model.py
4751
run cargo fmt --all -- --check
4852
run cargo test -vv -j 2
4953
run cargo test -vv -j 2 --features eager
@@ -52,6 +56,7 @@ run cargo test -vv -j 2 --features ndarray
5256
run cargo run --example regression
5357
run cargo run --example xor
5458
run cargo run --features tensorflow_unstable --example expressions
59+
run cargo run --features eager --example mobilenetv3
5560
run cargo doc -vv --features tensorflow_unstable,ndarray,eager
5661
run cargo doc -vv --features tensorflow_unstable,ndarray,eager,private-docs-rs
5762
# TODO(#66): Re-enable: (cd tensorflow-sys && cargo test -vv -j 1)

0 commit comments

Comments
 (0)