Skip to content

Commit f629172

Browse files
ssjhvcopybara-github
authored andcommitted
Default version string now follows PEP440.
PiperOrigin-RevId: 506821261 Change-Id: I11520c7392e50900ed2d54b1ad55f0e830c8c889
1 parent d672ad3 commit f629172

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ sudo docker run -i --rm -v /tmp/tensorflow_compression:/tmp/tensorflow_compressi
269269
cd /tensorflow_compression &&
270270
python -m pip install -U pip setuptools wheel &&
271271
python -m pip install -r requirements.txt &&
272-
bazel build -c opt --copt=-mavx [email protected]_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain :build_pip_pkg
273-
python build_pip_pkg.py bazel-bin/build_pip_pkg.runfiles/tensorflow_compression /tmp/tensorflow_compression custom_version"
272+
bazel run -c opt --copt=-mavx [email protected]_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain :build_pip_pkg -- . /tmp/tensorflow_compression <custom-version>"
274273
```
275274

276275
For Darwin, the Docker image and specifying the toolchain is not necessary. We
@@ -282,8 +281,7 @@ git clone https://github.com/tensorflow/compression.git /tensorflow_compression
282281
cd /tensorflow_compression
283282
python -m pip install -U pip setuptools wheel
284283
python -m pip install -r requirements.txt
285-
bazel build -c opt --copt=-mavx --macos_minimum_os=10.14 :build_pip_pkg
286-
python build_pip_pkg.py bazel-bin/build_pip_pkg.runfiles/tensorflow_compression /tmp/tensorflow_compression custom_version"
284+
bazel run -c opt --copt=-mavx --macos_minimum_os=10.14 :build_pip_pkg -- . /tmp/tensorflow_compression <custom-version>"
287285
```
288286
289287
In both cases, the wheel file is created inside `/tmp/tensorflow_compression`.

build_pip_pkg.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
import tempfile
2323
import setuptools
2424

25-
# Version string is intentionally set to non-numeric value, so that non-release
26-
# built packages are different from release packages.
27-
DEFAULT_VERSION = "custom-build-from-source"
25+
# Version string should follow PEP440 rules.
26+
DEFAULT_VERSION = "0.dev0+build-from-source"
2827

2928

3029
class BinaryDistribution(setuptools.Distribution):
@@ -101,5 +100,5 @@ def main(srcdir: str, destdir: str, version: str = ""):
101100

102101

103102
if __name__ == "__main__":
104-
main(*sys.argv[1:]) # pylint: disable=no-value-for-parameter
103+
main(*sys.argv[1:]) # pylint: disable=too-many-function-args
105104

0 commit comments

Comments
 (0)