I'd recommend to add in d/rules following variable:

```make
export PYTHONDONTWRITEBYTECODE=1
```

Optionally add this too:

```make
export PYTHONUNBUFFERED=1
```

Extra thing:

```make
define remove_pycache

: # $(strip $(1)): remove Python cache
find $(strip $(1))/ -name __pycache__ -type d -exec rm -rf {} +
find $(strip $(1))/ -name '*.py[co]' -ls -delete

endef
```

and then use it like this:

```make
$(call remove_pycache, $(CURDIR) )
```

ср, 16 авг. 2023 г. в 08:41, Michael Biebl <bi...@debian.org>:
>
> Am 16.08.23 um 06:02 schrieb Paul Wise:
> > On Mon, 2023-08-14 at 22:09 +0200, Michael Biebl wrote:
> >
> >> I received a couple of bug reports against packages I (co) maintain
> >> regarding this issue and having a quick look, quite a few fail due to
> >> python scripts being run during the build and creating a __pycache__
> >> directory.
> >
> > I recommend asking upstream to delete those directories from their VCS.
> >
>
> Those directories were created *during* build.
> They are not shipped in the VCS.



-- 
SY,
Konstantin Demin

Reply via email to