[[pythonpkg]]
=== Snapshot (*Python*)

Let's consider another upstream source in the VCS and make a snapshot package from it.  Let's assume this is a https://docs.python.org/3/[Python3] source package with the https://docs.python.org/3/distutils/[distutils].

Let's inspect files.

----
include::../hello-py-1.0_di/ref/step101.log[]
----

Here are minimalistic configuration files for distutils with the upstream version *1.0*..

.*setup.py*:
----
include::../hello-py-1.0_di/ref/step102.log[]
----

The Python program code is as follows.

.*scripts/hello* and *hello-py/__init__.py*
----
sys::[head -n5  ../hello-py-1.0_di/ref/step105.log]
 ...
sys::[sed -n -e '/^SOFTWARE OR/,$p' ../hello-py-1.0_di/ref/step105.log]
----

You create a non-native Debian package source tree from the above upstream example using the *debmake*(1) command.  Here package description is copied from the upstream *setup.py* content by the *-s* option.

----
sys::[head -n20  ../hello-py-1.0_di/ref/step200.log]
 ...
sys::[grep '^I: debmake -x' ../hello-py-1.0_di/ref/step200.log]
 ...
sys::[tail -n5  ../hello-py-1.0_di/ref/step200.log]
----

Let’s inspect the result.

----
include::../hello-py-1.0_di/ref/step600.log[]
----

----
include::../hello-py-1.0_di/ref/step700.log[]
----

----
include::../hello-py-1.0_di/ref/step701.log[]
----

Let's check the generated control file content.

----
include::../hello-py-1.0_di/ref/step800.log[]
----

Let's compare how the packaging process converts the *substvar* etc.

.*debian/control* in the source package
----
include::../hello-py-1.0_di/ref/step801.log[]
----

.*DEBIAN/control* in the binary package
----
include::../hello-py-1.0_di/ref/step802.log[]
----
