Skip to content

Commit 9a85c78

Browse files
taiyacopybara-github
authored andcommitted
Updates to setup.py
PiperOrigin-RevId: 312001886
1 parent 87b6735 commit 9a85c78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+59
-384
lines changed

.bazelrc

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
build --verbose_failures
152
test --keep_going
163
test --build_tests_only

.flake8

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
[flake8]
152
inline-quotes = double
163
max-line-length = 88

.github/workflows/pythonapp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
pytest tensorflow_graphics
4141
- name: Install
4242
run: |
43-
python setup.py --compute_platform cpu sdist bdist_wheel
43+
python setup.py sdist bdist_wheel
4444
pip install dist/tensorflow_graphics*.whl
4545
- name: Test install
4646
run: |

.gitignore

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
**/__pycache__/
152
bazel-out
163
bazel-testlogs

.pylintrc

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
[MASTER]
152

163
# Specify a configuration file.

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ script:
3737
- export PYTHONPATH=$PWD:$PYTHONPATH
3838
- pytest tensorflow_graphics
3939
# --- build pip package (installs in python path)
40-
- python setup.py --compute_platform cpu sdist bdist_wheel --universal
40+
- python setup.py sdist bdist_wheel
4141
- pip install dist/tensorflow_graphics*.whl
4242
# --- test the pip package
4343
- cd $(mktemp -d) && python -c 'import tensorflow_graphics as tfg'

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ and debug your machine learning models of choice.
6161

6262
## Installing TensorFlow Graphics
6363

64-
See the [install](tensorflow_graphics/g3doc/install.md) documentation for instructions on how to
65-
install TensorFlow Graphics.
64+
See the [install](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/g3doc/install.md)
65+
documentation for instructions on how to install TensorFlow Graphics.
6666

6767
## API Documentation
6868

WORKSPACE

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
workspace(name = "tensorflow_graphics")
152

163
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

build_pip_pkg.sh

-31
This file was deleted.

pytest.ini

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
[pytest]
152
norecursedirs = tensorflow_graphics/rendering/opengl/tests tensorflow_graphics/submodules
163
python_files = *_test.py

requirements.txt

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
absl-py >= 0.6.1
152
h5py >= 2.10.0
163
matplotlib >= 2.2.5

setup.py

+20-58
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,32 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Setup for pip package."""
15-
from __future__ import absolute_import
16-
from __future__ import division
17-
from __future__ import print_function
14+
"""Setup for pip package.
15+
16+
Usage:
17+
python setup.py sdist bdist_wheel
18+
"""
19+
1820

1921
import os
2022
import sys
23+
import setuptools
2124

22-
from setuptools import find_packages
23-
from setuptools import setup
24-
25-
version_path = os.path.join(os.path.dirname(__file__), 'tensorflow_graphics')
26-
sys.path.append(version_path)
27-
from version import __version__ # pylint: disable=g-import-not-at-top
2825

29-
tensorflow_version = '1.13.1'
26+
def get_version():
27+
"""NOTE: assumes this file lives at the root of the project."""
28+
version_path = os.path.join(os.path.dirname(__file__), 'tensorflow_graphics')
29+
sys.path.append(version_path)
30+
from version import __version__ # pylint: disable=g-import-not-at-top
31+
return __version__
3032

3133
INSTALL_PACKAGES = [line.strip() for line in open('requirements.txt')]
3234
INSTALL_PACKAGES = [line for line in INSTALL_PACKAGES \
3335
if not line.startswith('#')]
3436

35-
if '--compute_platform' in sys.argv:
36-
compute_platform_idx = sys.argv.index('--compute_platform')
37-
compute_platform = sys.argv[compute_platform_idx + 1]
38-
sys.argv.remove('--compute_platform')
39-
sys.argv.pop(compute_platform_idx)
40-
else:
41-
compute_platform = 'none'
42-
43-
if compute_platform not in ('none', 'cpu', 'gpu'):
44-
sys.exit('Supported compute platforms are none, cpu, or gpu')
45-
46-
if compute_platform == 'cpu':
47-
INSTALL_PACKAGES.append('tensorflow >= ' + tensorflow_version)
48-
package_name = 'tensorflow-graphics'
49-
elif compute_platform == 'gpu':
50-
INSTALL_PACKAGES.append('tensorflow-gpu >= ' + tensorflow_version)
51-
package_name = 'tensorflow-graphics-gpu'
52-
else:
53-
package_name = 'tensorflow-graphics'
54-
55-
SETUP_PACKAGES = [
56-
'pytest-runner',
57-
]
58-
59-
TEST_PACKAGES = [
60-
'pytest',
61-
'pytest-mock',
62-
'python-coveralls',
63-
]
64-
65-
EXTRA_PACKAGES = {
66-
'test': TEST_PACKAGES,
67-
'tf': ['tensorflow >= ' + tensorflow_version],
68-
'tf-gpu': ['tensorflow-gpu >= ' + tensorflow_version],
69-
'tf-nightly': ['tf-nightly-2.0-preview'],
70-
'tf-nightly-gpu': ['tf-nightly-gpu-2.0-preview'],
71-
}
72-
73-
setup(
74-
name=package_name,
75-
version=__version__,
37+
setuptools.setup(
38+
name='tensorflow-graphics',
39+
version=get_version(),
7640
description=('A library that contains well defined, reusable and cleanly '
7741
'written graphics related ops and utility functions for '
7842
'TensorFlow.'),
@@ -81,21 +45,19 @@
8145
author='Google LLC',
8246
author_email='[email protected]',
8347
install_requires=INSTALL_PACKAGES,
84-
setup_requires=SETUP_PACKAGES,
85-
tests_require=TEST_PACKAGES,
86-
extras_require=EXTRA_PACKAGES,
87-
packages=find_packages(),
48+
packages=setuptools.find_packages(),
8849
classifiers=[
8950
'Development Status :: 5 - Production/Stable',
90-
'Programming Language :: Python :: 2',
9151
'Programming Language :: Python :: 3',
9252
'Topic :: Scientific/Engineering :: Mathematics',
9353
'Topic :: Scientific/Engineering :: Artificial Intelligence',
9454
],
9555
license='Apache 2.0',
9656
keywords=[
57+
'machine learning',
9758
'tensorflow',
9859
'graphics',
99-
'machine learning',
60+
'geometry',
61+
'3D',
10062
],
10163
)

tensorflow_graphics/submodules/README.md submodules/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ bibtex describing how to cite your work.
1616
If you have specific needs or requests, feel free to contact us at
1717
[email protected]; we would love to work with you to find a
1818
solution that fits your project!
19-

tensorflow_graphics/BUILD

-73
This file was deleted.

tensorflow_graphics/datasets/features/test_data/cube.obj

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
141
# cube.obj
152
#
163

0 commit comments

Comments
 (0)