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

python: consider splitting out the stdlib tests #9908

Open
GitMensch opened this issue Oct 28, 2021 · 10 comments
Open

python: consider splitting out the stdlib tests #9908

GitMensch opened this issue Oct 28, 2021 · 10 comments

Comments

@GitMensch
Copy link
Contributor

GitMensch commented Oct 28, 2021

Just did a fresh install and have seen that the python package ships with a big lib/python directory.
Is this really needed - especially the "test" subdirectory which takes 60MB alone?

If not then it would be very reasonable to delete those in the PKGBUILD instead of shipping them; or, if it is only very seldom needed, move that out to an optional python-testlibs package.

Rechecked: the old Python Windows package I've installed over three years ago also includes lib/test (with much less content, but still). Nonetheless: Does a user of MinGW would need that?

Is it also reasonable to ship the __pycache__ folders?

@GitMensch GitMensch changed the title python install with bug "lib/python" python install with big "lib/python" Oct 28, 2021
@lazka
Copy link
Member

lazka commented Oct 28, 2021

If not then it would be very reasonable to delete those in the PKGBUILD instead of shipping them; or, if it is only very seldom needed, move that out to an optional python-testlibs package.

Is any other distro doing that? And which directories does this include? There are lots of test_xxx directories

Is it also reasonable to ship the __pycache__ folders?

If we wouldn't ship them then Python would create them and they wouldn't be tracked by pacman.

@GitMensch
Copy link
Contributor Author

If we wouldn't ship them then Python would create them ...

sure, but only those that are actually used, and there would be some space saving for sure

... and they wouldn't be tracked by pacman.

Hm, would an uninstall then go wrong? All those __pycache__ directories would still be below a directory "created" by pacman for the package.

Is any other distro doing that?

I'm neither a python nor a distro expert so I don't know. The main question is "what do we want" and what would be the (implied) result.

And which directories does this include? There are lots of test_xxx directories

I've thought about lib/tests and everything below and all __pycache__ directories.
Do we have a python expert knowing about the files there (or possibly should contact the python mailing list)?

@lazka
Copy link
Member

lazka commented Oct 28, 2021

@GitMensch
Copy link
Contributor Author

That's interesting. So it looks 3.10 has a --disable-test-modules that we can use when updating MSYS2 python from 3.9 to 3.10 which will then also fix this issue, Hooray! (at least the test part, not sure what to do about the implications of dropping __pycache__ directories).

Is someone working on this update or any known issue with 3.10?

@lazka
Copy link
Member

lazka commented Oct 29, 2021

That's interesting. So it looks 3.10 has a --disable-test-modules that we can use when updating MSYS2 python from 3.9 to 3.10 which will then also fix this issue, Hooray! (at least the test part, not sure what to do about the implications of dropping __pycache__ directories).

If we want to remove the tests, yes (do we?). For splitting it at least defines the set of optional directories in an official way which we could split... as we still have to install them during the package build.

Is someone working on this update or any known issue with 3.10?

That's happening here: msys2-contrib/cpython-mingw#52 Not sure when that will be ready.

@lazka lazka changed the title python install with big "lib/python" python: consider splitting out the stdlib tests Oct 29, 2021
@lazka
Copy link
Member

lazka commented Oct 29, 2021

Is any other distro doing that?

To answer that, Arch does: https://archlinux.org/packages/core/x86_64/python-tests/

@GitMensch
Copy link
Contributor Author

GitMensch commented Oct 29, 2021

In this case I think MSYS2 definitely should do the same.

@GitMensch
Copy link
Contributor Author

@lazka
Copy link
Member

lazka commented Oct 29, 2021

Since removing the tests as a user is hard and this is "supported" upstream now this sounds good to me.

@GitMensch
Copy link
Contributor Author

... and it fits perfectly well in the current "minimal size approach", too :-)
Sadly I won't find the time for this myself in the next weeks, possibly months.

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

2 participants