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.
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:
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?
In setup.py
:
py_modules
is used for " top-level modules ":
packages
is for packages :
there is a difference between "python modules" and "python packages"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.