stdeb
stdeb copied to clipboard
--install-layout=deb not recognized
I am trying to debianize my python project and get the following error during the build:
python setup.py --command-packages=stdeb.command bdist_deb
...
python3 setup.py install --force --root=debian/python3-data-manager --no-compile -O0 --install-layout=deb --prefix=/usr
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --install-layout not recognized
I have the following packages installed:
pip3 list
Package Version
---------- -------
pip 19.2.3
setuptools 50.3.2
stdeb 0.10.0
Also having this problem when trying to build with stdeb
on the github actions ubuntu-20.04
runner.
It seems to be caused when the version of python running setuptools is not the system/apt installed version of python installed with the debian-specific patches applied (which are required for --install-layout
).
Setting SETUPTOOLS_USE_DISTUTILS=stdlib
or SETUPTOOLS_USE_DISTUTILS=local
didn't help either.
This is our .github/workflows/debian.yml
:
name: Build Debian package
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
architecture: x64
- name: Install packaging dependencies
run: |
sudo apt install -y python3 python3-dev python3-pip python3-venv python3-all dh-python debhelper devscripts dput software-properties-common python3-distutils python3-setuptools python3-wheel python3-stdeb
pip3 install --upgrade pip setuptools wheel stdeb
- name: Build Debian/Apt bdist_deb
run: |
python3 setup.py --command-packages=stdeb.command bdist_deb
- name: Install archivebox from deb
run: |
apt install ./deb_dist/archivebox*.deb
This fails on python3 setup.py --command-packages=stdeb.command bdist_deb
with error: option --install-layout not recognized
despite it being on a debian-based system.
However this version which uses only debian-installed python packages works (but is waaay slower):
name: Build Debian package
on:
push:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- name: Install packaging dependencies
run: |
sudo apt install -y \
python3 python3-dev python3-pip python3-venv python3-all \
dh-python debhelper devscripts dput software-properties-common \
python3-distutils python3-setuptools python3-wheel python3-stdeb
- name: Build Debian/Apt sdist_dsc
run: |
rm -Rf deb_dist/*
python3 setup.py --command-packages=stdeb.command sdist_dsc
- name: Build Debian/Apt bdist_deb
run: |
python3 setup.py --command-packages=stdeb.command bdist_deb
- name: Install archivebox from deb
run: |
cd deb_dist/
sudo apt install ./archivebox*.deb
It seems to be caused when the version of python running setuptools is not the system/apt installed version of python installed with the debian-specific patches applied (which are required for --install-layout).
That sounds reasonable since the Debian provided Python package provides that custom option to install Python modules under dist-packages
instead of site-packages
.
@maxx-bachurin How did you install the Python version you are using when running into this?
I have the same issue with the latest setuptools
version (60.5.0). I'm using python 3.8
on Ubuntu 20.04.
pip 20.0.2
setuptools 60.5.0
stdeb 0.10.0
No problems with a previous setuptools
version: 59.8.0.
I'm creating a Debian package in 2 steps like this:
$ python3 setup.py --command-packages=stdeb.command sdist_dsc
$ dpkg-buildpackage -rfakeroot -uc -us
It fails in the second command when this is being executed:
$ python3 setup.py install --force --root=debian/my-deb-pkg --no-compile -O0 --install-layout=deb
For now, my workaround is to pin the setuptools
version. However, I'd like to know if you have another solution or if this is going to be fixed in stdeb
soon.
I have the same issue with the latest
setuptools
version (60.5.0). I'm usingpython 3.8
on Ubuntu 20.04.pip 20.0.2 setuptools 60.5.0 stdeb 0.10.0
No problems with a previous
setuptools
version: 59.8.0.I'm creating a Debian package in 2 steps like this:
$ python3 setup.py --command-packages=stdeb.command sdist_dsc $ dpkg-buildpackage -rfakeroot -uc -us
It fails in the second command when this is being executed:
$ python3 setup.py install --force --root=debian/my-deb-pkg --no-compile -O0 --install-layout=deb
For now, my workaround is to pin the
setuptools
version. However, I'd like to know if you have another solution or if this is going to be fixed instdeb
soon.
downgrade of setuptools doesn't work for me :/