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

Deprecate and remove 'Features' #65

Open
bb-migration opened this Issue Aug 11, 2013 · 14 comments

Comments

Projects
None yet
1 participant
@bb-migration

bb-migration commented Aug 11, 2013

Originally reported by: jaraco (Bitbucket: jaraco, GitHub: jaraco)


In #58, it comes to my attention that the Features implementation is incomplete and should be removed.


@bb-migration

This comment has been minimized.

bb-migration commented Aug 11, 2013

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


In 741d1f64ba40, I've officially deprecated the Features functionality with the intention of removing it in a future release.

@bb-migration

This comment has been minimized.

bb-migration commented Aug 15, 2013

Original comment by Merwok (Bitbucket: Merwok, GitHub: Merwok):


The warnings.warn call should use the stacklevel argument to let Python display the right calling source file.

@bb-migration

This comment has been minimized.

bb-migration commented Aug 15, 2013

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Excellent idea.

@bb-migration

This comment has been minimized.

bb-migration commented Aug 16, 2013

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


I set the stacklevel to 3 in 6a7c54c2c48f. I believe that's the most useful stacklevel (although it's difficult to know exactly what stacklevel will be appropriate).

@bb-migration

This comment has been minimized.

bb-migration commented Aug 16, 2013

Original comment by Merwok (Bitbucket: Merwok, GitHub: Merwok):


It’s easy to test: use Feature in a setup.py script, run it, see that the warning shows the line from setup.py, not setuptools.

@bb-migration

This comment has been minimized.

bb-migration commented Feb 9, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Removed Features functionality. Fixes #65.

@bb-migration

This comment has been minimized.

bb-migration commented Mar 6, 2014

Original comment by mitsuhiko (Bitbucket: mitsuhiko, GitHub: mitsuhiko):


Just as a general hint, the following packages are broken through this change:

  • SQLAlchemy (it now thinks setuptools is unavailable and installs through distutils)
  • MarkupSafe
  • PyProtocols
  • cffi
  • pymongo

And that's just packages I found on a quick github code search.

Why was this change done?

@bb-migration

This comment has been minimized.

bb-migration commented Mar 6, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


The very first link in this ticket to #58 explains the rationale.

@bb-migration

This comment has been minimized.

bb-migration commented Mar 6, 2014

Original comment by haypo (Bitbucket: haypo, GitHub: haypo):


Related issue in OpenStack:
https://review.openstack.org/#/c/78701/

@bb-migration

This comment has been minimized.

bb-migration commented Mar 8, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


7306814c7297 re-opens this issue.

@bb-migration

This comment has been minimized.

bb-migration commented Mar 8, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


In the discussion following the unsuccessful release of 3.0, some use-cases of features were discovered that may not be obviated by use of extras. Namely, extras are always opt-in while features enabled opt-in and opt-out.

Consider SQLAlchemy, which exposes a Feature for it's C-extension speedups. The default build process includes the C-extension and then a particular user or environment can opt-opt with --without-cextension.

The recommended way to use extras for this purpose would be to create a separate package for the c extension, then reference that additional package as an 'extra'. This mechanism, however, would require that users of SQLAlchemy would need to update their requirements to include SQLAlchemy[cext] to retain the default behavior.

There's no way SQLAlchemy to declare that 'cext' is a preferred inclusion or for a user to exclude the dependency explicitly.

On the other hand, having the speedups defined in a separate package gives installer, deployment, and packaging tools more control over which features are present. A tool can quickly assess the presence (or absence) of speedups if they're defined in a separate package.

I think the benefits of using extras outweigh the loss of control with opt-out Features, but I'll explore this concept with the SQLAlchemy project.

Interestingly, every example of the use of Features has been for the inclusion or exclusion of compiled C extensions. Perhaps that's an indication of a different need relating to compiled extensions.

@bb-migration

This comment has been minimized.

bb-migration commented Apr 7, 2014

Original comment by aratto (Bitbucket: aratto, GitHub: aratto):


The link printed out by the warning is broken (missing '/issue/' in path).

Just to provide a new usage example: I am using features to opt-in and install testing dependencies. (setup.py --with-testing develop)

@bb-migration

This comment has been minimized.

bb-migration commented Aug 25, 2014

Original comment by marscher (Bitbucket: marscher, GitHub: marscher):


I'am one of the maintainers of Jpype1 and want to distribute a new "Feature", which depends on the presence of Numpy. I need to define a macro and set numpy as additional include_dir for extension building. Currently the setup script checks, if Numpy is importable and sets those things. But by doing so, it's not possible to disable the feature.

So I've tried to define it via extras_require, but then I have no clue how to determine, if setup is being called with "[numpy]" extra or not and change the Distribution class accordingly.

I would really appreciate any hint of solving this problem!
Thanks!

@bb-migration

This comment has been minimized.

bb-migration commented Jul 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment