Skip to content

Commit

Permalink
Adding a --minimal-deps switch to setup.py
Browse files Browse the repository at this point in the history
This switch results in a build of a package named `petastorm_min_deps`. It has no dependencies that conflict with ATG internal package versions.
  • Loading branch information
Yevgeni Litvin committed Aug 6, 2018
1 parent dc07118 commit 7ec1fb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ script:
before_deploy:
# Build a python wheel before deployment
- python setup.py bdist_wheel
- python setup.py bdist_wheel --minimal-deps

deploy:
# Push all python wheels created to Github release (TODO: when public to Pypi)
Expand Down
21 changes: 16 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# 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.
import sys

import setuptools
from setuptools import setup
Expand All @@ -26,19 +27,29 @@
# Once there is 0.10, we'll be able to use stock, non-atg version.
]

PACKAGE_NAME = 'petastorm'

if '--minimal-deps' not in sys.argv:
PACKAGE_NAME += '_min_deps'
REQUIRED_PACKAGES += [
'opencv-python>=3.2.0.6',
'pyarrow>=0.8' # TODO(yevgeni): once ATG goes to stock 0.10 (instead of atg-pyarrow=0.9.0.1), we
# make the require mandatory.
]
else:
sys.argv.remove('--minimal-deps')



EXTRA_REQUIRE = {
'opencv': ['opencv-python>=3.2.0.6'],
'pyarrow': ['pyarrow>=0.8'], # TODO(yevgeni): once ATG goes to stock 0.10 (instead of atg-pyarrow=0.9.0.1), we
# make the require mandatory.
'tf': ['tensorflow>=1.4.0'],
'tf_atg': ['atg-tensorflow-gpu>=1.4.0'],
'tf_gpu': ['tensorflow-gpu>=1.4.0'],
}

packages = setuptools.find_packages()

setup(
name='petastorm',
name=PACKAGE_NAME,
version=__version__,
install_requires=REQUIRED_PACKAGES,
packages=packages,
Expand Down

0 comments on commit 7ec1fb4

Please sign in to comment.