Exclude tests from distribution packages #139

Merged
witten merged 1 commits from :master into master 2019-02-09 05:02:19 +00:00
Contributor

It is more common practice to exclude tests from distribution packages, currently the tests end up in the wheel and are deployed in the site-packages root.

Actually it is even weirder as the wheel for 1.2.15 on PyPI contains some of tests subpackages twice, once at root and once in the borgmatic package:

/home/nicoulaj/download/borgmatic-1.2.15-py3-none-any
├── borgmatic
│   ├── borg
│   │   ├── check.py
│   │   ├── create.py
│   │   ├── environment.py
│   │   ├── extract.py
│   │   ├── info.py
│   │   ├── __init__.py
│   │   ├── init.py
│   │   ├── list.py
│   │   └── prune.py
│   ├── commands
│   │   ├── borgmatic.py
│   │   ├── convert_config.py
│   │   ├── generate_config.py
│   │   ├── hook.py
│   │   └── __init__.py
│   ├── config
│   │   ├── checks.py
│   │   ├── collect.py
│   │   ├── convert.py
│   │   ├── generate.py
│   │   ├── __init__.py
│   │   ├── legacy.py
│   │   ├── schema.yaml
│   │   └── validate.py
│   ├── __init__.py
│   ├── signals.py
│   ├── tests
│   │   ├── __init__.py
│   │   ├── integration
│   │   │   ├── commands
│   │   │   │   ├── __init__.py
│   │   │   │   ├── test_borgmatic.py
│   │   │   │   ├── test_convert_config.py
│   │   │   │   └── test_generate_config.py
│   │   │   ├── config
│   │   │   │   ├── __init__.py
│   │   │   │   ├── test_generate.py
│   │   │   │   ├── test_legacy.py
│   │   │   │   └── test_validate.py
│   │   │   ├── __init__.py
│   │   │   └── test_version.py
│   │   └── unit
│   │       ├── borg
│   │       │   ├── __init__.py
│   │       │   ├── test_check.py
│   │       │   ├── test_create.py
│   │       │   ├── test_extract.py
│   │       │   ├── test_hook.py
│   │       │   ├── test_info.py
│   │       │   ├── test_list.py
│   │       │   └── test_prune.py
│   │       ├── commands
│   │       │   ├── __init__.py
│   │       │   └── test_borgmatic.py
│   │       ├── config
│   │       │   ├── __init__.py
│   │       │   ├── test_collect.py
│   │       │   ├── test_convert.py
│   │       │   ├── test_generate.py
│   │       │   ├── test_legacy.py
│   │       │   └── test_validate.py
│   │       ├── __init__.py
│   │       └── test_verbosity.py
│   └── verbosity.py
├── borgmatic-1.2.15.dist-info
│   ├── AUTHORS
│   ├── entry_points.txt
│   ├── LICENSE
│   ├── METADATA
│   ├── RECORD
│   ├── top_level.txt
│   └── WHEEL
└── tests
    ├── end-to-end
    │   ├── __init__.py
    │   └── test_borgmatic.py
    ├── __init__.py
    ├── integration
    │   ├── commands
    │   │   ├── __init__.py
    │   │   ├── test_borgmatic.py
    │   │   ├── test_convert_config.py
    │   │   └── test_generate_config.py
    │   ├── config
    │   │   ├── __init__.py
    │   │   ├── test_generate.py
    │   │   ├── test_legacy.py
    │   │   └── test_validate.py
    │   ├── __init__.py
    │   └── test_version.py
    └── unit
        ├── borg
        │   ├── __init__.py
        │   ├── test_check.py
        │   ├── test_create.py
        │   ├── test_environment.py
        │   ├── test_extract.py
        │   ├── test_hook.py
        │   ├── test_info.py
        │   ├── test_init.py
        │   ├── test_list.py
        │   └── test_prune.py
        ├── commands
        │   ├── __init__.py
        │   └── test_borgmatic.py
        ├── config
        │   ├── __init__.py
        │   ├── test_checks.py
        │   ├── test_collect.py
        │   ├── test_convert.py
        │   ├── test_generate.py
        │   ├── test_legacy.py
        │   └── test_validate.py
        ├── __init__.py
        └── test_verbosity.py

22 directories, 95 files

This PR completely exclude tests from distributions (including sdist).

It is more common practice to exclude tests from distribution packages, currently the tests end up in the wheel and are deployed in the `site-packages` root. Actually it is even weirder as the wheel for 1.2.15 on PyPI contains some of `tests` subpackages twice, once at root and once in the `borgmatic` package: ``` /home/nicoulaj/download/borgmatic-1.2.15-py3-none-any ├── borgmatic │   ├── borg │   │   ├── check.py │   │   ├── create.py │   │   ├── environment.py │   │   ├── extract.py │   │   ├── info.py │   │   ├── __init__.py │   │   ├── init.py │   │   ├── list.py │   │   └── prune.py │   ├── commands │   │   ├── borgmatic.py │   │   ├── convert_config.py │   │   ├── generate_config.py │   │   ├── hook.py │   │   └── __init__.py │   ├── config │   │   ├── checks.py │   │   ├── collect.py │   │   ├── convert.py │   │   ├── generate.py │   │   ├── __init__.py │   │   ├── legacy.py │   │   ├── schema.yaml │   │   └── validate.py │   ├── __init__.py │   ├── signals.py │   ├── tests │   │   ├── __init__.py │   │   ├── integration │   │   │   ├── commands │   │   │   │   ├── __init__.py │   │   │   │   ├── test_borgmatic.py │   │   │   │   ├── test_convert_config.py │   │   │   │   └── test_generate_config.py │   │   │   ├── config │   │   │   │   ├── __init__.py │   │   │   │   ├── test_generate.py │   │   │   │   ├── test_legacy.py │   │   │   │   └── test_validate.py │   │   │   ├── __init__.py │   │   │   └── test_version.py │   │   └── unit │   │   ├── borg │   │   │   ├── __init__.py │   │   │   ├── test_check.py │   │   │   ├── test_create.py │   │   │   ├── test_extract.py │   │   │   ├── test_hook.py │   │   │   ├── test_info.py │   │   │   ├── test_list.py │   │   │   └── test_prune.py │   │   ├── commands │   │   │   ├── __init__.py │   │   │   └── test_borgmatic.py │   │   ├── config │   │   │   ├── __init__.py │   │   │   ├── test_collect.py │   │   │   ├── test_convert.py │   │   │   ├── test_generate.py │   │   │   ├── test_legacy.py │   │   │   └── test_validate.py │   │   ├── __init__.py │   │   └── test_verbosity.py │   └── verbosity.py ├── borgmatic-1.2.15.dist-info │   ├── AUTHORS │   ├── entry_points.txt │   ├── LICENSE │   ├── METADATA │   ├── RECORD │   ├── top_level.txt │   └── WHEEL └── tests ├── end-to-end │   ├── __init__.py │   └── test_borgmatic.py ├── __init__.py ├── integration │   ├── commands │   │   ├── __init__.py │   │   ├── test_borgmatic.py │   │   ├── test_convert_config.py │   │   └── test_generate_config.py │   ├── config │   │   ├── __init__.py │   │   ├── test_generate.py │   │   ├── test_legacy.py │   │   └── test_validate.py │   ├── __init__.py │   └── test_version.py └── unit ├── borg │   ├── __init__.py │   ├── test_check.py │   ├── test_create.py │   ├── test_environment.py │   ├── test_extract.py │   ├── test_hook.py │   ├── test_info.py │   ├── test_init.py │   ├── test_list.py │   └── test_prune.py ├── commands │   ├── __init__.py │   └── test_borgmatic.py ├── config │   ├── __init__.py │   ├── test_checks.py │   ├── test_collect.py │   ├── test_convert.py │   ├── test_generate.py │   ├── test_legacy.py │   └── test_validate.py ├── __init__.py └── test_verbosity.py 22 directories, 95 files ``` This PR completely exclude tests from distributions (including sdist).
Owner

Good catch! Thanks for doing this. (Will merge when I get a chance later on.)

Good catch! Thanks for doing this. (Will merge when I get a chance later on.)
witten closed this pull request 2019-02-09 05:02:19 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#139
No description provided.