working on a python project, I tried to separate source code and unit tests; here is the project structure:
MyProject/
MANIFEST.in
README.md
setup.py
source/
__init.py__
my_project/
__init.py__
some_module.py
test/
__init.py__
my_project/
__init.py__
test_some_module.py
And here is the setup.py
file:
from setuptools import setup, find_packages
setup(
name='my_project',
packages=find_packages(where='./source'),
description='My project to be packaged',
version='1.0.0',
author='me'
install_requires=[
'fastnumbers~=2.0.1',
'numpy~=1.14.1',
'pandas~=0.22.0'
],
extras_require={
'dev': ['check-manifest'],
'test': [
'mock',
'PyHamcrest',
'pytest',
'pytest-cov'
],
}
)
Then, when I run command python3 setup.py sdist
, it fails with the following output:
running sdist
running egg_info
writing my_project.egg-info/PKG-INFO
writing requirements to my_project.egg-info/requires.txt
writing dependency_links to my_project.egg-info/dependency_links.txt
writing top-level names to my_project.egg-info/top_level.txt
error: package directory 'my_project' does not exist
The resulting top_level.txt
file looks fine:
my_project
but it looks like the setuptools
is not starting from source
folder to find modules to be packaged.
- Do I have to move
setup.py
andMANIFEST.in
files intosource
folder? - But then, what is this
where
argument for insetuptools.find_packages
function?