You need to use Snapcraft’s python plugin. Just using dump doesn’t ask python to pull in anything at all: it literally dumps the content of the source directory into the snap, which in this case is just that python file I expect (i.e. not python itself).
Assuming you’re using python2 from the previous posts, try something like this for your parts:
parts:
aliyunduplicity:
plugin: python
python-version: python2
# The source should be contained within the same dir that contains the
# snap dir (or nested below that) and be relative rather than absolute.
source: duplicitysource
# Assuming you don't have a setup.py to install stuff, you can do it this way:
install: |
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp bin/aliyunduplicity $SNAPCRAFT_PART_INSTALL/bin/