title: package only cythonized binary python files and resource data but ignoring python .py source files
body: <p>I need to obfuscate my python code, to achieve it I am using cythonize extension, I am able to achieve it and get the binary compiled a.so files from a.py files but after doing bdist_wheel the .whl package only packages the a.so files and ignores the resource_folder.</p>
  
  <p>My project file structure is</p>
  
  <pre><code>|main_project
  |__,setup.py
  |__,main_folder
  |____,a.py
  |____,__init__.py
  |____resource_folder
       |__,a.model
       |__,a.json
  </code></pre>
  
  <p>I used following links to make obfuscated python wheel package,</p>
  
  <p><a href="https://bucharjan.cz/blog/using-cython-to-protect-a-python-codebase.html" rel="nofollow noreferrer">https://bucharjan.cz/blog/using-cython-to-protect-a-python-codebase.html</a></p>
  
  <p><a href="https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e" rel="nofollow noreferrer">https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e</a></p>
  
  <p><a href="https://stackoverflow.com/questions/39499453/package-only-binary-compiled-so-files-of-a-python-library-compiled-with-cython">Package only binary compiled .so files of a python library compiled with Cython</a></p>
  
  <p>Following is the snippet from my setup.py</p>
  
  <pre><code>packages = find_packages(exclude=('tests',))
  
  def get_package_files_in_directory(directory):
      paths = []
      for (path, directories, filenames) in os.walk(directory):
          for filename in filenames:
              paths.append(os.path.join('..', path, filename))
      return paths
  
  
  setup(
      packages=[],
  
      ext_modules=cythonize(
          [
             Extension("main_folder.*", ["main_folder/*.py"])
  
          ],
          build_dir="build",
          compiler_directives=dict(
          always_allow_keywords=True
          )),
  package_data={p: package_files + get_package_files_in_directory(os.path.join(here, p, 'resources')) for p in packages},
  ,....
  ,...
  )
  </code></pre>
  
  <p>To package I am using following command</p>
  
  <p>python setup.py build_ext</p>
  
  <p>python setup.py bdist_wheel</p>
  
  <hr>
  
  <p>expected result is .whl file containing a.so file and resource folder</p>
  
  <p>actual result is .whl file contain only a.so file.</p>
  
  <hr>
  
  <p>to also package the resource_folder I used get_package_files_in_directory() function as suggested in this link "( <a href="https://stackoverflow.com/questions/24347450/how-do-you-add-additional-files-to-a-wheel?noredirect=1&amp;lq=1">How do you add additional files to a wheel?</a>)"  but this also didnot work for me</p>