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

Reduce the size of our built packages #154

Open
9 tasks
leouieda opened this issue Jun 10, 2024 · 3 comments
Open
9 tasks

Reduce the size of our built packages #154

leouieda opened this issue Jun 10, 2024 · 3 comments

Comments

@leouieda
Copy link
Member

Description:

At the moment, we put a lot of stuff in the packages we upload to PyPI: actual code, tests, test data, doc sources, etc. For installed packages, the only thing that's actually necessary is the actual code. We used to package the tests so that we could run the tests on the installed package but we never do that in practice. This results in our packages being larger than they need to be and wasted bandwidth.

In the spirit of frugal computing, I'd like to propose:

  1. Only build packages that have the actual code and the LICENSE.txt file. The supporting .md files don't need to be there since nobody looks at them in packages anyway.
  2. Remove the tests folder from inside the package and place it at a top-level tests folder. This will require editing our Makefile but it shouldn't be a big deal.

Apply to:

Need to update the contributing guide in:

Further instructions:

  • Start by opening Pull Requests on each repository listed above.
  • Optionally, we can open Issues on each repository if further discussion specific to that repository is needed.
  • Mention this Issue on every Issue or Pull Request opened on each opened: Related to fatiando/community#XX
  • Check-off the repository on the list above once the Pull Request is merged.
  • Close this issue when all items are checked-off.

We want your help!

We know that maintenance tasks are very demanding, so we don't expect a single person to tackle this issue by themselves. Any help is very welcomed, so please comment below that you want to take care of the changes on any repository and we will assign it to you.

@leouieda
Copy link
Member Author

Triggered by fatiando/pooch#423 and fatiando/pooch#416

@penguinpee
Copy link

I think that's a good idea. To make life easier for yourselves when it comes to automatic discovery, I'd suggest switching to a flat layout. With the current layout and automatic discovery it's actually quite hard to exclude the tests.

With a flat layout the doc(s)/ and test(s)/ directories would be excluded by default.

@penguinpee
Copy link

On second thought and after having had a quick shot at the flat layout with pooch, the src layout might be more suitable, less error prone if you want to make use of automatic discovery.

Of course, that's not a requirement and being explicit regarding what to include and what not is also an option. For pooch the data/ and paper/ directories prevent use of automatic discovery with a flat layout. Of course those directories could be moved into a directory that is on the DEFAULT_EXCLUDE list.

I'd be willing to open a PR (or amend my current PR) for pooch. However, I feel the decision on which layout is preferred should come from the maintainers.

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