Python Package does not get created in site-packages folder

Viewed 938

I'm trying to create a PyPi package for my graphics framework Goopylib (https://github.com/BhavyeMathur/goopylib), and it is working for the most part.

All the package files are being created when I try to pip install my package - the only problem is that these package files are not being created in a directory of their own, rather just in the site-packages directory.

enter image description here

enter image description here

In these 2 screenshots, you can see that package files like the 'math' folder or the GraphWin.py file are being created in the site-packages folder and not a folder of their own.

Here what I would want my code to be organized like with the goopylib folder being inside the site-packages folder:

enter image description here

Here is my setup file:

from setuptools import setup

setup(
    name='goopylib',
    package_dir={'': 'goopylib', ':math': 'goopylib/math', ":objects": 'goopylib/objects'},
    py_modules=['imports', 'colours', 'constants', 'GraphWin', 'Point', 'styles', 'util',
                'math/BezierCurve', 'math/BSpline', 'math/Interpolations',
                'objects/_BBox', 'objects/Arc', 'objects/Button', 'objects/Checkbox', 'objects/Circle',
                'objects/CycleButton', 'objects/Entry', 'objects/GraphicsObject', 'objects/Image',
                'objects/Line', 'objects/Oval', 'objects/Polygon', 'objects/RadioButton',
                'objects/Rectangle', 'objects/Slider', 'objects/Text'],
    version='1.0.7a5',
    license='MIT License',

    description='A simple-yet-powerful 2D graphics framework built on top of Tkinter capable of creating good-looking, modern GUIs, games, and simple animations.',

    classifiers=[...]
)

and I am running these commands to create the packages and upload to PyPi

python setup.py bdist_wheel

and

twine upload dist/*

Why is this happening and how can I make sure that all my package & sub-package files are located in one folder?

2 Answers

there is a difference between "python modules" and "python packages"

Related