Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Top-level Bazel BUILD file for TensorFlow Quantum.
# This file is intentionally empty.
# Copyright 2020 The TensorFlow Quantum 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.

# Export for the release package.
exports_files(["README.md"])
2 changes: 2 additions & 0 deletions release/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ sh_binary(
"//tensorflow_quantum/datasets:__init__.py",

# Dependencies to run PIP package creation.
# Use the repository root README.md for PyPI long_description.
"MANIFEST.in",
"//:README.md",
"setup.py",

# Dependencies that the PIP package will import.
Expand Down
1 change: 1 addition & 0 deletions release/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ main() {
echo "=== Copying TFQ files"

# Copy over files necessary to run setup.py
cp "${EXPORT_DIR}/README.md" "${TMPDIR}"
cp "${EXPORT_DIR}/release/setup.py" "${TMPDIR}"
cp "${EXPORT_DIR}/release/MANIFEST.in" "${TMPDIR}"
mkdir "${TMPDIR}/tensorflow_quantum"
Expand Down
19 changes: 17 additions & 2 deletions release/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,22 @@ def read_version():

CUR_VERSION = read_version()

DOCLINES = __doc__.split("\n")

def read_readme():
"""Return the project README contents for PyPI."""

setup_dir = Path(__file__).resolve().parent

# setup.py runs from release/ in the source tree, but it is copied to the
# package root in the wheel build tmpdir.
if (setup_dir / "tensorflow_quantum").is_dir():
readme_path = setup_dir / "README.md"
else:
readme_path = setup_dir.parent / "README.md"

if not readme_path.is_file():
raise RuntimeError(f"Could not find README.md at: {readme_path}")
return readme_path.read_text(encoding="utf-8")


class InstallPlatlib(install):
Expand Down Expand Up @@ -121,7 +136,7 @@ def has_ext_modules(self):
name=PROJECT_NAME,
version=BUILD_VERSION,
description="Library for hybrid quantum-classical machine learning.",
long_description="\n".join(DOCLINES[2:]),
long_description=read_readme(),
long_description_content_type="text/markdown",
author="The TensorFlow Quantum Authors",
author_email="tensorflow-quantum-team@google.com",
Expand Down
Loading