Add a version number to TF Privacy package.

PiperOrigin-RevId: 320713287
This commit is contained in:
Galen Andrew 2020-07-10 18:39:37 -07:00 committed by A. Unique TensorFlower
parent 4e5b2ae3e5
commit 9408e0fca5
4 changed files with 70 additions and 2 deletions

50
build_pip_package.sh Executable file
View file

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Copyright 2020, The TensorFlow Privacy Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Tool to build the TensorFlow Privacy pip package.
#
# Usage:
# bazel run //tensorflow_privacy/tools/development:build_pip_package -- \
# "/tmp/tensorflow_privacy"
#
# Arguments:
# output_dir: An output directory.
set -e
die() {
echo >&2 "$@"
exit 1
}
main() {
local output_dir="$1"
if [[ ! -d "${output_dir}" ]]; then
die "The output directory '${output_dir}' does not exist."
fi
# Create a virtual environment
virtualenv --python=python3 "venv"
source "venv/bin/activate"
pip install --upgrade pip
# Build pip package
pip install --upgrade setuptools wheel
python "setup.py" sdist bdist_wheel
cp "dist/"* "${output_dir}"
}
main "$@"

View file

@ -17,7 +17,7 @@ from setuptools import setup
setup( setup(
name='tensorflow_privacy', name='tensorflow_privacy',
version='0.3.0', version='0.4.0',
url='https://github.com/tensorflow/privacy', url='https://github.com/tensorflow/privacy',
license='Apache-2.0', license='Apache-2.0',
install_requires=[ install_requires=[

View file

@ -1,4 +1,4 @@
# Copyright 2019, The TensorFlow Privacy Authors. # Copyright 2020, The TensorFlow Privacy Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -19,6 +19,8 @@ from __future__ import print_function
import sys import sys
from tensorflow_privacy.version import __version__ # pylint: disable=g-bad-import-order
# pylint: disable=g-import-not-at-top # pylint: disable=g-import-not-at-top
if hasattr(sys, 'skip_tf_privacy_import'): # Useful for standalone scripts. if hasattr(sys, 'skip_tf_privacy_import'): # Useful for standalone scripts.

View file

@ -0,0 +1,16 @@
# Copyright 2020, The TensorFlow Privacy Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""TensorFlow Privacy version."""
__version__ = '0.4.0'