I have a directory with following structure,
.
├── awesome
│ ├── alice
│ │ ├── conf.py
│ │ └── __init__.py
│ ├── bob
│ │ ├── conf.py
│ │ └── __init__.py
│ ├── conf.py
│ ├── __init__.py
│ └── john
│ ├── conf.py
│ └── __init__.py
├── not_awesome_1
│ ├── __init__.py
│ └── something.py
├── not_awesome_2
│ ├── __init__.py
│ └── something.py
└── setup.py
I want to make the awesome package to be shippable. So, I made the setup.py as below,
from setuptools import find_packages, setup
setup(
name="my-awesome-package",
version="0.1.0",
description="",
long_description="",
license="BSD",
packages=find_packages(where="awesome"),
include_package_data=True,
author="JPG",
author_email="foo@gmail.com",
install_requires=[],
)
I ran the command python3 setup.py bdist_wheel and it gave me the result
running bdist_wheel
running build
running build_py
error: package directory 'alice' does not exist
What was I trying to achieve?
I wanted to decouple the awesome package and wanted to reuse it in multiple projects as I'm currently using the same in not_awesome_1 or not_awesome_2 packages.
In other words, after the successful installation of my-awesome-package I should be able to use the awesome packge as
from awesome.alice.conf import Alice
alice = Alice()
What have I tried so far?
- replaced
packages=find_packages(where="awesome"),withpackages=find_packages(),, but, during the build it also includes thenot_awesome_Xpackages as well - which is not intended. - Intriduced
package_diras well
But, this doesn't allow me to import my packages assetup( # other options packages=find_packages(where="awesome"), package_dir={"": "awesome"}, )from awesome.alice.conf import Alice, but,from alice.conf import Alice(ie,awesomeis missing)
Questions?
- What was I doing wrong here?
- How to properly configure
packagesandpackage_dir?
