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

Adjust packaging #182

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Adjust packaging #182

merged 1 commit into from
Apr 22, 2024

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Apr 22, 2024

I checked the results of python -m build after merging #159 and found that both the .tar.gz and .whl outputs were about 10 MB. This was because the entire /doc/ directory—including many images added by that other PR—was included in both files.

This PR adjusts our setuptools config so that the /doc/ directory is:

  • included in the .tar.gz source distribution,
  • excluded from the .whl distribution.

This follows the practice of coverage and several other packages I looked at. It also ensures that users who install from .whl (with pip) don't wind up with an extra directory named site-packages/doc/ that contains the message-ix-models docs. (AFAIK, distributing these 'dangling' directories outside the ones strictly related to the package is bad practice.)

With these changes, the .whl file is also nice and slim at under 600 kB.

How to review

Note that the CI checks all pass.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation. N/A, packaging changes only
  • Update doc/whatsnew.

Prevents inclusion of /doc/ in built wheels.
@khaeru khaeru added the ci Continuous integration & testing label Apr 22, 2024
@khaeru khaeru self-assigned this Apr 22, 2024
@khaeru khaeru requested a review from glatterf42 April 22, 2024 13:31
Copy link
Member

@glatterf42 glatterf42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and useful to me once checks pass, thanks :)

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.7%. Comparing base (a01f61a) to head (1b43524).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #182   +/-   ##
=====================================
  Coverage   76.7%   76.7%           
=====================================
  Files        112     112           
  Lines       7154    7154           
=====================================
  Hits        5494    5494           
  Misses      1660    1660           

@khaeru khaeru merged commit d6b5a47 into main Apr 22, 2024
26 checks passed
@khaeru khaeru deleted the fix/message-doc-packaging branch April 22, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration & testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants