Abhishek Patil
Abhishek Patil

Reputation: 1445

Add other files in Python distribution

I am working on a project which I have to share as a standalone SDK with my team. For some reason files other than *.py are not being added to my distribution file

My project structure is as given below

enter image description here

My Setup.py is like this

import setuptools
from glob import glob
from os.path import basename
from os.path import splitext

with open("README.md", "r") as fh:
    long_description = fh.read()

with open('requirements.txt') as f:
    install_requires = f.read().splitlines()[2:]

with open('requirements-dev.txt') as f:
    tests_require = f.read().splitlines()[2:]

extras = {
    'test': tests_require,
}

setuptools.setup(
    name='eu-taxonomy-sdk',
    version='0.0.2',
    author='Bhushan Fegade',
    author_email='[email protected]',
    description='a calculation library for eu-taxonomy',
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='https://msstash.morningstar.com/scm/dataapi/eu-taxonomy-sdk.git',
    packages=setuptools.find_packages(where='src'),
    package_dir={'': 'src'},
    package_data={'eu-taxonomy-sdk': [ 'config/*', 'category/config/*' ]},
    py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
    license='Apache Software License',
    classifiers=[
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
    ],
    install_requires=install_requires,
    python_requires='~=3.8',
    tests_require=tests_require,
    extras_require=extras,
    test_suite='tests'
)

I am using the following commands to generate a distributable file

python setup.py build
python setup.py sdist

I have tried making some changes in the setup.py file but the distributable file inside the config folder is always empty with only the init.py file and no other file is present.

I want to know if there is a way to keep those other files(CSV, parq) in the final distributable file.

Upvotes: 0

Views: 51

Answers (1)

AKX
AKX

Reputation: 169407

Add a MANIFEST.in file that describes the files you need included.

E.g.

recursive-include src *.csv *.parq

Upvotes: 1

Related Questions