0

I have tried all the option available on stackoverflow, still could not get etc directory to get copied to install path with setup.py install command. I have code in below structure.

├── setup.py
├── MANIFEST.in
├── etc/
│   ├── config.yaml
│   └── message.xml
└── src/
    └── my-app/
        ├── __init__.py
        └── main.py

I am using setuptools version 65.6.3 with python 3.7.5

setup.py

import setuptools

setuptools.setup(
  name='my-app',
  version='0.1',
  package_dir=("","src"),
  packages=setuptools.find_packages("src"),
  include_package_data=True,
  entry_points={
    "console_scripts":[
        "my_main = my-app.main:main"
     ]
  })

MANIFEST.in

recursive-include etc *.yml *.xml

I have also tried below in MANIFEST

include etc/*.yml
include etc/*.xml
tempuser
  • 1,517
  • 3
  • 11
  • 15

1 Answers1

0

First, you can not have an importable package named my-app with a dash -, because it is not a valid name in Python. If I were you I would rename src/my-app to src/my_app with an underscore _. On the other hand you can (you should) keep the project name as my-app. The project name is what you "pip-install", and the package name is what you import (see here for some more details).

Then, "package data" has to be part of an importable package. So if I were you, I would move etc to src/my_app/etc.

Look at this other answer for example:

sinoroc
  • 18,409
  • 2
  • 39
  • 70