Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79467 > unrolled thread

setuptools + data_files = 2

Started byluc2 <luc2@nospam.invalid>
First post2014-10-22 18:43 +0000
Last post2014-10-24 11:39 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  setuptools + data_files = 2 luc2 <luc2@nospam.invalid> - 2014-10-22 18:43 +0000
    Re: setuptools + data_files = 2 Simon Kennedy <sffjunkie@gmail.com> - 2014-10-23 06:36 -0700
      Re: setuptools + data_files = 2 luc2 <luc2@nospam.invalid> - 2014-10-24 11:39 +0000

#79467 — setuptools + data_files = 2

Fromluc2 <luc2@nospam.invalid>
Date2014-10-22 18:43 +0000
Subjectsetuptools + data_files = 2
Message-ID<5447fac2$0$2384$426a74cc@news.free.fr>
hello, would you know how to make data_files work in setuptools ?
i can't figure out how to put datas in the generated .tar.gz

$ find .
./hello
./hello/__init__.py
./share
./share/test_file.txt
./setup.py

$ cat ./hello/__init__.py
def hello():
    print( 'hello' )

$ cat ./share/test_file.txt
this is a test

$ cat ./hello/setup.py
from setuptools import setup, find_packages
setup(
    name = "Hello",
    version = "0.1",
    packages = find_packages(),
    data_files = [
        ( 'share', ['share/test_file.txt'] )
    ]
)

$ python setup.py sdist

$ tar tvf dist/Hello-0.1.tar.gz | grep test_file.txt

$ echo "no test_file.txt :-("

[toc] | [next] | [standalone]


#79513

FromSimon Kennedy <sffjunkie@gmail.com>
Date2014-10-23 06:36 -0700
Message-ID<7ec70158-2eab-4590-93a6-784ffc8538e4@googlegroups.com>
In reply to#79467
On Wednesday, 22 October 2014 19:43:25 UTC+1, luc2  wrote:
> hello, would you know how to make data_files work in setuptools ?
> i can't figure out how to put datas in the generated .tar.gz

If you're creating an sdist then you'll need to create a MANIFEST.in file in the same folder as setup.py with the following contents

    include share/test_file.txt

If you're creating a bdist (egg or wheel) the parameter name you need is

    package_data={'share': [share/test_file.txt]},

[toc] | [prev] | [next] | [standalone]


#79567

Fromluc2 <luc2@nospam.invalid>
Date2014-10-24 11:39 +0000
Message-ID<544a3a7d$0$2122$426a74cc@news.free.fr>
In reply to#79513
On 2014-10-23, Simon Kennedy <sffjunkie@gmail.com> wrote:

> If you're creating an sdist then you'll need to create a MANIFEST.in
> file in the same folder as setup.py with the following contents
>
>     include share/test_file.txt
>
> If you're creating a bdist (egg or wheel) the parameter name you need
> is
>
>     package_data={'share': [share/test_file.txt]},

thanks man.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web