wagtail icon indicating copy to clipboard operation
wagtail copied to clipboard

Optimized wagtail packaging

Open PaarthAgarwal opened this issue 3 years ago • 12 comments

Excluded tests and maps from published artifacts as mentioned in #6130.

PaarthAgarwal avatar Mar 13 '22 09:03 PaarthAgarwal

Manage this branch in Squash

Test this branch here: https://paarthagarwalspeed-up-installs-ewgyz.squash.io

squash-labs[bot] avatar Mar 13 '22 09:03 squash-labs[bot]

Hey @gasman , I have include wagtail/tests/utils. I hope it fixes the issue

PaarthAgarwal avatar Mar 14 '22 05:03 PaarthAgarwal

At least by running python setup.py clean sdist bdist_wheel, I can confirm this:

  • Doesn’t remove anything from the wheel
  • Doesn’t make sure wagtail/test/utils stays present in the source dist (not 100% sure but I believe global-include doesn’t take file paths.

My bad. Got lost while reading discussions and references😅 I'll fix it

PaarthAgarwal avatar Mar 15 '22 05:03 PaarthAgarwal

At least by running python setup.py clean sdist bdist_wheel, I can confirm this:

  • Doesn’t remove anything from the wheel
  • Doesn’t make sure wagtail/test/utils stays present in the source dist (not 100% sure but I believe global-include doesn’t take file paths.

Do we also need to add utils test for wheels?

PaarthAgarwal avatar Mar 15 '22 13:03 PaarthAgarwal

@PaarthAgarwal yes, wagtail/tests/utils needs to be there for both wheels and source distributions.

thibaudcolas avatar Mar 15 '22 17:03 thibaudcolas

@gasman @thibaudcolas I have successfully excluded tests from source dist and wheels while leaving the wagtails/tests/utils untouched. Please have a look.

PaarthAgarwal avatar Mar 24 '22 06:03 PaarthAgarwal

Removing from UX Unification scope as this needs a core team decision by the looks of things.

@kaedroho if you could re-read the thread above and maybe give an indication of when we might want to remove the test redirection imports?

lb- avatar Aug 31 '22 06:08 lb-

@kaedroho if you could re-read the thread above and maybe give an indication of when we might want to remove the test redirection imports?

Since these are not documented, we could remove them now. These were added since some third-party libraries might be importing from wagtail.tests.utils which, AFAIK is not a public API.

kaedroho avatar Sep 02 '22 11:09 kaedroho

wagtail.tests.utils is a public API: https://docs.wagtail.org/en/stable/advanced_topics/testing.html

gasman avatar Sep 02 '22 11:09 gasman

Ahh, thanks!

In that case, we'd need to add in some deprecation warnings for a couple of releases. We have a helper to make it easier to define deprecation warnings for moved modules here: https://github.com/wagtail/wagtail/blob/main/wagtail/utils/deprecation.py#L16

kaedroho avatar Sep 02 '22 11:09 kaedroho

Just flagging with 6.0 around the corner, this is now ready for consideration again.

thibaudcolas avatar Nov 14 '23 14:11 thibaudcolas

I can confirm that there is no longer anything in wagtail.tests (with an S) that needs to be included in the Wagtail package.

gasman avatar Nov 14 '23 15:11 gasman