0

I'm building a Python application which I'm packaging with setuptools, so when it is installed I would like it to be available as command line tool as mentioned https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html

This application is dependent on few files (both python and non-python file like yml). Currently, I'm adding these also as part of "scripts" keyword in setup.py. Is there any better way of handling this?

I'm using "scripts" keyword in setup.py so that when we install the package, setuptools will copy the script to our PATH and make it available for general use

setup(name='python-app',
      version='0.1.0',
      description='Python App',
      python_requires='>=3.9',
      packages=find_packages(),
      scripts=['python-app.py', 'dependent-python.py', 'dependent-yaml.yml']
     )

This works just fine but I see dependent files are also available for general use at system level. Is there any better way of doing it?

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Ashu
  • 21
  • 5
  • 1
    You need to add those files as so-called ["package data"](https://setuptools.pypa.io/en/latest/userguide/datafiles.html). – sinoroc Dec 09 '22 at 09:54
  • https://stackoverflow.com/search?q=%5Bsetuptools%5D+add+data – phd Dec 09 '22 at 10:10

0 Answers0