Re: __pycache__ directories (Re: Potential MBF: packages failing to build twice in a row)

2023-08-16 Thread Luca Boccassi
On Wed, 16 Aug 2023 at 09:43, Konstantin Demin  wrote:
>
> 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) )
> ```

Why should we do something like that by hand for every single python
source package? It doesn't make much sense. This is something that
needs to be handled in the tooling/infrastructure automatically, not
create busywork for hundreds of people.

Kind regards,
Luca Boccassi



Re: __pycache__ directories (Re: Potential MBF: packages failing to build twice in a row)

2023-08-16 Thread Konstantin Demin
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 :
>
> 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



Re: __pycache__ directories (Re: Potential MBF: packages failing to build twice in a row)

2023-08-15 Thread Michael Biebl

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.


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: __pycache__ directories (Re: Potential MBF: packages failing to build twice in a row)

2023-08-15 Thread 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.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part


Testing archive-wide changes (Was: __pycache__ directories (Re: Potential MBF: packages failing to)) build twice in a row)

2023-08-15 Thread Lucas Nussbaum
On 14/08/23 at 22:09 +0200, Michael Biebl wrote:
> Could maybe dh_clean automatically clean up such __pycache__ directories or
> do we really expect that each individual package does such a clean up
> manually?
> Or is there maybe a way to avoid the creation of the __pycache__ directories
> altogether.

Hi,

As a reminder, if someone needs to test a change over a large number of
packages, I can run custom rebuilds (typically pulling specific
packages from experimental or an external repository).

See https://lists.debian.org/debian-devel/2020/10/msg00097.html

It involves some manual work on my side, so please ask only for things 
you really want to push to Debian, and when the number of affected 
packages exceeds what you can build in a couple of days locally.
(But I don't think I have every declined any such request)

Lucas



__pycache__ directories (Re: Potential MBF: packages failing to build twice in a row)

2023-08-14 Thread Michael Biebl

Hi,

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.


Examples:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1048444
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1044727
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1045734

Could maybe dh_clean automatically clean up such __pycache__ directories 
or do we really expect that each individual package does such a clean up 
manually?
Or is there maybe a way to avoid the creation of the __pycache__ 
directories altogether.


Regards,
Michael




OpenPGP_signature.asc
Description: OpenPGP digital signature