I am trying to package a small Python 3.9 app in a .tar.gz software distribution file (aka "sdist").
My code has this structure:
my-code
PackageA
PackageB
Module1.py
__init__.py
__init__.py
setup.py
My setup.py file looks like this:
from setuptools import find_packages, setup
setup(
name="my-code",
version="0.1",
install_requires=[],
packages=find_packages(include=["PackageA.PackageB"]),
include_package_data=True,
description="My Code"
)
When I run python setup.py sdist --formats=gztar I successfully get a my-code-0.1.tar.gz file and I can see that it contains my .py files.
However, when I run pip install my-code-0.1.tar.gz it seems that pip does not compile and deploy my .py files. I.e. when I install into a venv and look inside the Lib/site-packages directory for the venv I only see a directory called my_code-0.1-py3.9.egg-info and my code is not in it. Attempts to import or run my module that's in PackageA.PackageB fail.
My question is - Why is my code not built and installed by pip install and how can I fix this?