Skip to content

Badly behaving setup.py  #10583

Open
Open

Description

@tysonclugg

Changing distribution metadata (such as install_requires) in setup.py according to some vague ideas on how (pip|setuptools|...) works is a horrid idea. More specifically, try this:

  1. Use pip-tools (version 1.9 or later) to compile the following requirements.in on OSX:
ipython
  1. Note that appnope (only useful on OSX) is included in the resulting requirements.txt, without any environment markers - it should be only for :sys_platform == "darwin".

I'll put together two PRs (one for master, the other for 5.x) that limits the insanity to old versions of pip (<6).

Activity

  1. Carreau commented on May 23, 2017

    @Carreau
    Member

    I'll put together two PRs (one for master, the other for 5.x) that limits the insanity to old versions of pip (<6).

    If you have pip <6 anyway IPython will likely fails to install (mostly on python 2) as pi will download IPython 6 and try to install it while it's not compatible. So I think that expecting users to have a recent pip is reasonable.

    Happy to get a PR making things better though. Don't spend too much time on a PR for 5.x if the PR for master does not conflict, our bot will be able to auto backport.

    Thanks !

  2. tysonclugg commented on May 24, 2017

    @tysonclugg
    Author

    Tahnks @Carreau - does this mean that we can abort the setup if we detect ancient versions of pip, showing a big fat warning pointing back to this issue?

  3. Carreau commented on May 24, 2017

    @Carreau
    Member

    If you install 6.0 on Python 2 is does already do that with a big:
    "UPGRADE PIP", ok maybe not uppercase,
    but AFAICT IPython download on pip < 6 are low. (I need to rerun that with all the pip versions, but at least you can see the code that did it).

    There is still pip 1.6 around because that's what ubuntu 16.04 LTS has, so failing on critically old pip with a reason why and tell users to upgrade pip is (I think) something to consider.

    I'm obviously not the only one to decide, but It might be a reasonable thing to do.

  4. takluyver commented on May 24, 2017

    @takluyver
    Member

    I'm not sure there's a 100% reliable way to tell what version of pip is running the installation (import pip might get you a different version to the one in use), so I would be a bit wary of trying to be clever with detecting the version.

    There is still pip 1.6 around because that's what ubuntu 16.04 LTS has

    No, 16.04 has pip 8 by default, and that's new enough to warn you that newer versions are available. 14.04, which is still supported, has pip 1.5 if users haven't got a newer version from another source. You can check info like this on the web:
    https://packages.ubuntu.com/search?keywords=python3-pip&searchon=names&suite=all&section=all

  5. modified the milestone: wishlist on May 24, 2017
  6. spankratov commented on Apr 27, 2021

    @spankratov

    Hi, I stumbled upon the issue with appnope and pip-tools and want to contribute. Would it be reasonable to add platform environment marker for each platform dependent package (pexpect, appnope, colorama) in both install_requires and extras_require? For example, ; sys_platform == "darwin" for appnope

  7. Carreau commented on Apr 27, 2021

    @Carreau
    Member

    Hi, I stumbled upon the issue with appnope and pip-tools and want to contribute. Would it be reasonable to add platform environment marker for each platform dependent package (pexpect, appnope, colorama) in both install_requires and extras_require? For example, ; sys_platform == "darwin" for appnope

    Yes, that would be reasonable, and in general reasonable to move away from setup.py to a pyproject.toml,
    but that might require some refactor of the directory structure. Any improvement/ simplification welcome.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions