Related to my previous answer–I am very new to using setup.py to distribute python packages.
According to python documentation, when passing script parameters to setup() in the setup.py file, it looks like you should use the script name without file extension.
setup(...,
scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val']
)
However, I found for my own test case that I needed to add the “.py” extension to the script parameter in order for packaging to work. E.g.:
config = {...
'scripts': ['bin/testscript3.py'],
}
....
setup(**config)
Am I doing something wrong, or is that the expected behavior? My guess is that this is expected, but I am just confused by the python documentation. I do realize this may have a trivial explanation, but after some googling I couldn’t figure it out, and maybe some other newbies will benefit from this question. Thanks!
You must write the script name exactly as it is represented on your file system.
I think you’re confused by the documentation as, on some platforms (Unix), filename extensions are not a standard way to choose in which program a file will be executed (look for “unix shebang” if you want to learn more), so, often, there is not filenames extensions on scripts.