https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&user=Ddevault&feedformat=atomAlpine Linux - User contributions [en]2024-03-28T14:39:02ZUser contributionsMediaWiki 1.40.0https://wiki.alpinelinux.org/w/index.php?title=K8s&diff=22332K8s2022-09-21T08:37:47Z<p>Ddevault: Reduce risk of vomiting on the part of the reader</p>
<hr />
<div>= Alpine Linux K8s in 10 Minutes =<br />
<br />
== Summary ==<br />
<br />
This guide will allow you to deploy a fresh Alpine Linux install into a Kubernetes K8 cluster in less than 10 minutes.<br />
<br />
== Why ==<br />
<br />
I went to learn Kubernetes recently and I built a k3 cluster using Alpine in an hour or so, it was a great experience. I figured the next step would be K8s, but I found no material on K8s for Alpine. This guide is the result of my first pass and the incorporations of high quality notes from the contributers. Kubernetes is awesome.<br />
<br />
== Contributers ==<br />
<br />
* Matthew Rogers [https://github.com/RamboRogers Github] [https://www.linkedin.com/in/matthewrogerscissp/ LinkedIn]<br />
* Mike Zolla [https://github.com/Zolla-Zolla Github] [https://www.linkedin.com/in/mike-zolla-5903b8/ LinkedIn]<br />
* Matthew Emmett [https://github.com/mattemmett Github] [https://www.linkedin.com/in/mattemmett/ LinkedIn]<br />
<br />
<br />
-----<br />
<br />
= Build K8s on Alpine Linux =<br />
<br />
=== Prerequisits ===<br />
<br />
You need an [https://alpinelinux.org/ Alpine Linux] install (this guide is written against version 3.15 standard image) with internet access. I recommend at least 2 CPU with 4GB of ram and 10GB of disk for each node.<br />
<br />
<blockquote>For HA control planes you'll need a mininum of three nodes<br />
</blockquote><br />
=== 1. Setup the Repositories ===<br />
<br />
Update you repositories under /etc/apk/repositories to include community, edge community and testing.<br />
<br />
<pre>#/media/cdrom/apks<br />
http://dl-cdn.alpinelinux.org/alpine/v3.15/main<br />
http://dl-cdn.alpinelinux.org/alpine/v3.15/community<br />
#http://dl-cdn.alpinelinux.org/alpine/edge/main<br />
http://dl-cdn.alpinelinux.org/alpine/edge/community<br />
http://dl-cdn.alpinelinux.org/alpine/edge/testing<br />
</pre><br />
=== 2. Node Setup ===<br />
<br />
This series of commands solves a series is incremental problems and sets up the system (if the first control node) for kubectl/kubeadm to run properly on next login by linking the config.<br />
<br />
The result here gives you a functional node that can be joined to an existing cluster or can become the first control plane of a new cluster. <span class="emoji" data-emoji="notes">🎶</span><br />
<br />
<blockquote>*** This build assumes CNI usage of flannel for networking ***<br />
</blockquote><br />
<pre>#add kernel module for networking stuff<br />
echo "br_netfilter" > /etc/modules-load.d/k8s.conf<br />
modprobe br_netfilter<br />
apk add cni-plugin-flannel<br />
apk add cni-plugins<br />
apk add flannel<br />
apk add flannel-contrib-cni<br />
apk add kubelet<br />
apk add kubeadm<br />
apk add kubectl<br />
apk add docker<br />
apk add uuidgen<br />
apk add nfs-utils<br />
#get rid of swap<br />
cat /etc/fstab | grep -v swap > temp.fstab<br />
cat temp.fstab > /etc/fstab<br />
rm temp.fstab<br />
swapoff -a<br />
#Fix prometheus errors<br />
mount --make-rshared /<br />
echo "#!/bin/sh" > /etc/local.d/sharemetrics.start<br />
echo "mount --make-rshared /" >> /etc/local.d/sharemetrics.start<br />
chmod +x /etc/local.d/sharemetrics.start<br />
rc-update add local<br />
#Fix id error messages<br />
uuidgen > /etc/machine-id<br />
#Add services<br />
rc-update add docker<br />
rc-update add kubelet<br />
#Sync time<br />
rc-update add ntpd<br />
/etc/init.d/ntpd start<br />
/etc/init.d/docker start<br />
#fix flannel<br />
ln -s /usr/libexec/cni/flannel-amd64 /usr/libexec/cni/flannel<br />
#kernel stuff<br />
echo "net.bridge.bridge-nf-call-iptables=1" >> /etc/sysctl.conf<br />
sysctl net.bridge.bridge-nf-call-iptables=1<br />
<br />
</pre><br />
Your blank node is now ready! If it's the first, you'll want to make a control node.<br />
<br />
=== 3. Setup the Control Plane (New Cluster!) ===<br />
<br />
Run this command to start the cluster and then apply a network.<br />
<br />
<pre><br />
#do not change subnet<br />
kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=master<br />
mkdir ~/.kube<br />
ln -s /etc/kubernetes/admin.conf /root/.kube/config<br />
kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml<br />
</pre><br />
You now have a control plane. This also gives you the command to run on our blank nodes to add them to this cluster as workers.<br />
<br />
=== 4. Join the cluster. ===<br />
<br />
Run this to get the join command from the control plane which you would then run on your new worker.<br />
<pre><br />
kubeadm token create --print-join-command <br />
</pre><br />
<br />
= Bonus =<br />
<br />
== Setup NFS Mounts on K8s ==<br />
<br />
This can be shared NFS storage to allow for auto persistent claim fulfilment. You'll need your IP updated and export information.<br />
<br />
<pre>helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/<br />
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \<br />
--set nfs.server=192.168.1.31 \<br />
--set nfs.path=/exports/cluster00<br />
</pre><br />
Now set the default storage class for the cluster.<br />
<br />
<pre>kubectl get storageclass<br />
kubectl patch storageclass nfs-client -p '{&quot;metadata&quot;: {&quot;annotations&quot;:{&quot;storageclass.kubernetes.io/is-default-class&quot;:&quot;true&quot;}}}'<br />
</pre><br />
== Check on System ==<br />
<br />
Check on your system.<br />
<br />
<pre>kubectl get nodes<br />
kubectl get all<br />
</pre></div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Himitsu&diff=21979Himitsu2022-06-16T13:54:56Z<p>Ddevault: </p>
<hr />
<div>[https://himitsustore.org Himitsu] is a secret storage manager for Linux.<br />
<br />
== Installation ==<br />
<br />
Himitsu is available in the Alpine testing repository. You need to install the "himitsu" package, as well as a prompter. The default prompter that is recommended is hiprompt-gtk-py.<br />
<br />
<pre>apk add himitsu hiprompt-gtk-py</pre><br />
<br />
Run "himitsu-init" to create a key store. The daemon, himitsud, needs to be running in order to access the key store. How you start it up depends on your system configuration; your desktop environment or service manager may offer a means of running it on startup.<br />
<br />
=== Additional integrations ===<br />
<br />
Various packages are available which add support for new protocols and integrations to Himitsu.<br />
<br />
* himitsu-ssh: SSH integration<br />
* himitsu-firefox: Firefox add-on<br />
<br />
== Documentation ==<br />
<br />
Consult the man pages. Start with himitsu(7).</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Himitsu&diff=21978Himitsu2022-06-16T13:52:27Z<p>Ddevault: Created page with "[https://himitsustore.org Himitsu] is a secret storage manager for Linux. == Installation == Himitsu is available in the Alpine testing repository. You need to install the "..."</p>
<hr />
<div>[https://himitsustore.org Himitsu] is a secret storage manager for Linux.<br />
<br />
== Installation ==<br />
<br />
Himitsu is available in the Alpine testing repository. You need to install the "himitsu" package, as well as a prompter. The default prompter that is recommended is hiprompt-gtk-py.<br />
<br />
<pre>apk add himitsu hiprompt-gtk-py</pre><br />
<br />
Run "himitsu-init" to create a key store. The daemon, himitsud, needs to be running in order to access the key store. How you start it up depends on your system configuration; your desktop environment or service manager may offer a means of running it on startup.<br />
<br />
=== Additional integrations ===<br />
<br />
Various packages are available which add support for new protocols and integrations to Himitsu.<br />
<br />
* himitsu-ssh: SSH integration<br />
* himitsu-firefox: FireFox add-on<br />
<br />
== Documentation ==<br />
<br />
Consult the man pages. Start with himitsu(7).</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=21502Sway2022-01-24T17:46:00Z<p>Ddevault: /* Prerequisites */</p>
<hr />
<div>[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk add mesa-dri-gallium # gallium<br />
# apk add mesa-dri-classic # or classic<br />
</pre><br />
<br />
The following links contain guides for setting up the video stack.<br />
<br />
* [[Intel Video]]<br />
* [[Radeon Video]]<br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input<br />
# adduser $USER video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. <br />
<br />
Install some TTF fonts:<br />
<br />
<pre><br />
# apk add ttf-dejavu<br />
</pre><br />
<br />
Since sway 1.6.1 (more specifically, since wlroots 0.14), you need to set up libseat backend if you wish to run sway directly (without nesting it in another wayland compositor). To do that, choose one of the following methods:<br />
<br />
<dl><br />
<br />
<dt>Option 1: seatd daemon (recommended)</dt><br />
<dd><br />
<pre><br />
# apk add seatd<br />
# rc-update add seatd<br />
# rc-service seatd start<br />
# adduser $USER seat<br />
</pre><br />
<br />
If you are already logged in as a $USER, you will need to relogin.<br />
</dd><br />
<br />
<dt>Option 2: seatd-launch</dt><br />
<dd><br />
<pre><br />
# apk add seatd-launch<br />
</pre><br />
<br />
When starting sway, you will need to prefix invocation with <code>seatd-launch</code>. <br />
Note: <code>seatd-launch</code> is a suid binary, so it might be wise to use one of the other methods from a security perspective.<br />
</dd><br />
<br />
<dt>Option 3: elogind daemon</dt><br />
<dd><br />
<br />
<pre><br />
# apk add elogind polkit-elogind<br />
# rc-update add elogind<br />
# rc-service elogind start<br />
</pre><br />
<br />
Using <code>elogind</code> will automatically set the necessary permissions, so you can skip adding groups like <code>seat</code> and <code>video</code><br />
<br />
</dd><br />
<br />
</dl><br />
<br />
== Installation ==<br />
<br />
We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xwayland \ # recommended for compatibility reasons<br />
foot \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
== Running Sway ==<br />
<br />
{{Note|<br />
Skip setting XDG_RUNTIME_DIR if you are using elogind }}<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
(if you run sway with seatd-launch, you will need to use <code>$ XDG_RUNTIME_DIR=/tmp seatd-launch sway</code>)<br />
<br />
See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration<br />
<br />
{{Note|<br />
swaylock needs to be able to read your <code>/etc/shadow</code> file to be able to validate your password<br />
}}<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Install:_from_a_disc_to_a_virtualbox_machine_single_only&diff=21462Alpine Install: from a disc to a virtualbox machine single only2022-01-06T19:14:30Z<p>Ddevault: Revert bad edits</p>
<hr />
<div>'''Overall description:''' Installing Alpine from an official disc image to a VirtualBox machine.<br />
<br />
This document guides you through installing Alpine on a VirtualBox VM - this is ideal if you only want to try out Alpine.<br />
<br />
== Terminology ==<br />
<br />
* '''Host machine''': the machine you're running VirtualBox on. It will "host" the target virtual machine.<br />
* '''Guest machine''': your target machine where Alpine will be installed, executed by the VirtualBox software on the host machine.<br />
* '''Reserved RAM''': the amount of host machine RAM that will be needed for exclusive use by the guest machine. The host machine cannot use this RAM while the guest machine is running.<br />
* '''Virtual disc''': the emulated storage medium attached to the guest machine. Usually it is a file (or several files) which VirtualBox presents as a disk to the guest OS (Alpine).<br />
<br />
== Requirements ==<br />
<br />
On the host machine:<br />
<br />
* [https://www.virtualbox.org/ VirtualBox]<br />
* At least 1GB of RAM, 2GB or more is recommended<br />
* Some means to download the install image (wget, curl, [https://www.mozilla.org/en-US/firefox/new/ web browser])<br />
<br />
Guest machine:<br />
<br />
* Minimum 512Mb RAM, but recommended 1Gb if you're going to use a graphical interface<br />
<br />
== Preparing the medium to install ==<br />
<br />
Download the source medium to install and put into your home; there's more hardware medium sources to download, like the '''[https://en.wikipedia.org/wiki/Linux_on_z_Systems s390x]''' and '''[https://en.wikipedia.org/wiki/Ppc64 ppc64le]''', but because VirtualBox handles only '''x86''' and '''x64'''<br />
hardware, we will list those here<br />
<br />
The name of the source medium to install will be in the following format: '''<code><nowiki>http://dl-cdn.alpinelinux.org/alpine/v</nowiki><VERSION>/releases/<ARCH>/alpine-standard-<VERSION>.0-<ARCH>.iso</code>''' where <code>ARCH</code> and <code>VERSION</code> can be one of the following, for VirtualBox virtual machines:<br />
<br />
* <code><ARCH></code> can be<br />
** '''x86''': The well known i386 to i686. (32-bit machines) <br />
** '''x86_64''': The popular AMD64 compatible 64-bit x86 based machines.<br />
* <code><VERSION></code> can be<br />
** '''latest-stable''' as the name says, the latest, stable version<br />
** '''3.10''' UEFI support began with this version<br />
** '''3.8''' recommended for machines manufactured between 2012 and 2016<br />
** '''3.6''' recommended for older machines<br />
<br />
Typically, the version most commonly used in a virtual box is the x86. The hardware is cheaper and operation does not consume a lot of memory.<br />
The iso download URL format is:<br />
<br />
* For '''"x86" <code><ARCH></code>''' and '''"3.10" <code><VERSION></code>''' will be:<br />
<code><nowiki>http://dl-cdn.alpinelinux.org/alpine/v3.10/releases/x86/alpine-standard-3.10.0-x86.iso</nowiki></code><br />
<br />
'''Graphical download''': Just point the web browser to that URL and the download will start. A file with '''.iso''' extension type, with a name like <code>"alpine-standard-3.10.0-x86.iso"</code> (if i386/686); will be downloaded into the directory specified in your browser configuration.<br />
<br />
'''Command line method''': just open a terminal and execute: <code>wget -c -t8 --no-check-certificate <nowiki>http://dl-cdn.alpinelinux.org/alpine/v</nowiki><VERSION>/releases/<ARCH>/alpine-standard-<VERSION>.0-<ARCH>.iso</code>, for example:<br />
<br />
* For '''"x86" <code><ARCH></code>''' and '''"3.10" <code><VERSION></code>''' the command will be:<br />
<code>wget -c -t8 --no-check-certificate <nowiki>http://dl-cdn.alpinelinux.org/alpine/v3.10/releases/x86/alpine-standard-3.10.0-x86.iso</nowiki></code><br />
<br />
You must be mindful of the directory you run the command from, as that is where the file will be saved.<br />
<br />
== Preparing the virtual machine to install ==<br />
<br />
Start the VirtualBox software program.<br />
<br />
# In the main window '''create a new virtual machine''' by '''clicking the blue spark New button'''. That will open a new window with the following questions:<br />
## It will ask for a '''name for the virtual like "alpine-desktop-try1"'''. <br />
## The Type of the '''Operating system choose "linux"'''.<br />
## The version '''choose "other linux"'''. It must match the chosen <code><ARCH></code> (e.g. x86).<br />
## Click the "Next" button to continue creating the virtual machine.<br />
# When selecting the amount of RAM for the virtual machine, choose a minimum of '''512MB''' then click the "Next" button.<br />
# A new window with a '''Hard disk assistant will open'''.<br />
## First choose '''"Create a virtual hard disk now"''' then click the "Create" button.<br />
## Next choose the option for '''hard disk type: VDI''' and push "Next" button.<br />
## Choose '''dynamically allocated''' then click the "Next" button.<br />
## The next window will offer the '''size of virtual disk. 4GB''', however, you may choose a different amount of storage space.<br />
## After clicking on "Create" the virtual machine will be ready to use.<br />
# Now the main window shows you the "alpine-desktop-try1" virtual machine, select it.<br />
## Click on the yellow "Configuration" button. Go to the storage menu and pull it down.<br />
## Select the disc drive icon for CD/DVD ROM and click on the CD/DVD drive icon at the right.<br />
## A Mini menu will open. Select an external file event the host CD/DVD drive.<br />
## A file open dialog will open. Search for the downloaded Alpine iso and select it.<br />
## Once you choose the iso file to boot, click the "Ok" button to finish creating the virtual machine.<br />
# Click the green "Start" arrow to start the virtual machine and boot the iso.<br />
<br />
[[File:Alpine Install from a disc to a virtualbox machine single only-01-0.png|center|Alpine configuration commonly used of a virtual machine on virtual box virtual machine]]<br />
<br />
== Booting the Alpine ISO disc ==<br />
<br />
When the machine starts, you must be sure to choose the Optical drive (commonly named CD/DVD ROM drive), so the disc/iso will boot. After a while, a command line shell will show you<br />
<br />
[[File:Installation-alpine-alpine-setup-2-boot.png|350px|thumb|right|Installation : setup-alpine : booting process until login prompt]]<br />
<br />
TODO restore the inclusion of template inclkude pages here, were edited and now does not have any sense respect this guide.. <br />
<br />
== Finishing the installation ==<br />
<br />
After setup ends, a "reboot" will be offered. Type "reboot" and press enter and your newly installed virtual machine will be booted. Don't forget to remove the boot medium.<br />
<br />
[[File:Installation-alpine-alpine-setup-9-setup-disk-3-7end.png]]<br />
<br />
'''You cannot see a graphical window system? No problem.''' With Alpine, GUIs are made the right way. So '''if you need a desktop, you can install a desktop''' follow this link: Alpine newbie packages or go directly to [[Alpine newbie desktops]]<br />
<br />
= Documents series =<br />
<br />
{| class="wikitable"<br />
|-<br />
! Previous required !! What's next to read<br />
|-<br />
| Alpine newbie install manual || Alpine newbie packages<br />
|}<br />
<br />
= See Also =<br />
<br />
# [[Alpine newbie developer]]<br />
# [[Alpine newbie lammers]]<br />
<br />
[[Category:Newbie]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=21229Sway2022-01-02T20:14:49Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk add mesa-dri-gallium # gallium<br />
# apk add mesa-dri-classic # or classic<br />
</pre><br />
<br />
The following links contain guides for setting up the video stack.<br />
<br />
* [[Intel Video]]<br />
* [[Radeon Video]]<br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input<br />
# adduser $USER video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. <br />
<br />
Install some TTF fonts:<br />
<br />
<pre><br />
# apk add ttf-dejavu<br />
</pre><br />
<br />
Since sway 1.6.1 (more specifically, since wlroots 0.14), you need to set up libseat backend if you wish to run sway directly (without nesting it in another wayland compositor). To do that, choose one of the following methods:<br />
<br />
<dl><br />
<br />
<dt>seatd daemon</dt><br />
<dd><br />
<pre><br />
# apk add seatd<br />
# rc-update add seatd<br />
# rc-service seatd start<br />
# adduser $USER seat<br />
</pre><br />
<br />
If you are already logged in as a $USER, you will need to relogin.<br />
</dd><br />
<br />
<dt>seatd-launch</dt><br />
<dd><br />
<pre><br />
# apk add seatd-launch<br />
</pre><br />
<br />
When starting sway, you will need to prefix invocation with <code>seatd-launch</code>. <br />
Note: <code>seatd-launch</code> is a suid binary, so it might be wise to use one of the other methods from a security perspective.<br />
</dd><br />
<br />
<dt>elogind daemon</dt><br />
<dd><br />
TODO<br />
</dd><br />
<br />
</dl><br />
<br />
== Installation ==<br />
<br />
We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xwayland \ # recommended for compatibility reasons<br />
foot \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
== Running Sway ==<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
(if you run sway with seatd-launch, you will need to use <code>$ XDG_RUNTIME_DIR=/tmp seatd-launch sway</code>)<br />
<br />
See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration<br />
<br />
{{Note|<br />
swaylock needs to be able to read your <code>/etc/shadow</code> file to be able to validate your password<br />
}}<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=21228Sway2022-01-02T20:14:30Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk add mesa-dri-gallium # gallium<br />
# apk add mesa-dri-classic # or classic<br />
</pre><br />
<br />
The following links contain guides for setting up the video stack.<br />
<br />
* [Intel Video]<br />
* [Radeon Video]<br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input<br />
# adduser $USER video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. <br />
<br />
Install some TTF fonts:<br />
<br />
<pre><br />
# apk add ttf-dejavu<br />
</pre><br />
<br />
Since sway 1.6.1 (more specifically, since wlroots 0.14), you need to set up libseat backend if you wish to run sway directly (without nesting it in another wayland compositor). To do that, choose one of the following methods:<br />
<br />
<dl><br />
<br />
<dt>seatd daemon</dt><br />
<dd><br />
<pre><br />
# apk add seatd<br />
# rc-update add seatd<br />
# rc-service seatd start<br />
# adduser $USER seat<br />
</pre><br />
<br />
If you are already logged in as a $USER, you will need to relogin.<br />
</dd><br />
<br />
<dt>seatd-launch</dt><br />
<dd><br />
<pre><br />
# apk add seatd-launch<br />
</pre><br />
<br />
When starting sway, you will need to prefix invocation with <code>seatd-launch</code>. <br />
Note: <code>seatd-launch</code> is a suid binary, so it might be wise to use one of the other methods from a security perspective.<br />
</dd><br />
<br />
<dt>elogind daemon</dt><br />
<dd><br />
TODO<br />
</dd><br />
<br />
</dl><br />
<br />
== Installation ==<br />
<br />
We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xwayland \ # recommended for compatibility reasons<br />
foot \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
== Running Sway ==<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
(if you run sway with seatd-launch, you will need to use <code>$ XDG_RUNTIME_DIR=/tmp seatd-launch sway</code>)<br />
<br />
See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration<br />
<br />
{{Note|<br />
swaylock needs to be able to read your <code>/etc/shadow</code> file to be able to validate your password<br />
}}<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Talk:Python_package_policies&diff=16801Talk:Python package policies2020-01-24T15:10:22Z<p>Ddevault: </p>
<hr />
<div>This page duplicates quite a bit of details which are already present:<br />
<br />
* https://wiki.alpinelinux.org/wiki/Package_policies<br />
* https://wiki.alpinelinux.org/wiki/APKBUILD_examples:Python<br />
<br />
Instead of creating a new page the existing information should be updated.<br />
<br />
----<br />
<br />
`_py2_depends` and `_py3_depends` are more consistent with the other variable names and preferable to '_py2_deps' and '_py3_deps' in my opinion.<br />
<br />
Agreed, but I've removed all of the Python 2 details entirely pending the coming EoL.<br />
--[[User:Ddevault|Ddevault]] ([[User talk:Ddevault|talk]]) 15:10, 24 January 2020 (UTC)<br />
<br />
<br />
----<br />
<br />
_pyname is much less common than _pkgname although _pkgname is used for many things; would be good to have a clear recommended name<br />
<br />
_pyname was per ncopa's suggestion, I don't have a problem with it.<br />
--[[User:Ddevault|Ddevault]] ([[User talk:Ddevault|talk]]) 15:10, 24 January 2020 (UTC)</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=16800Python package policies2020-01-24T15:08:22Z<p>Ddevault: More Python 2 removal</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach, some discussion is taking place on the [[Talk:Python_package_policies|talk page]]}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Package template ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"<br />
provides="py-example=$pkgver-r$pkgrel"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url="https://example.org"<br />
arch="noarch"<br />
license="MIT"<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== You need to use the 'tox' utility to run tests ===<br />
<br />
tox (knows as py3-tox on Alpine Linux) downloads all dependencies into a virtual environment by default, which bypasses the system tooling, making<br />
testing somewhat less useful.<br />
<br />
Remember to use *--sitepackages* on your invocation of tox in the check() phase so it uses the system packages instead of downloading ones into<br />
a virtual environment.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.<br />
<br />
<br />
[[category: python]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=16799Python package policies2020-01-24T15:08:07Z<p>Ddevault: Drop Python 2 details</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach, some discussion is taking place on the [[Talk:Python_package_policies|talk page]]}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Package template ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"<br />
provides="py-example=$pkgver-r$pkgrel"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url="https://example.org"<br />
arch="noarch"<br />
license="MIT"<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== You need to use the 'tox' utility to run tests ===<br />
<br />
tox (knows as py3-tox on Alpine Linux) downloads all dependencies into a virtual environment by default, which bypasses the system tooling, making<br />
testing somewhat less useful.<br />
<br />
Remember to use *--sitepackages* on your invocation of tox in the check() phase so it uses the system packages instead of downloading ones into<br />
a virtual environment.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.<br />
<br />
<br />
[[category: python]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=16776Sway2020-01-11T14:51:21Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk search mesa-dri<br />
# apk add mesa-dri-intel # example<br />
</pre><br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. <br />
<br />
== Installation ==<br />
<br />
We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatibility reasons<br />
alacritty \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
== Running Sway ==<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
Add this to a script if it becomes tedious.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=16775Sway2020-01-11T14:43:43Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk search mesa-dri<br />
# apk add mesa-dri-intel # example<br />
</pre><br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. <br />
<br />
== Installation ==<br />
<br />
We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
alacritty \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
== Running Sway ==<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
Add this to a script if it becomes tedious.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=16774Sway2020-01-11T14:43:12Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk search mesa-dri<br />
# apk add mesa-dri-intel # example<br />
</pre><br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. <br />
<br />
== Installation ==<br />
<br />
We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
alacritty \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
<br />
== Running Sway ==<br />
<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
Add this to a script if it becomes tedious.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=16773Sway2020-01-11T14:42:53Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
# Install eudev and run setup-udev to configure it<br />
# Install graphics drivers appropriate for your hardware<br />
# Add yourself to the input and video groups<br />
# Reboot<br />
<br />
== Installation ==<br />
<br />
First, install & configure eudev:<br />
<br />
<pre><br />
# apk add eudev<br />
# setup-udev<br />
</pre><br />
<br />
Then install graphics drivers appropriate to your system:<br />
<br />
<pre><br />
# apk search mesa-dri<br />
# apk add mesa-dri-intel # example<br />
</pre><br />
<br />
Add yourself to the input and video groups:<br />
<br />
<pre><br />
# adduser $USER input video<br />
</pre><br />
<br />
You have to log out and back in for this to take effect. We can now install sway:<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
alacritty \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
<br />
== Running Sway ==<br />
<br />
<br />
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:<br />
<br />
<pre><br />
$ XDG_RUNTIME_DIR=/tmp sway<br />
</pre><br />
<br />
Add this to a script if it becomes tedious.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=16049Python package policies2019-07-08T20:38:47Z<p>Ddevault: Add provides to process for dropping py2 support</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach, some discussion is taking place on the [[Talk:Python_package_policies|talk page]]}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"<br />
provides="py-example=$pkgver-r$pkgrel"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
_py2_deps="..."<br />
_py3_deps="..."<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py2-setuptools py3-setuptools $_py2_deps $_py3_deps"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
default_prepare <br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
depends="$_py2_deps"<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
depends="$_py3_deps"<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Kernels&diff=16035Kernels2019-06-30T23:41:17Z<p>Ddevault: </p>
<hr />
<div>Alpine Linux has [//pkgs.alpinelinux.org/packages?name=linux-*&branch=edge several kernels] designed to suit different situations.<br />
<br />
* [//git.alpinelinux.org/aports/tree/main/linux-vanilla linux-vanilla] is the stock modular kernel and is configured for a generous selection of hardware.<br />
* [//https://git.alpinelinux.org/aports/tree/main/linux-vanilla linux-virt] (see the -virt configs) is recommended for Alpine Linux guests, and disables most hardware in favor of a commonly-virtualized subset of drivers.<br />
* [//git.alpinelinux.org/aports/tree/main/linux-rpi linux-rpi] is optimized for the Raspberry Pi.<br />
<br />
For installing a custom kernel, see [[Custom Kernel]]. To select a specific kernel or firmware packages during installation from the Alpine ISO, simply install the desired kernel flavor and firmware packages with <code>apk add</code> before running <code>setup-alpine</code>.<br />
<br />
== Firmware ==<br />
<br />
The [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware linux-firmware] meta-package is included in the [[Installation|default installation]], and depends on all firmware. This is a large download, and you may be better served by installing [//pkgs.alpinelinux.org/packages?name=linux-firmware-*&branch=edge only the firmwares you need], or [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware-none linux-firmware-none] if you do not require any firmware. If you're unsure which firmware you need, boot up with no firmware installed and run <code>dmesg | grep firmware</code> to get an idea. Be aware that most firmware is nonfree.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Installation&diff=16034Installation2019-06-30T23:39:23Z<p>Ddevault: /* Advanced */</p>
<hr />
<div>The following information will assist you with the installation of [http://alpinelinux.org/about Alpine Linux].<br />
[[Image:hdd_mount.png|left|link=]]<br />
<br /><br />
<br />
== Installation Quick-Start in 3 Easy Steps ==<br />
<div style="float:left; font-size:30px; font-weight:bold;"><br />
1st<br />
</div><br />
<div style="margin-left:65px; background-color:#EDF2F2; border-style:solid; border-color:#6F7C91; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;"><br />
[http://alpinelinux.org/downloads Download] one of the latest stable-release ISOs. Then compare the image's checksum to the one in the corresponding checksum file (<code>*.sha256</code>) and verify its GPG signature.<br />
</div><br />
<br />
<br />
<div style="float:left; font-size:30px; font-weight:bold;"><br />
2nd<br />
</div><br />
<div style="margin-left:65px; background-color:#E0E9E9; border-style:solid; border-color:#606A82; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;"><br />
If you have a CD drive from which you can boot, then [[Burning ISOs|burn the ISO onto a blank CD]] using your favorite CD burning software. Else [[Create a Bootable USB|create a bootable USB drive]].<br />
</div><br />
<br />
<br />
<div style="float:left; font-size:30px; font-weight:bold;"><br />
3rd<br />
</div><br />
<div style="margin-left:65px; background-color:#9faecc; border-style:solid; border-color:#324065; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;"><br />
Boot from the CD or USB drive, login as root with no password, and voilà ! Enjoy Alpine Linux!<br />
</div><br />
<br />
{{Clear}}<br />
One of the [[Installation#Post-Install|first commands you might want to use]] is <code>[[setup-alpine]]</code>.<br />
<br />
== Installation Handbook ==<br />
=== Basics ===<br />
Alpine can be used in any of three modes:<br />
<dl><br />
<dt>diskless mode<br />
<dd>You'll boot from a read-only medium such as the installation CD, a [[Create a Bootable USB|USB drive]], or a [[Create a Bootable Compact Flash|Compact Flash card]]. {{Tip| To prepare either a USB or Compact Flash card, you can use the <code>[[setup-bootable]]</code> script; see the pages linked above for details.}} When you use Alpine in this mode, you need to use [[Alpine local backup|Alpine Local Backup (lbu)]] to save your modifications between reboots. That requires some writable medium, usually removable. If your boot medium is, for example, a USB drive, you can save modifications there; you don't need a separate partition or drive. See also [[Local APK cache]].<br />
{{Note| When the <code>[[setup-alpine]]</code> script asks for a disk, say "none". It will then prompt whether you'd like to preserve modifications on any writable medium.}}<br />
<dt>data mode<br />
<dd>As in diskless mode, your OS is run from a read-only medium. However, here a writable partition (usually on a hard disk) is used to store the data in {{Path|/var}}. That partition is accessed directly, rather than copied into a tmpfs; so this is better-suited to uses where large amounts of data need to be preserved between reboots. {{Note| The <code>[[setup-alpine]]</code> script handles installing Alpine in this mode, too, when you supply a writable partition instead of "none", and request mode "data".}} This mode may be used for mailspools, database and log servers, and so on.<br />
<dt>sys mode<br />
<dd>This is a [[Install to disk|traditional hard-disk install]] (see link for details). <!-- includes [[Installing Alpine on HDD overwriting everything]] --> Both the boot system and your modifications are written to the hard disk in a standard Linux hierarchy. {{Note| The <code>[[setup-alpine]]</code> script handles installing Alpine in this mode, too, when you supply a writable partition instead of "none", and request mode "sys". By default, it will create three partions on your disk for {{Path|/boot}}, {{Path|/}}, and {{Path|swap}}; however you can also [[Setting up disks manually|partition your disk manually]].<br />
}} This mode may be used for [[Desktops|desktops]], development boxes, and virtual servers.<br />
<!-- [[Native Harddisk Install 1.6]] Obsolete --><br />
</dl><br />
<br />
=== Advanced ===<br />
* [[Kernels]]<br />
* [[Create UEFI boot USB]]<br />
* [[Tutorials_and_Howtos#Storage|Setting up storage with RAID, LVM, LUKS encryption, iSCSI, or suchlike]]<br />
* [[Setting up disks manually]]<br />
* [[Partitioning and Bootmanagers]]<br />
* [[Migrating data]]<br />
* Details about [[Alpine setup scripts]]<br />
<br />
* [[Installing Alpine on HDD dualbooting|Install to HDD with dual-boot]]<br />
* [[Create A VirtualBox Guest with Grub and XFS]]<br />
* [[Replacing non-Alpine Linux with Alpine remotely]]<br />
<!-- [[Installing Xubuntu using Alpine boot floppy]] Obsolete --><br />
<!-- [[Installing Alpine Linux on USB Automated]] Obsolete --><br />
<br />
* [[Bootstrapping Alpine Linux]]<br />
<br />
<!-- If you edit the following, please coordinate with Developer_Documentation#Configuring_your_system. Note that these two sections are not exact duplicates. --><br />
* [[Installing Alpine Linux in a chroot]]<br />
* [[Install Alpine on LXC]]<br />
* [[Install Alpine on LXD|Install Alpine on Ubuntu with LXD]]<br />
* Install Alpine on [[Install Alpine on VirtualBox|VirtualBox]], [[Install Alpine on VMware|VMware]], [[Install Alpine on coLinux|coLinux]], [[Qemu]], <!-- includes [[Install Alpine in Qemu]], [[Running Alpine in Qemu Live mode]], [[Running Alpine Linux As a QEMU networked Guest]], --> [[Install Alpine on Amazon EC2|Amazon EC2]], or [[Install Alpine on Rackspace|RackSpace]]<br />
<br />
* [[Xen Dom0]] ''(Setting up Alpine as a dom0 for Xen hypervisor)''<br />
* [[Xen Dom0 on USB or SD]]<br />
* [[Create Alpine Linux PV DomU]]<br />
* [[Xen LiveCD]]<br />
<br />
* [[Setting up a basic vserver]]<br />
* [[Setting up the build environment on HDD]]<br />
* [[Setting up a compile vserver]] for official or for [[Setting up a compile vserver for third party packages|third party]] packages<br />
<!-- [[Create an Alpine 1.9 vserver template]] --><br />
<br />
=== Post-Install ===<br />
<!-- If you edit this, please coordinate with and Tutorials_and_Howtos#Post-Install and Developer_Documentation#Package_management. Note that these three sections are not exact duplicates. --><br />
<br />
<!-- [[Configure Networking]] --><br />
* [[Tutorials_and_Howtos#Networking|Setting up Networking]]<br />
* [[Alpine Linux package management|Package Management (apk)]] ''(How to add/remove packages on your Alpine)''<br />
<!-- [[Alpine Linux package management#Local_Cache|How to enable APK caching]] --><br />
* [[Alpine local backup|Alpine local backup (lbu)]] ''(Permanently store your modifications in case your box needs reboot)''<br />
** [[Back Up a Flash Memory Installation|Back Up a Flash Memory ("diskless mode") Installation]]<br />
** [[Manually editing a existing apkovl]]<br />
* [[Alpine Linux Init System|Init System (OpenRC)]] ''(Configure a service to automatically boot at next reboot)''<br />
** [[Multiple Instances of Services]]<br />
<!-- [[Writing Init Scripts]] --><br />
* [[Alpine setup scripts#setup-xorg-base|Setting up Xorg]]<br />
<br />
* [[Upgrading Alpine]]<br />
<!-- Obsolete<br />
[[Upgrading Alpine - v1.9.x]]<br />
[[Upgrading Alpine - CD v1.8.x]]<br />
[[Upgrading Alpine - HD v1.8.x]]<br />
[[Upgrade to repository main|Upgrading to signed repositories]]<br />
--><br />
<br />
* [[Setting up a ssh-server]] ''(Using ssh is a good way to administer your box remotely)''<br />
* [[setup-acf]] ''(Configures ACF (webconfiguration) so you can manage your box through https)''<br />
* [[Hosting services on Alpine]]''(Links to several mail/web/ssh server setup pages)''<br />
* [[Changing passwords for ACF|Changing passwords]]<br />
<br />
<!-- [[Running glibc programs]] Installation and Dev --><br />
* [[Setting the timezone]] ''(Not needed for the default musl- or uClibc-based installs)''<br />
<br />
=== Further Help and Information ===<br />
* [[FAQ|FAQs]]<br />
* [[Tutorials and Howtos]]<br />
* [[Contribute|How to Contribute]]<br />
* [[Developer Documentation]]<br />
<br />
[[Category:Installation]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Kernels&diff=16033Kernels2019-06-30T23:38:40Z<p>Ddevault: Move setup-alpine instructions above the fold</p>
<hr />
<div>Alpine Linux has [//pkgs.alpinelinux.org/packages?name=linux-*&branch=edge several kernels] designed to suit different situations.<br />
<br />
* [//git.alpinelinux.org/aports/tree/main/linux-vanilla linux-vanilla] is the stock modular kernel and is configured for a generous selection of hardware.<br />
* [//https://git.alpinelinux.org/aports/tree/main/linux-virt linux-virt] is recommended for Alpine Linux guests, and disables most hardware in favor of a commonly-virtualized subset of drivers.<br />
* [//git.alpinelinux.org/aports/tree/main/linux-rpi linux-rpi] is optimized for the Raspberry Pi.<br />
<br />
For installing a custom kernel, see [[Custom Kernel]]. To select a specific kernel or firmware packages during installation from the Alpine ISO, simply install the desired kernel flavor and firmware packages with <code>apk add</code> before running <code>setup-alpine</code>.<br />
<br />
== Firmware ==<br />
<br />
The [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware linux-firmware] meta-package is included in the [[Installation|default installation]], and depends on all firmware. This is a large download, and you may be better served by installing [//pkgs.alpinelinux.org/packages?name=linux-firmware-*&branch=edge only the firmwares you need], or [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware-none linux-firmware-none] if you do not require any firmware. If you're unsure which firmware you need, boot up with no firmware installed and run <code>dmesg | grep firmware</code> to get an idea. Be aware that most firmware is nonfree.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Kernels&diff=16032Kernels2019-06-30T23:38:17Z<p>Ddevault: Add note about installation procedure</p>
<hr />
<div>Alpine Linux has [//pkgs.alpinelinux.org/packages?name=linux-*&branch=edge several kernels] designed to suit different situations.<br />
<br />
* [//git.alpinelinux.org/aports/tree/main/linux-vanilla linux-vanilla] is the stock modular kernel and is configured for a generous selection of hardware.<br />
* [//https://git.alpinelinux.org/aports/tree/main/linux-virt linux-virt] is recommended for Alpine Linux guests, and disables most hardware in favor of a commonly-virtualized subset of drivers.<br />
* [//git.alpinelinux.org/aports/tree/main/linux-rpi linux-rpi] is optimized for the Raspberry Pi.<br />
<br />
For installing a custom kernel, see [[Custom Kernel]].<br />
<br />
== Firmware ==<br />
<br />
The [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware linux-firmware] meta-package is included in the [[Installation|default installation]], and depends on all firmware. This is a large download, and you may be better served by installing [//pkgs.alpinelinux.org/packages?name=linux-firmware-*&branch=edge only the firmwares you need], or [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware-none linux-firmware-none] if you do not require any firmware. If you're unsure which firmware you need, boot up with no firmware installed and run <code>dmesg | grep firmware</code> to get an idea. Be aware that most firmware is nonfree.<br />
<br />
== setup-alpine ==<br />
<br />
To select a specific kernel or firmware packages during installation from the Alpine ISO, simply install the desired kernel flavor and firmware packages with <code>apk add</code> before running <code>setup-alpine</code>.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Firmware&diff=16031Firmware2019-06-30T23:34:45Z<p>Ddevault: Redirected page to Kernels#Firmware</p>
<hr />
<div>#REDIRECT [[Kernels#Firmware]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Kernels&diff=16030Kernels2019-06-30T23:31:25Z<p>Ddevault: Fix broken link, add nonfree note</p>
<hr />
<div>Alpine Linux has [//pkgs.alpinelinux.org/packages?name=linux-*&branch=edge several kernels] designed to suit different situations.<br />
<br />
* [//git.alpinelinux.org/aports/tree/main/linux-vanilla linux-vanilla] is the stock modular kernel and is configured for a generous selection of hardware.<br />
* [//https://git.alpinelinux.org/aports/tree/main/linux-virt linux-virt] is recommended for Alpine Linux guests, and disables most hardware in favor of a commonly-virtualized subset of drivers.<br />
* [//git.alpinelinux.org/aports/tree/main/linux-rpi linux-rpi] is optimized for the Raspberry Pi.<br />
<br />
For installing a custom kernel, see [[Custom Kernel]].<br />
<br />
== Firmware ==<br />
<br />
The [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware linux-firmware] meta-package is included in the [[Installation|default installation]], and depends on all firmware. This is a large download, and you may be better served by installing [//pkgs.alpinelinux.org/packages?name=linux-firmware-*&branch=edge only the firmwares you need], or [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware-none linux-firmware-none] if you do not require any firmware. If you're unsure which firmware you need, boot up with no firmware installed and run <code>dmesg | grep firmware</code> to get an idea. Be aware that most firmware is nonfree.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Kernels&diff=16029Kernels2019-06-30T23:29:45Z<p>Ddevault: Created page with "Alpine Linux has [//pkgs.alpinelinux.org/packages?name=linux-*&branch=edge several kernels] designed to suit different situations. * [//git.alpinelinux.org/aports/tree/main/l..."</p>
<hr />
<div>Alpine Linux has [//pkgs.alpinelinux.org/packages?name=linux-*&branch=edge several kernels] designed to suit different situations.<br />
<br />
* [//git.alpinelinux.org/aports/tree/main/linux-vanilla linux-vanilla] is the stock modular kernel and is configured for a generous selection of hardware.<br />
* [//https://git.alpinelinux.org/aports/tree/main/linux-virt linux-virt] is recommended for Alpine Linux guests, and disables most hardware in favor of a commonly-virtualized subset of drivers.<br />
* [//git.alpinelinux.org/aports/tree/main/linux-rpi linux-rpi] is optimized for the Raspberry Pi.<br />
<br />
For installing a custom kernel, see [[Custom Kernel]].<br />
<br />
== Firmware ==<br />
<br />
The [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware linux-firmware] meta-package is included in the [default installation|Installation], and depends on all firmware. This is a large download, and you may be better served by installing [//pkgs.alpinelinux.org/packages?name=linux-firmware-*&branch=edge only the firmwares you need], or [//pkgs.alpinelinux.org/package/edge/main/x86/linux-firmware-none linux-firmware-none] if you do not require any firmware. If you're unsure which firmware you need, boot up with no firmware installed and run <code>dmesg | grep firmware</code> to get an idea.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15866Python package policies2019-04-03T19:49:38Z<p>Ddevault: </p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
_py2_deps="..."<br />
_py3_deps="..."<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py2-setuptools py3-setuptools $_py2_deps $_py3_deps"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
depends="$_py2_deps"<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
depends="$_py3_deps"<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15865Python package policies2019-04-03T19:40:37Z<p>Ddevault: s/spaces/tabs/</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
_py2_deps="py2-setuptools"<br />
_py3_deps="py3-setuptools"<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="$_py2_deps $_py3_deps"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
depends="$_py2_deps"<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
depends="$_py3_deps"<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15864Python package policies2019-04-03T19:40:06Z<p>Ddevault: </p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
_py2_deps="py2-setuptools"<br />
_py3_deps="py3-setuptools"<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="$_py2_deps $_py3_deps"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
depends="$_py2_deps"<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
depends="$_py3_deps"<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15863Python package policies2019-04-03T19:37:52Z<p>Ddevault: Update dep handling</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
_py2_deps="py2-setuptools"<br />
_py3_deps="py3-setuptools"<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="$_py2_deps $_py3_deps"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
depends="$depends $_py2_deps"<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
depends="$depends $_py3_deps"<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15832Python package policies2019-03-19T23:57:45Z<p>Ddevault: </p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== Guidelines ==<br />
<br />
* Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="python2 python3 py-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15831Python package policies2019-03-19T23:57:36Z<p>Ddevault: Updates per latest feedback on alpine-dev</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== Guidelines ==<br />
<br />
- Prefix Python 3 libraries with py3-, and Python 2 libraries with py2-. Do not prefix programs (distinct from libraries) at all.<br />
<br />
== General Template ==<br />
<br />
Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py2-example"</pre> as well. If the old package was a split package, also add <pre>replaces="py-example"</pre>.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py3-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="python2 python3 py-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py2<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
cd "$builddir"-py2<br />
python2 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
cd "$builddir"-py2<br />
python2 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"-py2<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"<br />
_py python3<br />
}<br />
<br />
_py() {<br />
_python="$1"<br />
pkgdesc="$pkgdesc (for $_python)"<br />
depends="$depends $_python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $_python"<br />
$_python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15799Python package policies2019-03-14T19:12:15Z<p>Ddevault: Address ncopa's feedback</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pyname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py3-example"</pre> as well.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py3-setuptools"<br />
_pypiprefix="${_pyname%${_pyname#?}}"<br />
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
Specify all of the runtime dependencies for both Python 2 & 3 in the makedepends.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pyname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=https://example.org<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="python2 python3 py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pyname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Alpine+Python projects ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines.<br />
<br />
TODO: obtain consensus and organize this work.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
The general approach to Python 2 deprecation and removal requires three broad steps:<br />
<br />
# Do not add new python 2 packages to aports, effective immediately.<br />
# In the course of the aports normalization project, drop Python 2 support if it's easy or triage it and make a note for later if not.<br />
# Making judgement calls for difficult packages on a case-by-case basis, based on the upstream's progress/amicability towards a Python 3 port. Upstreams which are unwilling to port to Python 3 should be removed from aports.<br />
<br />
TODO: Prepare some discussion place, git repos, scripts, etc, to organize this work.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=15798Sway2019-03-12T21:42:52Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
# Install eudev and run setup-udev to configure it<br />
# Install graphics drivers appropriate for your hardware<br />
# Add yourself to the input and video groups<br />
# Reboot<br />
<br />
== Installation ==<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
rxvt-unicode \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
swaylock \ # lockscreen tool<br />
swayidle # idle management (DPMS) daemon<br />
</pre><br />
<br />
Note: you may be required to install sway from [[Edge]].<br />
<br />
== Running Sway ==<br />
<br />
Simply run <code>sway</code> from your nearest TTY's Linux console.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15755Python package policies2019-03-06T21:07:40Z<p>Ddevault: Give the py3-only template a more prominent role on the page</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
=== Python 3 only ===<br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py3-example"</pre> as well.<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
=== Python 2 & 3 ===<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15754Python package policies2019-03-06T21:06:19Z<p>Ddevault: </p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py-example" and remove the -py2 subpackage. Merge the _py(), _py3,() and package() functions. Remove the prepare() function and drop the -py3 suffix from the builddir. An updated py3-only template is provided here:<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py3-example"</pre> as well.<br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15753Python package policies2019-03-06T21:05:38Z<p>Ddevault: </p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage. Merge the _py(), _py3,() and package() functions. Remove the prepare() function and drop the -py3 suffix from the builddir. An updated py3-only template is provided here:<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
Note that if you are removing python2 support from a package which previously had it, you should add <pre>replaces="py3-example"</pre> as well.<br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15752Python package policies2019-03-06T21:04:47Z<p>Ddevault: Add py3-only template</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage. Merge the _py(), _py3,() and package() functions. Remove the prepare() function and drop the -py3 suffix from the builddir. An updated py3-only template is provided here:<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
depends="python3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
build() {<br />
cd "$builddir"<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
python3 setup.py install --prefix=/usr --root="$pkgdir"<br />
}</pre><br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15751Python package policies2019-03-06T18:12:25Z<p>Ddevault: Mention dropping prepare() in py3-only packages</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage. Merge the _py(), _py3,() and package() functions. Remove the prepare() function and drop the -py3 suffix from the builddir.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15750Python package policies2019-03-06T17:46:04Z<p>Ddevault: Expand on py3-only package directions</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage. Merge the _py(), _py3,() and package() functions.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15749Python package policies2019-03-06T17:39:47Z<p>Ddevault: Add future work</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.<br />
<br />
== Future work ==<br />
<br />
=== aports normalization project ===<br />
<br />
Many Python packages in aports (if not most) do not follow these guidelines. TODO: figure out an approach and obtain consensus.<br />
<br />
=== Python 2 deprecation ===<br />
<br />
Python 2 is EoL in less than a year. Let's get rid of it. TODO: figure out an approach and obtain consensus.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15748Python package policies2019-03-06T17:36:25Z<p>Ddevault: Add note about watching build logs</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
* Read the build output and be vigilant for issues listed in the following sections - the build may complete successfully even though these issues are present<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Python_package_policies&diff=15747Python package policies2019-03-06T17:35:44Z<p>Ddevault: Initial page creation</p>
<hr />
<div>Python packages in Alpine Linux should follow a general set of standards for their APKBUILDs.<br />
<br />
{{Draft|Pending consensus on this approach}}<br />
<br />
== General Template ==<br />
<br />
This APKBUILD template includes a split py2-/py3- package and a py- metapackage, and downloads the source package from PyPI. Be sure to make the following changes:<br />
<br />
* Update maintainer to yourself<br />
* Set the pkgname to the Alpine package name (prefixed with "py-")<br />
* Set _pkgname to the name of the package on PyPI<br />
* Update the version number, pkgdesc, url, and license<br />
* Build it and address any issues that come up<br />
<br />
<pre># Maintainer: Joe Bloe <joe@example.org><br />
pkgname=py-alpine-name<br />
_pkgname=pypi-name<br />
pkgver=1.2.3<br />
pkgrel=0<br />
pkgdesc="Example Python package"<br />
url=http://example.org/<br />
arch=noarch<br />
license=MIT<br />
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"<br />
makedepends="py-setuptools"<br />
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"<br />
builddir=$srcdir/$_pkgname-$pkgver<br />
<br />
prepare() {<br />
cp -r "$builddir" "$builddir"-py3<br />
}<br />
<br />
build() {<br />
cd "$builddir"<br />
python2 setup.py build<br />
cd "$builddir"-py3<br />
python3 setup.py build<br />
}<br />
<br />
check() {<br />
cd "$builddir"<br />
python2 setup.py test<br />
cd "$builddir"-py3<br />
python3 setup.py test<br />
}<br />
<br />
package() {<br />
mkdir -p "$pkgdir"<br />
}<br />
<br />
_py2() {<br />
cd "$builddir"<br />
_py python2<br />
}<br />
<br />
_py3() {<br />
cd "$builddir"-py3<br />
_py python3<br />
}<br />
<br />
_py() {<br />
python="$1"<br />
pkgdesc="$pkgdesc (for $python)"<br />
depends="$depends $python"<br />
install_if="$pkgname=$pkgver-r$pkgrel $python"<br />
$python setup.py install --prefix=/usr --root="$subpkgdir"<br />
}</pre><br />
<br />
== Common issues ==<br />
<br />
=== No source package available (only the wheel is on PyPI) ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== No tests in PyPI package "(0 tests run)" ===<br />
<br />
Seek out the upstream source (e.g. GitHub) and swap out the URL.<br />
<br />
=== setup.py test downloads a lot of dependencies ===<br />
<br />
Watch out for this and be sure to add any of these packages to checkdepends so that setuptools isn't downloading and testing against packages/versions which aren't in aports.<br />
<br />
=== No python2 support ===<br />
<br />
In this case, rename the package to "py3-example" and remove the "py-" metapackage and "py2-" subpackage.<br />
<br />
=== Different dependencies between py2 and py3 versions ===<br />
<br />
Add depends="..." to the respective _py2 or _py3 subpackage functions.</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=14281Sway2018-01-21T16:09:50Z<p>Ddevault: </p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
# Install eudev and run setup-udev to configure it<br />
# Install graphics drivers appropriate for your hardware<br />
# Add yourself to the input and video groups<br />
# Reboot<br />
<br />
== Installation ==<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
rxvt-unicode \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
imagemagick \ # for taking screenshots<br />
ffmpeg # for recording video from the screen<br />
</pre><br />
<br />
Note: you may be required to install sway from [[Edge]].<br />
<br />
== Running Sway ==<br />
<br />
Simply run <code>sway</code> from your nearest TTY's Linux console.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].<br />
<br />
[[Category:Desktop]]</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=14166Sway2017-12-04T04:02:18Z<p>Ddevault: Formatting improvements</p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
# Run setup-udev to install and configure udev<br />
# Install graphics drivers appropriate for your hardware<br />
# Add yourself to the input and video groups<br />
# Reboot<br />
<br />
== Installation ==<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
rxvt-unicode \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
imagemagick \ # for taking screenshots<br />
ffmpeg # for recording video from the screen<br />
</pre><br />
<br />
Note: you may be required to install sway from [[Edge]].<br />
<br />
== Running Sway ==<br />
<br />
Simply run <code>sway</code> from your nearest TTY's Linux console.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=14165Sway2017-12-04T04:01:52Z<p>Ddevault: /* Installation */ better formatting</p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
# Run setup-udev to install and configure udev<br />
# Install graphics drivers appropriate for your hardware<br />
# Add yourself to the input and video groups<br />
# Reboot<br />
<br />
== Installation ==<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
rxvt-unicode \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
imagemagick \ # for taking screenshots<br />
ffmpeg # for recording video from the screen<br />
</pre><br />
<br />
Note: you may be required to install sway from [[Edge]].<br />
<br />
== Running Sway ==<br />
<br />
Simply run `sway` from your nearest TTY's Linux console.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].</div>Ddevaulthttps://wiki.alpinelinux.org/w/index.php?title=Sway&diff=14164Sway2017-12-04T04:01:29Z<p>Ddevault: Initial page</p>
<hr />
<div>[http://swaywm.org Sway] is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.<br />
<br />
== Prerequisites ==<br />
<br />
# Run setup-udev to install and configure udev<br />
# Install graphics drivers appropriate for your hardware<br />
# Add yourself to the input and video groups<br />
# Reboot<br />
<br />
== Installation ==<br />
<br />
<pre><br />
# apk add sway sway-doc<br />
# apk add \ # Install optional dependencies:<br />
xorg-server-xwayland \ # strongly reccommended for compatability reasons<br />
rxvt-unicode \ # default terminal emulator<br />
dmenu \ # default application launcher<br />
imagemagick \ # for taking screenshots<br />
ffmpeg # for recording video from the screen<br />
</pre><br />
<br />
Note: you may be required to install sway from [[Edge]].<br />
<br />
== Running Sway ==<br />
<br />
Simply run `sway` from your nearest TTY's Linux console.<br />
<br />
== Configuration and Usage ==<br />
<br />
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.<br />
<br />
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].</div>Ddevault