public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin packages with unnecessary __pycache__ directories
@ 2021-11-30 17:44 Adam Dinwoodie
  2021-12-01  1:42 ` Doug Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Dinwoodie @ 2021-11-30 17:44 UTC (permalink / raw)
  To: Cygwin (cygwin@cygwin.com)

Hi all,

I spotted earlier today that there are a significant number of Cygwin
packages that seem to include __pycache__ directories in the package.
I'd have expected this to be an error, and any Python code to be
distributed without the __pycache__ directories so that the local
Python installation can compile the bytecode locally. Certainly
distributing these files seems like it would unnecessarily inflate the
size of the affected packages.

Assuming this is actually an issue, and these directories aren't
desirable for some reason that hasn't occurred to me, I suspect fixing
this is most easily achieved by an update to cygport to automatically
exclude those directories. Once that's done, the next time the
affected packages are rebuilt they'd automatically miss these
extraneous files.

There's a list of affected packages at
<https://www.cygwin.com/cgi-bin2/package-grep.cgi?grep=__pycache__&arch=x86_64>.

Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cygwin packages with unnecessary __pycache__ directories
  2021-11-30 17:44 Cygwin packages with unnecessary __pycache__ directories Adam Dinwoodie
@ 2021-12-01  1:42 ` Doug Henderson
  2021-12-01  6:43   ` Marco Atzeri
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Henderson @ 2021-12-01  1:42 UTC (permalink / raw)
  To: Cygwin (cygwin@cygwin.com)

On Tue, 30 Nov 2021 at 10:45, Adam Dinwoodie <adam@dinwoodie.org> wrote:
>
> Hi all,
>
> I spotted earlier today that there are a significant number of Cygwin
> packages that seem to include __pycache__ directories in the package.
> I'd have expected this to be an error, and any Python code to be
> distributed without the __pycache__ directories so that the local
> Python installation can compile the bytecode locally. Certainly
> distributing these files seems like it would unnecessarily inflate the
> size of the affected packages.
>
> Assuming this is actually an issue, and these directories aren't
> desirable for some reason that hasn't occurred to me, I suspect fixing
> this is most easily achieved by an update to cygport to automatically
> exclude those directories. Once that's done, the next time the
> affected packages are rebuilt they'd automatically miss these
> extraneous files.
>
> There's a list of affected packages at
> <
https://www.cygwin.com/cgi-bin2/package-grep.cgi?grep=__pycache__&arch=x86_64
>.
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Including version specific pre-compiled files is actually OK for
'python2?-', 'python3?-' and 'python3??-' packages as long as the
'*.py[co]' files are compiled by the corresponding major version of python.
And it is actually required when the user does not have the permissions to
run setup or the installed python(s) in a elevated shell.

For all other packages, eg. 'python-', 'python?-' and packages that do not
start with those prefixes should not have pre-compiled files in the
'__pycache__' folder. Including an empty '__pycache__' folder is not
required, but not really a problem.

When the '__pychache__' folder or the cached files are not present after
installing the package, I believe the user may need to build them in an
elevated shell.

Doug
-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cygwin packages with unnecessary __pycache__ directories
  2021-12-01  1:42 ` Doug Henderson
@ 2021-12-01  6:43   ` Marco Atzeri
  0 siblings, 0 replies; 3+ messages in thread
From: Marco Atzeri @ 2021-12-01  6:43 UTC (permalink / raw)
  To: cygwin

On 01.12.2021 02:42, Doug Henderson via Cygwin wrote:
> On Tue, 30 Nov 2021 at 10:45, Adam Dinwoodie <adam@dinwoodie.org> wrote:
>>
>> Hi all,
>>
>> I spotted earlier today that there are a significant number of Cygwin
>> packages that seem to include __pycache__ directories in the package.
>> I'd have expected this to be an error, and any Python code to be
>> distributed without the __pycache__ directories so that the local
>> Python installation can compile the bytecode locally. Certainly
>> distributing these files seems like it would unnecessarily inflate the
>> size of the affected packages.
>>

> 
> When the '__pychache__' folder or the cached files are not present after
> installing the package, I believe the user may need to build them in an
> elevated shell.

In this case I see no reason to not provide them


> Doug

Marco



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-01  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 17:44 Cygwin packages with unnecessary __pycache__ directories Adam Dinwoodie
2021-12-01  1:42 ` Doug Henderson
2021-12-01  6:43   ` Marco Atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).