[Distutils] error using easy_install

Tres Seaver tseaver at palladion.com
Sat Jun 15 19:13:57 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/15/2013 02:29 AM, Ethan Furman wrote:
> My setup.py:
> 
> -- 8< -------------------------------------------------------------- 
> from distutils.core import setup
> 
> long_desc = open('enum.rst').read()
> 
> setup( name='stoneleaf.enum', version='1.0.1', 
> url='https://pypi.python.org/pypi/stoneleaf.enum', packages=['enum'], 
> package_dir={'enum':''}, package_data={'enum':['enum.rst', 'enum.pdf',
> 'test/test_enum.py', 'test/py2_test_enum.py',
> 'test/py3_test_enum.py']}, license='BSD License', description='Python
> 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4', 
> long_description=long_desc, provides=['enum'], author='Ethan Furman', 
> author_email='ethan at stoneleaf.us', classifiers=[ 'Development Status
> :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License
> :: OSI Approved :: BSD License', 'Programming Language :: Python', 
> 'Topic :: Software Development' ], ) -- 8<
> --------------------------------------------------------------
> 
> Error trying to install it with easy_install after uploading it to
> PyPI:
> 
> ethan at hydra:~$ sudo easy_install stoneleaf.enum Searching for
> stoneleaf.enum Reading http://pypi.python.org/simple/stoneleaf.enum/ 
> Best match: stoneleaf.enum 1.0.1 Downloading 
> http://pypi.python.org/packages/source/s/stoneleaf.enum/stoneleaf.enum-1.0.1.zip#md5=c41abd7ad04f11e8b545cfca7758a4f2
>
> 
Processing stoneleaf.enum-1.0.1.zip
> Writing /tmp/easy_install-LY_zzX/stoneleaf.enum-1.0.1/setup.cfg 
> Running stoneleaf.enum-1.0.1/setup.py -q bdist_egg --dist-dir 
> /tmp/easy_install-LY_zzX/stoneleaf.enum-1.0.1/egg-dist-tmp-IpvhLD 
> error: Setup script exited with error: can't copy 'num.rst': doesn't
> exist or not a regular file
> 
> 
> There is no 'num.rst' file in the package -- it should be 'enum.rst'.
> 
> Any ideas?  Is this the right place to post?

This is the right place.  Your 'package_data' declaration is getting munged::

 > /tmp/stone/stoneleaf.enum-1.0.1/build/bdist.linux-i686/egg/setuptools
    /command/build_py.py(80)build_package_data()
 -> self.copy_file(os.path.join(src_dir, filename), target)
 (Pdb) l
  75  	        lastdir = None
  76  	        for package, src_dir, build_dir, filenames in self.data_files:
  77  	            for filename in filenames:
  78  	                target = os.path.join(build_dir, filename)
  79  	                self.mkpath(os.path.dirname(target))
  80  ->	                self.copy_file(os.path.join(src_dir, filename),
target)
  81  	
  82  	
  83  	    def analyze_manifest(self):
  84  	        self.manifest_files = mf = {}
  85  	        if not self.distribution.include_package_data:
 (Pdb) pp self.data_files
 [('enum',
   '',
   'build/lib/enum',
   ['num.rst',
    'num.pdf',
    'est/test_enum.py',
    'est/py2_test_enum.py',
    'est/py3_test_enum.py'])]

Looking at the 'build_py' step, this line is problematic:

   package_dir={'enum':''},

When I change it to:

   package_dir={'enum':'.'},

then the install succeeds.  I would probably just make an 'enum' subdir,
move the files into it, and be done with it ('setup.py' isn't logically
part of the package:  it is in the wrapper).



Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlG8oNUACgkQ+gerLs4ltQ4axQCgh1YAyvqC/ZRJs1V6U4jQ66as
9VQAnRmJqhFINjzjCx2eftJfALKj/vsc
=o/a+
-----END PGP SIGNATURE-----



More information about the Distutils-SIG mailing list