Skip to content

distutils docs: data_files always uses sys.prefix #69778

Closed

Description

@jdemeyer
BPO 25592
Nosy @pitrou, @merwok, @berkerpeksag, @jdemeyer, @dstufft
PRs
  • bpo-25592: improve documentation of data_files #9767
  • [3.7] bpo-25592: Improve documentation of distutils data_files (GH-9767) #11701
  • [3.7] bpo-25592: Improve documentation of distutils data_files (GH-9767) #11701
  • [3.7] bpo-25592: Improve documentation of distutils data_files (GH-9767) #11701
  • [2.7] bpo-25592: Improve documentation of distutils data_files (GH-9767) #11734
  • [2.7] bpo-25592: Improve documentation of distutils data_files (GH-9767) #11734
  • [2.7] bpo-25592: Improve documentation of distutils data_files (GH-9767) #11734
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-02-02.10:16:29.281>
    created_at = <Date 2015-11-10.06:06:12.564>
    labels = ['3.7', '3.8', 'type-bug', 'library', 'docs']
    title = 'distutils docs: data_files always uses sys.prefix'
    updated_at = <Date 2019-02-02.10:17:12.823>
    user = 'https://github.com/jdemeyer'

    bugs.python.org fields:

    activity = <Date 2019-02-02.10:17:12.823>
    actor = 'pitrou'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-02-02.10:16:29.281>
    closer = 'pitrou'
    components = ['Distutils', 'Documentation']
    creation = <Date 2015-11-10.06:06:12.564>
    creator = 'jdemeyer'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 25592
    keywords = ['patch']
    message_count = 21.0
    messages = ['254432', '327403', '327407', '327408', '327412', '327413', '327415', '327416', '327455', '334492', '334511', '334565', '334566', '334567', '334568', '334607', '334619', '334698', '334700', '334740', '334741']
    nosy_count = 6.0
    nosy_names = ['pitrou', 'eric.araujo', 'docs@python', 'berker.peksag', 'jdemeyer', 'dstufft']
    pr_nums = ['9767', '11701', '11701', '11701', '11734', '11734', '11734']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25592'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']

    Activity

    1. jdemeyer commented on Nov 10, 2015

      @jdemeyer
      ContributorAuthor

      The documentation for distutils claims that sys.exec_prefix is used in certain cases to install data_files, but this is simply not true (maybe it was true in the past or this sentence was copy/pasted from somewhere else?)

    2. added
      docs
      on Nov 10, 2015
    3. added
      stdlib
      type-bug
      on May 28, 2016
    4. merwok commented on Oct 9, 2018

      @merwok
      Member

      If you’re not sure about the reason for that sentence, I think you should not remove it from the docs but investigate more (look at the history, test the conditions (package with extension module), etc).

    5. jdemeyer commented on Oct 9, 2018

      @jdemeyer
      ContributorAuthor

      If you’re not sure about the reason for that sentence, I think you should not remove it from the docs

      If the docs are wrong, their history doesn't matter that much: the docs should be fixed regardless.

      test the conditions (package with extension module)

      I did that before posting this bug report. I also looked at the distutils sources. I couldn't find any evidence that data_files are ever installed in sys.exec_prefix.

    6. jdemeyer commented on Oct 9, 2018

      @jdemeyer
      ContributorAuthor

      Just for fun, let's look at the history. That piece of documentation goes back to

      commit 632bda3
      Author: Fred Drake <fdrake@acm.org>
      Date: Fri Mar 8 22:02:06 2002 +0000

      Add more explanation of how data_files is used (esp. where the files end up
      in the installation and how that location is determined).
      

      I haven't tried to compile that Python version from 2002 but the distutils sources from that time look quite close to what they are today (scary, no?). So my gut feeling is that those docs were wrong even at the time that they were written.

    7. jdemeyer commented on Oct 9, 2018

      @jdemeyer
      ContributorAuthor

      There is also

      commit fa2f4b6
      Author: Greg Ward <gward@python.net>
      Date: Sat Jun 24 17:22:39 2000 +0000

      Changed the default installation directory for data files (used by
      the "install_data" command to the installation base, which is usually just
      sys.prefix.  (Any setup scripts out there that specify data files will have
      to set the installation directory, relative to the base, explicitly.)
      

      with commit message stating that data_files are installed in sys.prefix.

    8. merwok commented on Oct 9, 2018

      @merwok
      Member

      If the docs are wrong, their history doesn't matter that much

      What I was saying is that I am not sure that the docs are wrong.

      Distutils is more touchy that the rest of the stdlib and I err on the side of caution.

    9. jdemeyer commented on Oct 9, 2018

      @jdemeyer
      ContributorAuthor

      Well, I did try it on a minimal Python project. I also read the distutils sources and understood why it installs data_files in sys.prefix by default. So what more do you need to be convinced?

    10. merwok commented on Oct 9, 2018

      @merwok
      Member

      Did you try with a minimal project containing a C extension?

      Did you install in a system where sys.prefix != sys.exec_prefix?

    11. jdemeyer commented on Oct 10, 2018

      @jdemeyer
      ContributorAuthor

      Did you try with a minimal project containing a C extension?
      Did you install in a system where sys.prefix != sys.exec_prefix?

      Yes to both questions.

    12. added
      3.7 (EOL)
      3.8 (EOL)
      on Jan 28, 2019
    13. 1 remaining item

    14. jdemeyer commented on Jan 29, 2019

      @jdemeyer
      ContributorAuthor

      it seems that Jeroen's analysis is right.

      So would you be willing to merge the PR then?

    15. pitrou commented on Jan 30, 2019

      @pitrou
      Member

      New changeset 598e15d by Antoine Pitrou (jdemeyer) in branch 'master':
      bpo-25592: Improve documentation of distutils data_files (GH-9767)
      598e15d

    16. merwok commented on Jan 30, 2019

      @merwok
      Member

      Thanks for the analysis and PR! Sorry that the slow process here was frustrating.

    17. pitrou commented on Jan 30, 2019

      @pitrou
      Member

      New changeset ebae1ce by Antoine Pitrou (Miss Islington (bot)) in branch '3.7':
      bpo-25592: Improve documentation of distutils data_files (GH-9767) (GH-11701)
      ebae1ce

    18. pitrou commented on Jan 30, 2019

      @pitrou
      Member

      Fixing this on 2.7 would require additional investigation (distutils might have diverged), so I'm closing now.

    19. jdemeyer commented on Jan 31, 2019

      @jdemeyer
      ContributorAuthor

      Fixing this on 2.7 would require additional investigation (distutils might have diverged)

      Let's be honest, we are talking about distutils here. So it's way more likely that it didn't diverge and that the behavior is exactly the same on 2.7 and 3.8. So I would suggest to backport it to 2.7 also.

    20. reopened this on Jan 31, 2019
    21. pitrou commented on Jan 31, 2019

      @pitrou
      Member

      Jeroen you're right. Could you still give it a quick check? Then I'll mark the PR for a 2.7 backport.

    22. jdemeyer commented on Feb 1, 2019

      @jdemeyer
      ContributorAuthor

      Could you still give it a quick check?

      I did just that. For reference, these are the steps:

      • Checkout the "2.7" branch of the cpython git repo
      • ./configure --prefix=/tmp/prefix --exec-prefix=/tmp/eprefix && make && make install
      • Install pip (https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py)
      • /tmp/prefix/pip install --no-deps --verbose pari_jupyter # This requires the PARI/GP library to be installed
      • Note that all Jupyter stuff is installed in /tmp/prefix/share/jupyter while the directory /tmp/eprefix/share does not exist
    23. jdemeyer commented on Feb 1, 2019

      @jdemeyer
      ContributorAuthor

      (note typo in the above: /tmp/prefix/pip should be /tmp/prefix/bin/pip)

    24. pitrou commented on Feb 2, 2019

      @pitrou
      Member

      New changeset 40a101d by Antoine Pitrou (Miss Islington (bot)) in branch '2.7':
      bpo-25592: Improve documentation of distutils data_files (GH-9767) (GH-11734)
      40a101d

    25. pitrou commented on Feb 2, 2019

      @pitrou
      Member

      Ok, this is now pushed to 2.7 as well. Thank you Jeroen!

    26. transferred this issue fromon Apr 10, 2022
    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

      3.7 (EOL)3.8 (EOL)docsstdlibtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions