Caffeine does not compile with python-setuptools 61.0+

Bug #1981419 reported by Lance G.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Caffeine
Fix Released
Undecided
Unassigned

Bug Description

I am trying to compile this for my own Linux system with this helper package. https://aur.archlinux.org/packages/caffeine

It seems like python-setuptools had a code update that changed how auto discovery of modules during build worked. If I understood what I read at https://github.com/pypa/setuptools/issues/3197

Although I use Arch Linux, I'm reporting the issue here since this seems to be the place for the caffeine code. I'm not sure if a backwards compatible fix can be made since it seems Ubuntu has yet to get 'python-setuptools' v61 or newer yet.

```
Compiling for Locale: ar
Compiling for Locale: be
Compiling for Locale: bg
Compiling for Locale: bs
Compiling for Locale: ca
Compiling for Locale: cs
Compiling for Locale: da
Compiling for Locale: de
Compiling for Locale: el
Compiling for Locale: en_GB
Compiling for Locale: eo
Compiling for Locale: es
Compiling for Locale: eu
Compiling for Locale: fi
Compiling for Locale: fr
Compiling for Locale: gl
Compiling for Locale: he
Compiling for Locale: hr
Compiling for Locale: hu
Compiling for Locale: id
Compiling for Locale: it
Compiling for Locale: ja
Compiling for Locale: ko
Compiling for Locale: lt
Compiling for Locale: ms
Compiling for Locale: nl
Compiling for Locale: no
Compiling for Locale: oc
Compiling for Locale: pl
Compiling for Locale: pt
Compiling for Locale: pt_BR
Compiling for Locale: ro
Compiling for Locale: ru
Compiling for Locale: si
Compiling for Locale: sk
Compiling for Locale: sl
Compiling for Locale: sr
Compiling for Locale: sv
Compiling for Locale: sw
Compiling for Locale: th
Compiling for Locale: tr
Compiling for Locale: uk
Compiling for Locale: vi
Compiling for Locale: xh
Compiling for Locale: zh_CN
Compiling for Locale: zh_TW
error: Multiple top-level packages discovered in a flat-layout: ['etc', 'share', 'translations'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names

To find more information, look for "package discovery" on setuptools docs.
```

Revision history for this message
Lance G. (shapeshifter499) wrote :

The fix appears to be adding ```py_modules=[]``` to the bottom of the 'setup' array of setup.py. That is the work around I am using for now.

Revision history for this message
Reuben Thomas (rrt) wrote :

Thanks very much for reporting this and providing the fix. I have applied the fix to bazaar now. (It doesn't seem necessary to make a new release until this is a problem for distros that package from source releases.)

Changed in caffeine:
status: New → Fix Committed
Revision history for this message
Reuben Thomas (rrt) wrote :

I'd forgotten that new releases are now trivial for me, so I made a new release, 2.9.12.

Changed in caffeine:
status: Fix Committed → Fix Released
Revision history for this message
Lance G. (shapeshifter499) wrote :

Thank you

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.