Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move optional dependencies to extras #454

Merged
merged 26 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 22 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
10 changes: 9 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ Installation
------------
::

pip install smart_open
pip install smart_open // Install with no cloud dependencies
pip install smart_open[aws] // Install AWS deps
pip install smart_open[gcp] // Install GCP deps
pip install smart_open[all] // Installs all cloud dependencies

Or, if you prefer to install from the `source tar.gz <http://pypi.python.org/pypi/smart_open>`_::

Expand All @@ -122,6 +125,11 @@ The tests are also run automatically with `Travis CI <https://travis-ci.org/RaRe

If you're upgrading from ``smart_open`` versions 1.8.0 and below, please check out the `Migration Guide <MIGRATING_FROM_OLDER_VERSIONS.rst>`_.

Version ``2.0`` will introduce a backwards incompatible installation method with regards to the cloud dependencies. A migration path to minimize breaking
was introduced in version ``x.x.x``. If you want to maintain backwards compatibility (installing all dependencies) install this package via ``smart_open[all]`` now
and once the change is made you should not have any issues. If all you care about is AWS dependencies for example you can install via ``smart_open[aws]`` and
once the dependency change is made you will simply drop the unwanted dependencies. You can read more about the motivations `here <https://github.com/RaRe-Technologies/smart_open/issues/443>`_


Built-in help
-------------
Expand Down
15 changes: 12 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ def read(fname):

install_requires = [
'requests',
'boto3',
'google-cloud-storage',
]

aws_deps = ['boto3']
gcp_deps = ['google-cloud-storage']

all_deps = install_requires + aws_deps + gcp_deps
mpenkov marked this conversation as resolved.
Show resolved Hide resolved

setup(
name='smart_open',
version=__version__,
Expand All @@ -81,10 +84,16 @@ def read(fname):
license='MIT',
platforms='any',

install_requires=install_requires,
# Concatenating the lists together is temporary and will
# eventually simply be install_requires dropping the cloud
# dependencies from being installed without explicitly being declared.
install_requires=install_requires + aws_deps + gcp_deps,
mpenkov marked this conversation as resolved.
Show resolved Hide resolved
tests_require=tests_require,
extras_require={
'test': tests_require,
'aws': aws_deps,
'gcp': gcp_deps,
'all': all_deps,
},

test_suite="smart_open.tests",
Expand Down