Add a version number to TF Privacy package.
PiperOrigin-RevId: 320713287
This commit is contained in:
parent
4e5b2ae3e5
commit
9408e0fca5
4 changed files with 70 additions and 2 deletions
50
build_pip_package.sh
Executable file
50
build_pip_package.sh
Executable 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 "$@"
|
2
setup.py
2
setup.py
|
@ -17,7 +17,7 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name='tensorflow_privacy',
|
||||
version='0.3.0',
|
||||
version='0.4.0',
|
||||
url='https://github.com/tensorflow/privacy',
|
||||
license='Apache-2.0',
|
||||
install_requires=[
|
||||
|
|
|
@ -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");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -19,6 +19,8 @@ from __future__ import print_function
|
|||
|
||||
import sys
|
||||
|
||||
from tensorflow_privacy.version import __version__ # pylint: disable=g-bad-import-order
|
||||
|
||||
# pylint: disable=g-import-not-at-top
|
||||
|
||||
if hasattr(sys, 'skip_tf_privacy_import'): # Useful for standalone scripts.
|
||||
|
|
16
tensorflow_privacy/version.py
Normal file
16
tensorflow_privacy/version.py
Normal 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'
|
Loading…
Reference in a new issue