Skip to content

Commit 3676584

Browse files
Undo ruff formatting
1 parent 46f0716 commit 3676584

File tree

1 file changed

+83
-87
lines changed

1 file changed

+83
-87
lines changed

setup.py

Lines changed: 83 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
"""Package Setup script for tf.Transform."""
15-
1615
import os
1716
from pathlib import Path
1817

@@ -21,112 +20,109 @@
2120

2221

2322
def select_constraint(default, nightly=None, git_master=None):
24-
"""Select dependency constraint based on TFX_DEPENDENCY_SELECTOR env var."""
25-
selector = os.environ.get("TFX_DEPENDENCY_SELECTOR")
26-
if selector == "UNCONSTRAINED":
27-
return ""
28-
elif selector == "NIGHTLY" and nightly is not None:
29-
return nightly
30-
elif selector == "GIT_MASTER" and git_master is not None:
31-
return git_master
32-
else:
33-
return default
23+
"""Select dependency constraint based on TFX_DEPENDENCY_SELECTOR env var."""
24+
selector = os.environ.get('TFX_DEPENDENCY_SELECTOR')
25+
if selector == 'UNCONSTRAINED':
26+
return ''
27+
elif selector == 'NIGHTLY' and nightly is not None:
28+
return nightly
29+
elif selector == 'GIT_MASTER' and git_master is not None:
30+
return git_master
31+
else:
32+
return default
3433

3534

3635
# Get version from version module.
37-
with open("tensorflow_transform/version.py") as fp:
38-
globals_dict = {}
39-
exec(fp.read(), globals_dict) # pylint: disable=exec-used
40-
__version__ = globals_dict["__version__"]
36+
with open('tensorflow_transform/version.py') as fp:
37+
globals_dict = {}
38+
exec(fp.read(), globals_dict) # pylint: disable=exec-used
39+
__version__ = globals_dict['__version__']
4140

4241

4342
def _make_required_install_packages():
44-
# Make sure to sync the versions of common dependencies (absl-py, numpy, and
45-
# protobuf) with TF and pyarrow version with tfx-bsl.
46-
return [
47-
"absl-py>=0.9,<2.0.0",
48-
'apache-beam[gcp]>=2.53,<3;python_version>="3.11"',
49-
'apache-beam[gcp]>=2.50,<2.51;python_version<"3.11"',
50-
"numpy>=1.22.0",
51-
'protobuf>=4.25.2,<6.0.0;python_version>="3.11"',
52-
'protobuf>=4.21.6,<6.0.0;python_version<"3.11"',
53-
"pyarrow>=10,<11",
54-
"pydot>=1.2,<2",
55-
"tensorflow>=2.17,<2.18",
56-
"tensorflow-metadata"
57-
+ select_constraint(
58-
default=">=1.17.1,<1.18.0",
59-
nightly=">=1.18.0.dev",
60-
git_master="@git+https://github.com/tensorflow/metadata@master",
61-
),
62-
"tf_keras>=2",
63-
"tfx-bsl"
64-
+ select_constraint(
65-
default=">=1.17.1,<1.18.0",
66-
nightly=">=1.18.0.dev",
67-
git_master="@git+https://github.com/tensorflow/tfx-bsl@master",
68-
),
69-
]
70-
43+
# Make sure to sync the versions of common dependencies (absl-py, numpy, and
44+
# protobuf) with TF and pyarrow version with tfx-bsl.
45+
return [
46+
'absl-py>=0.9,<2.0.0',
47+
'apache-beam[gcp]>=2.53,<3;python_version>="3.11"',
48+
'apache-beam[gcp]>=2.50,<2.51;python_version<"3.11"',
49+
'numpy>=1.22.0',
50+
'protobuf>=4.25.2,<6.0.0;python_version>="3.11"',
51+
'protobuf>=4.21.6,<6.0.0;python_version<"3.11"',
52+
'pyarrow>=10,<11',
53+
'pydot>=1.2,<2',
54+
'tensorflow>=2.17,<2.18',
55+
'tensorflow-metadata'
56+
+ select_constraint(
57+
default='>=1.17.1,<1.18.0',
58+
nightly='>=1.18.0.dev',
59+
git_master='@git+https://github.com/tensorflow/metadata@master',
60+
),
61+
'tf_keras>=2',
62+
'tfx-bsl'
63+
+ select_constraint(
64+
default='>=1.17.1,<1.18.0',
65+
nightly='>=1.18.0.dev',
66+
git_master='@git+https://github.com/tensorflow/tfx-bsl@master',
67+
),
68+
]
7169

7270
def _make_docs_packages():
73-
return [
74-
req
75-
for req in Path("./requirements-docs.txt")
76-
.expanduser()
77-
.resolve()
78-
.read_text()
79-
.splitlines()
80-
if req
81-
]
71+
return [
72+
req for req in Path("./requirements-docs.txt")
73+
.expanduser()
74+
.resolve()
75+
.read_text()
76+
.splitlines()
77+
if req
78+
]
8279

8380

8481
# Get the long description from the README file.
85-
with open("README.md") as fp:
86-
_LONG_DESCRIPTION = fp.read()
82+
with open('README.md') as fp:
83+
_LONG_DESCRIPTION = fp.read()
8784

8885
setup(
89-
name="tensorflow-transform",
86+
name='tensorflow-transform',
9087
version=__version__,
91-
author="Google Inc.",
92-
author_email="[email protected]",
93-
license="Apache 2.0",
88+
author='Google Inc.',
89+
author_email='[email protected]',
90+
license='Apache 2.0',
9491
classifiers=[
95-
"Development Status :: 5 - Production/Stable",
96-
"Intended Audience :: Developers",
97-
"Intended Audience :: Education",
98-
"Intended Audience :: Science/Research",
99-
"License :: OSI Approved :: Apache Software License",
100-
"Operating System :: OS Independent",
101-
"Programming Language :: Python",
102-
"Programming Language :: Python :: 3",
103-
"Programming Language :: Python :: 3.9",
104-
"Programming Language :: Python :: 3.10",
105-
"Programming Language :: Python :: 3.11",
106-
"Programming Language :: Python :: 3 :: Only",
107-
"Topic :: Scientific/Engineering",
108-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
109-
"Topic :: Scientific/Engineering :: Mathematics",
110-
"Topic :: Software Development",
111-
"Topic :: Software Development :: Libraries",
112-
"Topic :: Software Development :: Libraries :: Python Modules",
92+
'Development Status :: 5 - Production/Stable',
93+
'Intended Audience :: Developers',
94+
'Intended Audience :: Education',
95+
'Intended Audience :: Science/Research',
96+
'License :: OSI Approved :: Apache Software License',
97+
'Operating System :: OS Independent',
98+
'Programming Language :: Python',
99+
'Programming Language :: Python :: 3',
100+
'Programming Language :: Python :: 3.9',
101+
'Programming Language :: Python :: 3.10',
102+
'Programming Language :: Python :: 3.11',
103+
'Programming Language :: Python :: 3 :: Only',
104+
'Topic :: Scientific/Engineering',
105+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
106+
'Topic :: Scientific/Engineering :: Mathematics',
107+
'Topic :: Software Development',
108+
'Topic :: Software Development :: Libraries',
109+
'Topic :: Software Development :: Libraries :: Python Modules',
113110
],
114111
namespace_packages=[],
115112
install_requires=_make_required_install_packages(),
116-
extras_require={
117-
"test": ["pytest>=8.0"],
118-
"docs": _make_docs_packages(),
113+
extras_require= {
114+
'test': ['pytest>=8.0'],
115+
'docs': _make_docs_packages(),
119116
},
120-
python_requires=">=3.9,<4",
117+
python_requires='>=3.9,<4',
121118
packages=find_packages(),
122119
include_package_data=True,
123-
package_data={"tensorflow_transform": ["py.typed"]},
120+
package_data={'tensorflow_transform': ['py.typed']},
124121
data_files=[("docs_reqs", ["requirements-docs.txt"])],
125-
description="A library for data preprocessing with TensorFlow",
122+
description='A library for data preprocessing with TensorFlow',
126123
long_description=_LONG_DESCRIPTION,
127-
long_description_content_type="text/markdown",
128-
keywords="tensorflow transform tfx",
129-
url="https://www.tensorflow.org/tfx/transform/get_started",
130-
download_url="https://github.com/tensorflow/transform/tags",
131-
requires=[],
132-
)
124+
long_description_content_type='text/markdown',
125+
keywords='tensorflow transform tfx',
126+
url='https://www.tensorflow.org/tfx/transform/get_started',
127+
download_url='https://github.com/tensorflow/transform/tags',
128+
requires=[])

0 commit comments

Comments
 (0)