You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exclude dvc related files from source distribution #1086
The new workflow in #1036 adds more files into the git repository and some files are included in the source distribution by default.
Run make package and check the files in the tarball dist/pygmt-X.Y.Z.tar.gz.
I see some new files in the source distribution:
.dvc
.dvcignore
pygmt/tests/baseline/*.dvc
Some DVC images (e.g., pygmt/tests/baseline/test_logo.png) are also included in the tarball although they should be ignored by git and excluded from the source distribution by default.
A related question is: do we want to include the baseline images in the source distribution?
Some DVC images (e.g., pygmt/tests/baseline/test_logo.png) are also included in the tarball although they should be ignored by git and excluded from the source distribution by default.
Yep, we should update the MANIFEST.in file to exclude these *.dvc* files, and also the PNG files. If we really want to have those PNG baseline images somewhere, we can think about storing them on the Zenodo DOI for archival purposes (though might need a bit of work).
If we really want to have those PNG baseline images somewhere, we can think about storing them on the Zenodo DOI for archival purposes (though might need a bit of work).
Perhaps it's simpler to just upload the baseline images as GitHub release assets.
Some DVC images (e.g., pygmt/tests/baseline/test_logo.png) are also included in the tarball although they should be ignored by git and excluded from the source distribution by default.
These images are included in the source distribution because of the following line:
In the "Tests" workflow, we run the dvc pull command, so the dvc-tracked images are download from the remote repository. When we build the source distribution, the dvc-tracked images are also included and installed. So we can still run the tests.
So, the only thing we need to do is adding .dvc and .dvcignore into the MANIFEST.in file. See the PR #1095.
After we finish the migration of all baseline images, the source distribution will only contain the .dvc files, but not the .png files.
Ideally, we should also exclude .dvc files, but it will fail our Testing workflow.
Activity
weiji14 commentedon Mar 20, 2021
As you mentioned in #999 (comment)_:
I think we should move towards trimming the size of the PyPI sdist (.tar.gz) and bdist (.whl) down to less than 1MB. This would mean that
pygmt.test()at https://www.pygmt.org/v0.3.1/install.html#full-test-optional won't work out of the box. But really, what other Python package ships with a full test suite and tells users to run those tests anyway?Yep, we should update the MANIFEST.in file to exclude these
*.dvc*files, and also the PNG files. If we really want to have those PNG baseline images somewhere, we can think about storing them on the Zenodo DOI for archival purposes (though might need a bit of work).seisman commentedon Mar 21, 2021
Matplotlib includes all baseline images in their source tarballs (~40 MB) (https://pypi.org/project/matplotlib/#files), but not in wheels (~10 MB). They recommend users to download the source tarball and extract the test codes and baseline images before doing tests (https://matplotlib.org/stable/users/installing.html#test-data).
Perhaps it's simpler to just upload the baseline images as GitHub release assets.
seisman commentedon Mar 27, 2021
These images are included in the source distribution because of the following line:
pygmt/setup.py
Line 21 in 74c9366
seisman commentedon Mar 27, 2021
Here are the rules about which files are included in the source distributions:
MANEFEST.infiles are excluded.In the "Publish to PyPI" workflow, we don't run the
dvc pullcommand, so the dvc-tracked baseline images are not in the baseline directory, and are not included in the source distributions. If you download the tarball from TestPyPI (https://test.pypi.org/project/pygmt/0.3.2.dev38/#files), you will see that dvc-tracked images (e.g.,test_logo.png) are not included.In the "Tests" workflow, we run the
dvc pullcommand, so the dvc-tracked images are download from the remote repository. When we build the source distribution, the dvc-tracked images are also included and installed. So we can still run the tests.So, the only thing we need to do is adding
.dvcand.dvcignoreinto theMANIFEST.infile. See the PR #1095.After we finish the migration of all baseline images, the source distribution will only contain the
.dvcfiles, but not the.pngfiles.Ideally, we should also exclude
.dvcfiles, but it will fail our Testing workflow.