├── Ansible.md ├── Building-Deadsnakes-Packages-from-Git.rst └── README.md /Ansible.md: -------------------------------------------------------------------------------- 1 | # Deadsnakes Ansible Playbook 2 | 3 | Here is an example Ansible Playbook to add the Deadsnakes PPA repository. 4 | 5 | ## Playbook 6 | 7 | ```yaml 8 | --- 9 | - name: Add Deadsnakes Nightly APT repository 10 | apt_repository: 11 | repo: ppa:deadsnakes/nightly 12 | when: ansible_distribution_release in ["focal", "bionic", "xenial"] 13 | 14 | - name: Install latest deadsnakes python 15 | apt: 16 | name: ['python3.9-dev', 'python3.9-venv', 'python3.10-dev', 'python3.10-venv'] 17 | state: latest 18 | update_cache: yes 19 | when: ansible_distribution_release in ["focal", "bionic", "xenial"] 20 | ``` 21 | 22 | This will need to be updated as new Ubuntu LTS releases come out and new Python versions. 23 | -------------------------------------------------------------------------------- /Building-Deadsnakes-Packages-from-Git.rst: -------------------------------------------------------------------------------- 1 | Launchpad PPAs only keep the newest version of a package (per Ubuntu release); older 2 | versions are simply deleted. If you need an older version of a deadsnakes package, 3 | you can build it from the source repository. 4 | 5 | The following instructions assume you started from a regular installation of the 6 | distribution release that you're building for. You can cross-build packages using 7 | pbuilder, but that's out of the scope of these instructions. 8 | 9 | 10 | Build Dependencies 11 | ------------------ 12 | 13 | If you add the appropriate deadsnakes PPA to the system and then run ``apt-get update``, 14 | you can simply run ``apt-get build-dep `` to install the build dependencies 15 | for a package. Otherwise, the build commands will complain if you're missing a build 16 | dependency; simply install the missing packages manually. 17 | 18 | 19 | Getting the Source 20 | ------------------ 21 | 22 | 1. Install the following packages:: 23 | 24 | sudo apt-get install devscripts git git-buildpackage 25 | 26 | 2. Find the repository for the package you want to build (`list`_) and clone it:: 27 | 28 | git clone https://github.com/deadsnakes/python.git 29 | cd python 30 | 31 | .. _list: https://github.com/deadsnakes/ 32 | 33 | 3. Find the tag that corresponds to the exact package version you want to build. 34 | Always pick the package for the distribution you're targeting; every package version 35 | contains the code name of the distribution it's for. Check out the tagged revision:: 36 | 37 | git checkout 38 | 39 | The form of the tag name determines the commands to use for building: 40 | 41 | - if the tag has the form *debian/*: continue to the `Building`_ section. 42 | - otherwise, if the tag has the form *python_*: see the `Legacy Building`_ section. 43 | 44 | 45 | Building 46 | -------- 47 | 48 | 1. Run:: 49 | 50 | gbp buildpackage --git-ignore-branch 51 | 52 | On older distributions, the ``gbp`` command may not exist. In that case, run:: 53 | 54 | git buildpackage --git-ignore-branch 55 | 56 | The command may ultimately fail with an error because it can't find the correct private 57 | GPG key to sign the source package. The binary packages should still have been 58 | created and the error can be ignored. 59 | 60 | 2. The binary packages can be found in the parent directory. 61 | 62 | 63 | Legacy Building 64 | --------------- 65 | 66 | To build from an old version imported into a Git repository, you need to create an upstream tarball. 67 | 68 | 1. Find the matching upstream tag; this will be of the form *python_*. Check out that tag:: 69 | 70 | git checkout python_ 71 | 72 | 2. Run:: 73 | 74 | tar czf ../python_.orig.tar.gz . 75 | 76 | 3. Check out to the package tag you determined before. 77 | 4. Run:: 78 | 79 | debuild 80 | 81 | The binary packages will be created in the parent directory. 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Miscellaneous Deadsnakes Documentation 2 | 3 | - [Ansible Playbook for Deadsnakes](Ansible.md) 4 | - [Building-Deadsnakes-Packages-from-Git.rst](Building-Deadsnakes-Packages-from-Git.rst) 5 | --------------------------------------------------------------------------------