Skip to content

Commit

Permalink
Add dependency entries for package manages to parse
Browse files Browse the repository at this point in the history
Package managers like poetry are not inferring the correct
dependencies for the collaborator builds as they differ
from the default
  • Loading branch information
elfringham committed Dec 2, 2022
1 parent 8a25439 commit 0048f19
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tensorflow/tools/pip_package/setup.py
Expand Up @@ -33,6 +33,7 @@
import os
import re
import sys
import platform

from setuptools import Command
from setuptools import find_packages
Expand Down Expand Up @@ -130,6 +131,22 @@ def standard_or_nightly(standard, nightly):
]
REQUIRED_PACKAGES = [p for p in REQUIRED_PACKAGES if p is not None]

FAKE_REQUIRED_PACKAGES = [
# The depedencies here below are not actually used but are needed for
# package managers like poetry to parse as they are confused by the
# different architectures having different requirements.
# The entries here should be a simple duplicate of those in the collaborator
# build section.
standard_or_nightly('tensorflow-cpu-aws', 'tf-nightly-cpu-aws') + '==' +
_VERSION + ';platform_system=="Linux" and (platform_machine=="arm64" or '
'platform_machine=="aarch64")',
standard_or_nightly('tensorflow-intel', 'tf-nightly-intel') + '==' +
_VERSION + ';platform_system=="Windows"',
]

if platform.system() == 'Linux' and platform.machine() == 'x86_64':
REQUIRED_PACKAGES.append(FAKE_REQUIRED_PACKAGES)

if collaborator_build:
# If this is a collaborator build, then build an "installer" wheel and
# add the collaborator packages as the only dependencies.
Expand Down

0 comments on commit 0048f19

Please sign in to comment.