Skip to content

Exclude test files from source/binary distributions #2956

Closed

Description

@seisman

Running make package can create source and binary distributions. Here are the files/directories included in the source tarball:

$ tree -L 2
.
├── AUTHORSHIP.md
├── AUTHORS.md
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── LICENSE.txt
├── MANIFEST.in
├── PKG-INFO
├── pygmt
│   ├── accessors.py
│   ├── clib
│   ├── datasets
│   ├── exceptions.py
│   ├── figure.py
│   ├── helpers
│   ├── __init__.py
│   ├── io.py
│   ├── session_management.py
│   ├── sphinx_gallery.py
│   ├── src
│   └── tests
├── pygmt.egg-info
│   ├── dependency_links.txt
│   ├── PKG-INFO
│   ├── requires.txt
│   ├── SOURCES.txt
│   └── top_level.txt
├── pyproject.toml
├── README.rst
└── setup.cfg

8 directories, 22 files
  1. AUTHORSHIP.md is excluded in MANIFEST.in. Why is it still here?
  2. Exclude CODE_OF_CONDUCT.md from the tarball?
  3. Exclude the whole pygmt/tests directory? The reasons are (1): tests are 536 KB and others are 900 KB. (2) Users can't run these tests due to the missing DVC files.

Activity

  1. added
    maintenanceBoring but important stuff for the core devs
    discussionsNeed more discussion before taking further actions
    on Jan 5, 2024
  2. weiji14 commented on Jan 6, 2024

    @weiji14
    Member

    AUTHORSHIP.md is excluded in MANIFEST.in. Why is it still here?

    Might be a case of pypa/setuptools#3260? We switched from setup.py to pyproject.toml in #1848 around Aug 2022, but most of the 'exclude' lines in MANIFEST.in was last modified in #999 around Mar 2021, and we might not have checked things properly. I tried for a bit with some settings, but couldn't figure out how to exclude those files...

  3. weiji14 commented on Jan 6, 2024

    @weiji14
    Member

    Yeah, I just tried downloading the sdist tar.gz files for PyGMT, and v0.4.1 (released 7 Aug 2021) was the last time when AUTHORSHIP.md was excluded. All the releases from v0.5.0 (released 29 Oct 2021) onwards to v0.10.0 contain AUTHORSHIP.md 😅 Might not be a setup.py/pyproject.toml thing, but some setuptools bug.

  4. seisman commented on Jan 6, 2024

    @seisman
    MemberAuthor

    It's likely that AUTHORSHIP.md is a special name and is always included:

    make package
    python -m build
    * Creating venv isolated environment...
    * Installing packages in isolated environment... (setuptools>=64, setuptools_scm[toml]>=6.2)
    * Getting dependencies for sdist...
    running egg_info
    writing pygmt.egg-info/PKG-INFO
    writing dependency_links to pygmt.egg-info/dependency_links.txt
    writing requirements to pygmt.egg-info/requires.txt
    writing top-level names to pygmt.egg-info/top_level.txt
    reading manifest template 'MANIFEST.in'
    adding license file 'LICENSE.txt'
    adding license file 'AUTHORS.md'
    adding license file 'AUTHORSHIP.md'
    writing manifest file 'pygmt.egg-info/SOURCES.txt'
    * Building sdist...
    running sdist
    running egg_info
    writing pygmt.egg-info/PKG-INFO
    writing dependency_links to pygmt.egg-info/dependency_links.txt
    writing requirements to pygmt.egg-info/requires.txt
    writing top-level names to pygmt.egg-info/top_level.txt
    reading manifest template 'MANIFEST.in'
    adding license file 'LICENSE.txt'
    adding license file 'AUTHORS.md'
    adding license file 'AUTHORSHIP.md'
    writing manifest file 'pygmt.egg-info/SOURCES.txt'
    running check
    creating pygmt-0.10.1.dev203+g24e032439
    creating pygmt-0.10.1.dev203+g24e032439/pygmt
    creating pygmt-0.10.1.dev203+g24e032439/pygmt.egg-info
    creating pygmt-0.10.1.dev203+g24e032439/pygmt/clib
    creating pygmt-0.10.1.dev203+g24e032439/pygmt/datasets
    creating pygmt-0.10.1.dev203+g24e032439/pygmt/helpers
    creating pygmt-0.10.1.dev203+g24e032439/pygmt/src
    creating pygmt-0.10.1.dev203+g24e032439/pygmt/tests
    creating pygmt-0.10.1.dev203+g24e032439/pygmt/tests/data
    copying files to pygmt-0.10.1.dev203+g24e032439...
    copying AUTHORS.md -> pygmt-0.10.1.dev203+g24e032439
    copying AUTHORSHIP.md -> pygmt-0.10.1.dev203+g24e032439
    copying CITATION.cff -> pygmt-0.10.1.dev203+g24e032439
    copying CODE_OF_CONDUCT.md -> pygmt-0.10.1.dev203+g24e032439
    ...
    
  5. seisman commented on Jan 6, 2024

    @seisman
    MemberAuthor

    Making following changes to MANIFEST.in:

    diff --git a/MANIFEST.in b/MANIFEST.in
    index 88e203e94..da8835b2c 100644
    --- a/MANIFEST.in
    +++ b/MANIFEST.in
    @@ -3,12 +3,13 @@ prune .github*
     prune ci
     prune doc*
     prune examples*
    +prune pygmt/tests*
     exclude .dvcignore
     exclude .gitignore
     exclude .readthedocs.yaml
     exclude AUTHORSHIP.md
    +exclude CODE_OF_CONDUCT.md
     exclude CONTRIBUTING.md
     exclude Makefile
     exclude environment.yml
     exclude requirements.txt
    -exclude pygmt/tests/baseline/*.dvc

    Then the source tarball contains following files/directories:

    tree -a -L 2
    .
    ├── AUTHORS.md
    ├── AUTHORSHIP.md
    ├── CITATION.cff
    ├── LICENSE.txt
    ├── MANIFEST.in
    ├── PKG-INFO
    ├── README.rst
    ├── pygmt
    │   ├── __init__.py
    │   ├── accessors.py
    │   ├── clib
    │   ├── datasets
    │   ├── exceptions.py
    │   ├── figure.py
    │   ├── helpers
    │   ├── io.py
    │   ├── session_management.py
    │   ├── sphinx_gallery.py
    │   └── src
    ├── pygmt.egg-info
    │   ├── PKG-INFO
    │   ├── SOURCES.txt
    │   ├── dependency_links.txt
    │   ├── requires.txt
    │   └── top_level.txt
    ├── pyproject.toml
    └── setup.cfg
    

    The new source tarball is 178 KB, compared to 244 KB for the old source tarball.

  6. seisman commented on Jan 6, 2024

    @seisman
    MemberAuthor

    AUTHORSHIP.md is excluded in MANIFEST.in. Why is it still here?

    Might be a case of pypa/setuptools#3260? We switched from setup.py to pyproject.toml in #1848 around Aug 2022, but most of the 'exclude' lines in MANIFEST.in was last modified in #999 around Mar 2021, and we might not have checked things properly. I tried for a bit with some settings, but couldn't figure out how to exclude those files...

    Likely related to https://github.com/pypa/setuptools/blob/85fd45b7d10441f006cbbdee2b718aa741db5246/NEWS.rst#breaking-changes-12.

  7. weiji14 commented on Jan 6, 2024

    @weiji14
    Member

    AUTHORSHIP.md is excluded in MANIFEST.in. Why is it still here?

    Might be a case of pypa/setuptools#3260? We switched from setup.py to pyproject.toml in #1848 around Aug 2022, but most of the 'exclude' lines in MANIFEST.in was last modified in #999 around Mar 2021, and we might not have checked things properly. I tried for a bit with some settings, but couldn't figure out how to exclude those files...

    Likely related to https://github.com/pypa/setuptools/blob/85fd45b7d10441f006cbbdee2b718aa741db5246/NEWS.rst#breaking-changes-12.

    Ah nice, so need to add this to pyproject.toml:

    [tool.setuptools]
    platforms = ["Any"]
    include-package-data = true
    +license-files = ["LICENSE.txt"]
  8. removed
    discussionsNeed more discussion before taking further actions
    on Jan 6, 2024
  9. added this to the 0.11.0 milestone on Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceBoring but important stuff for the core devs

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions