Skip to content

Instantly share code, notes, and snippets.

@kmille
Created February 20, 2023 20:58
Show Gist options
  • Save kmille/766b749dba082a9bb15dc7415361cefd to your computer and use it in GitHub Desktop.
Save kmille/766b749dba082a9bb15dc7415361cefd to your computer and use it in GitHub Desktop.

Hey,

I have a project called riseup-vpn-configurator which uses python and poetry. The project is already published on AUR, but it's currently broken. The issue is: the python files are missing and are not part of the wheel package. Checkout the PKGBUILD. To build the python project, I use python -m build --wheel --no-isolation. This is recommended by the Arch-Wiki.

I can build it manually, then riseup_vpn_configurator/*.py files are part of the package

kmille@linbox:tmp 
kmille@linbox:tmp curl -L -o riseup.tar.gz https://github.com/kmille/riseup-vpn-configurator/archive/refs/tags/v0.1.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 40723    0 40723    0     0  54424      0 --:--:-- --:--:-- --:--:-- 54424
kmille@linbox:tmp file riseup.tar.gz 
riseup.tar.gz: gzip compressed data, from Unix, original size modulo 2^32 143360
kmille@linbox:tmp tar -xf riseup.tar.gz 
kmille@linbox:tmp 
kmille@linbox:tmp cd riseup-vpn-configurator-0.1.2 
kmille@linbox:riseup-vpn-configurator-0.1.2 python -m build --wheel --no-isolation                      
* Getting build dependencies for wheel...
* Building wheel...
Successfully built riseup_vpn_configurator-0.1.2-py3-none-any.whl
kmille@linbox:riseup-vpn-configurator-0.1.2 unzip -l dist/riseup_vpn_configurator-0.1.2-py3-none-any.whl 
Archive:  dist/riseup_vpn_configurator-0.1.2-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
    15350  1980-01-01 00:00   riseup_vpn_configurator/__init__.py
      409  1980-01-01 00:00   riseup_vpn_configurator/latency.py
      175  1980-01-01 00:00   riseup_vpn_configurator/riseup-vpn.yaml
    35149  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/LICENSE
     6170  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/METADATA
       88  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/WHEEL
       81  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/entry_points.txt
      748  2016-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/RECORD
---------                     -------
    58170                     8 files
kmille@linbox:riseup-vpn-configurator-0.1.2 

If I build it with makepkg, the python files are missing.

kmille@linbox:riseup-vpn-configurator makepkg                                                                    
==> Making package: riseup-vpn-configurator 0.1.2-2 (Mon 20 Feb 2023 09:49:36 PM CET)                                                                                                                                             
==> Checking runtime dependencies...                                                                             
==> Checking buildtime dependencies...                                                                           
==> Retrieving sources...                                                                                        
  -> Downloading v0.1.2.tar.gz...                                                                                                                                                                                                 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  
                                 Dload  Upload   Total   Spent    Left  Speed                                    
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  
100 40723    0 40723    0     0  47414      0 --:--:-- --:--:-- --:--:-- 47414
==> Validating source files with sha256sums...
    v0.1.2.tar.gz ... Passed
==> Extracting sources...
  -> Extracting v0.1.2.tar.gz with bsdtar
==> Starting build()...
/home/kmille/projects/arch-aur-contrib/riseup-vpn-configurator/src/riseup-vpn-configurator-0.1.2
total 136K
drwxr-xr-x 6 kmille kmille 4.0K Feb 16 12:44 .
drwxr-xr-x 3 kmille kmille 4.0K Feb 20 21:49 ..
drwxr-xr-x 3 kmille kmille 4.0K Feb 16 12:44 .github
-rw-r--r-- 1 kmille kmille   50 Feb 16 12:44 .gitignore
-rw-r--r-- 1 kmille kmille  35K Feb 16 12:44 LICENSE
drwxr-xr-x 2 kmille kmille 4.0K Feb 16 12:44 monitoring
-rw-r--r-- 1 kmille kmille  59K Feb 16 12:44 poetry.lock
-rw-r--r-- 1 kmille kmille 1.2K Feb 16 12:44 pyproject.toml
-rw-r--r-- 1 kmille kmille 5.2K Feb 16 12:44 README.md
drwxr-xr-x 2 kmille kmille 4.0K Feb 16 12:44 riseup_vpn_configurator
drwxr-xr-x 2 kmille kmille 4.0K Feb 16 12:44 tests
* Getting build dependencies for wheel...
* Building wheel...
Successfully built riseup_vpn_configurator-0.1.2-py3-none-any.whl
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "riseup-vpn-configurator"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: riseup-vpn-configurator 0.1.2-2 (Mon 20 Feb 2023 09:49:41 PM CET)
kmille@linbox:riseup-vpn-configurator tar -tf riseup-vpn-configurator-0.1.2-2-any.pkg.tar.zst                                 
.BUILDINFO
.MTREE
.PKGINFO
usr/
usr/bin/
usr/bin/riseup-vpn-configurator
usr/lib/
usr/lib/python3.10/
usr/lib/python3.10/site-packages/
usr/lib/python3.10/site-packages/riseup_vpn_configurator-0.1.2.dist-info/
usr/lib/python3.10/site-packages/riseup_vpn_configurator-0.1.2.dist-info/LICENSE
usr/lib/python3.10/site-packages/riseup_vpn_configurator-0.1.2.dist-info/METADATA
usr/lib/python3.10/site-packages/riseup_vpn_configurator-0.1.2.dist-info/RECORD
usr/lib/python3.10/site-packages/riseup_vpn_configurator-0.1.2.dist-info/WHEEL
usr/lib/python3.10/site-packages/riseup_vpn_configurator-0.1.2.dist-info/entry_points.txt

kmille@linbox:riseup-vpn-configurator cat PKGBUILD                                                                                        
# Maintainer: kmille [email protected]

pkgname=riseup-vpn-configurator
pkgver=0.1.2
pkgrel=2
pkgdesc="a simple command line tool to get RiseupVPN up and running"
arch=('any')
url="https://github.com/kmille/riseup-vpn-configurator"
license=('GPL3')
makedepends=(python-build python-installer python-wheel)
depends=(openvpn openvpn-reconnect python python-jinja python-requests python-yaml python-pyasn1 python-pyasn1-modules python-psutil python-ping3)
source=(https://github.com/kmille/riseup-vpn-configurator/archive/refs/tags/v$pkgver.tar.gz)
sha256sums=('58590e48dac56b3f87149f1620c020d510340e62b284a2161f156c14f40afb7e')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  pwd
  ls -lah
  python -m build --wheel --no-isolation
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
}
kmille@linbox:riseup-vpn-configurator 

I don't know what's going wrong here. Can you help me?

@kmille
Copy link
Author

kmille commented Feb 20, 2023

For completeness

kmille@linbox:riseup-vpn-configurator unzip -l src/riseup-vpn-configurator-0.1.2/dist/riseup_vpn_configurator-0.1.2-py3-none-any.whl 
Archive:  src/riseup-vpn-configurator-0.1.2/dist/riseup_vpn_configurator-0.1.2-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
    35149  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/LICENSE
     6170  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/METADATA
       88  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/WHEEL
       81  1980-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/entry_points.txt
      470  2016-01-01 00:00   riseup_vpn_configurator-0.1.2.dist-info/RECORD
---------                     -------
    41958                     5 files
kmille@linbox:riseup-vpn-configurator 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment