Why does `python setup.py sdist` copy the entire directory into the dist file?

753 views Asked by At

I am perplexed why this setup.py file

# -*- coding: utf-8 -*-
from setuptools import setup, find_packages

with open('README.rst', 'r', encoding='utf-8') as file:
    readme = file.read()

setup(
  name = 'PDIpy',      
  package_dir = {'pdi':'pdipy'},
  packages = find_packages(),
  package_data = {
          'pdipy': ['parameters/*'],
          'test': ['*']
          }, 
  version = '0.0.5',
  license = 'MIT',
  description = "Simulate Photodynamic Inactivation (PDI) of from a kinetics model of membrane oxidation.", 
  long_description = readme,
  author = 'Andrew Freiburger',               
  author_email = '[email protected]',
  url = 'https://github.com/freiburgermsu/PDIpy',   
  keywords = [
          'antibacterial',
          'photodynamic', 
          'biophysics',
          'computational',
          'biology',
          'medicine', 
          'PDI', 
          'antibiotics'
          ],
  install_requires = [
          'matplotlib',
          'tellurium', 
          'scipy', 
          'pandas',
          'sigfig',
          'hillfit',
          'chemw',
          'numpy'
          ]
)

copies this entire directory into the dist file, including the examples folder that is neither mentioned in the setup.py file nor contains any script that could be perceived to be a package by find_packages(). What in the setup file is erroneous, and how can it be resolved?

This error is strangely also occurring with old setup.py files that previously worked perfectly.

1

There are 1 answers

0
Justin Xu On

I have a similar issues. Tried using the following steps:

  1. Remove dist and *.egg-info folders.
  2. Instead of using python setup.py sdist, use python -m build --sdist.

More explanations are explained at this issues