1

I created a package and I wanted to upload it to pypi. The structure of files is like this:

AAA
├── AAA
│   ├── AAA.py
│   ├── BBB.py
│   ├── CCC.py
│   ├── __init__.py
│   └── DDD.py
│
├── data
│   ├── table2.json
│   └── table2.json
│
├── LICENSE.txt
├── README.md
└── setup.py

I used python3 setup.py sdist and twine upload dist/* to upload the package into pypi. But when I installed my own package there was not any data folder. I came back to dist folder but again there was not any data folder in the AAA.tar.gz.

I'm confused what am I doing wrong?

Asdoost
  • 316
  • 1
  • 2
  • 15
  • 1
    Did you configure package data? https://docs.python.org/3/distutils/setupscript.html#installing-package-data – Gonzalo Odiard Oct 25 '21 at 22:35
  • @GonzaloOdiard Thank you. I read the page than you sent and I added `package_dir={'AAA': 'AAA'}` to setup.py and it solved my problem. – Asdoost Oct 26 '21 at 12:52

1 Answers1

1

I used the following page suggested by @Gonzalo Odiard:

https://docs.python.org/3/distutils/setupscript.html#installing-package-data

First, I moved data folder to AAA folder and then I added package_dir={'AAA': 'AAA'} to setup.py and the problem was solved.

Asdoost
  • 316
  • 1
  • 2
  • 15