If I run pip install -e . in project it all appears to work. However, I cannot import pkg. I assume that’s because the pkg-egg.link file points at project and I have the pkg dir in src not directly parallel to setup.py. Is there a way to control where the egg-info is placed and where the link file points?
My setup.py looks like
from setuptools import setup, find_packages
def main():
setup(
name="pkg",
version='0.0.0',
license="BSD license (see license.txt for details)",
description="A dummy thing",
long_description="""A dummy thing for testing only""",
author="Modified gluons",
author_email="nobody@nowhere.org",
url="https://python.org/",
packages = find_packages("src"),
package_dir = {'pkg': "src/pkg"},
package_data = {'pkg':[
'00README.txt',
],
},
)
if __name__=='__main__':
main()
If I put a pth file in site-packages pointing at project/src then everything appears to work.
I’ve been using python for long time and my real setup.py has a lot more than just the build instructions. I find it strange that python prefers to offload its packaging to third party packages.
Perhaps the lack of a clear simple standard way to do distribution has led to the multiple ways of doing stuff.
Looking in my array of python builds I find only 3.12.0a1 has tomlib. So I suppose setup.py will have to endure for a while longer.
Luckily I am getting too old to worry much about this. Explicitly installing the required build tools is very easy and obvious; I will stick with that.