8

I have the following directory structure (pretty standard for a python distribution):

/some_dir
  /common
    file1.dat
    file2.dat
  /src
    pkg1/
      __init__.py
      stuff.py
    setup.py

What I want to achieve is package both pkg1 and common into the same python egg. The setup.py file is pretty standard (auto discover packages) and pkg1 is properly included, unfortunately I can't say the same about common. I tried many things, like package_data, package_data_files, package_dir, etc. Nothing seems to work. How can I achieve this?

I'm also not keen on keeping this structure, but I do need those files into a common directory, because I have to generate nodejs, python and java libraries that include them, thus moving the common/ directory inside python is not an option.

1
  • 1
    The correct name is data_files, not package_data_files. Commented Jun 13, 2018 at 18:14

1 Answer 1

1

I think you should use a MANIFEST.in file and set include_package_data to True to register all the files you want to bundle with your package.

https://setupy.info/ gives a pretty good overview of all the options you might need.

Sign up to request clarification or add additional context in comments.

1 Comment

unfortunately, that does not work. MANIFEST.in need to be defined next to setup.py, and can't properly include directories/files from upper path (it works, but it's copied in a wrong location).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.