Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--install-layout=deb not recognized #175

Open
maxx-bachurin opened this issue Nov 26, 2020 · 4 comments
Open

--install-layout=deb not recognized #175

maxx-bachurin opened this issue Nov 26, 2020 · 4 comments

Comments

@maxx-bachurin
Copy link

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
@pirate
Copy link

pirate commented Dec 11, 2020

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

@dirk-thomas
Copy link
Collaborator

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?

@dianacgil
Copy link

dianacgil commented Jan 10, 2022

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.

@xsevy
Copy link

xsevy commented Dec 2, 2022

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.

downgrade of setuptools doesn't work for me :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants