[GH-ISSUE #126] PyPI package doesn't include tests #67

Closed
opened 2026-02-27 15:46:15 +03:00 by kerem · 7 comments
Owner

Originally created by @einsibjarni on GitHub (Nov 22, 2022).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/126

I just took over as maintainer of the freebsd port for proxmoxer.

The port fetches the pypi package, which doesnt include the tests/ directory.

Is it possible to include the tests i the pypi package? That way users on FreeBSD could run the tests directly from ports (make tests).

Originally created by @einsibjarni on GitHub (Nov 22, 2022). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/126 I just took over as maintainer of the freebsd port for proxmoxer. The port fetches the pypi package, which doesnt include the tests/ directory. Is it possible to include the tests i the pypi package? That way users on FreeBSD could run the tests directly from ports (`make tests`).
Author
Owner

@morph027 commented on GitHub (Nov 22, 2022):

Sure, should be possible via https://setuptools.pypa.io/en/latest/userguide/datafiles.html

Do you wanto to create a PR?

<!-- gh-comment-id:1323881014 --> @morph027 commented on GitHub (Nov 22, 2022): Sure, should be possible via https://setuptools.pypa.io/en/latest/userguide/datafiles.html Do you wanto to create a PR?
Author
Owner

@jhollowe commented on GitHub (Nov 23, 2022):

Is there a reason the port can't just fetch the git repo release tar as well or instead of pulling from PyPI?

There really isn't a reason to include a bunch of extra files and bytes in the PyPI package which 90% of users who download the package will never use. #39 removed the tests from the package.

<!-- gh-comment-id:1324394055 --> @jhollowe commented on GitHub (Nov 23, 2022): Is there a reason the port can't just fetch the git repo release tar as well or instead of pulling from PyPI? There really isn't a reason to include a bunch of extra files and bytes in the PyPI package which 90% of users who download the package will never use. #39 removed the tests from the package.
Author
Owner

@einsibjarni commented on GitHub (Nov 23, 2022):

The port can fetch the git repo, but guidelines for FreeBSD python ports states:

Guideline: Use standard Python ecosystem infrastructure whenever possible.

    Ports SHOULD use MASTER_SITES=CHEESESHOP if a Python package is registered on PyPI, unless there is a compelling (temporary) case not to. 

Examples where temporarily using an alternate MASTER_SITES is warranted:

    Some files are not correctly packaged or included at all in the PyPI sdist, such as licenses, test suite files or data. Submit an upstream issue or PR in these cases.
    A source distribution (sdist) has not been uploaded yet 

I'm not experienced enough in pypi packaging to know whether it's standard practice to exclude tests from pypi sdist, but these are the guidelines for FreeBSD.

I'll do some research and discuss it with FreeBSD people to get a better understanding of the possible issues and get back to this when I know more

<!-- gh-comment-id:1324724318 --> @einsibjarni commented on GitHub (Nov 23, 2022): The port can fetch the git repo, but guidelines for FreeBSD python ports states: ``` Guideline: Use standard Python ecosystem infrastructure whenever possible. Ports SHOULD use MASTER_SITES=CHEESESHOP if a Python package is registered on PyPI, unless there is a compelling (temporary) case not to. Examples where temporarily using an alternate MASTER_SITES is warranted: Some files are not correctly packaged or included at all in the PyPI sdist, such as licenses, test suite files or data. Submit an upstream issue or PR in these cases. A source distribution (sdist) has not been uploaded yet ``` I'm not experienced enough in pypi packaging to know whether it's standard practice to exclude tests from pypi sdist, but these are the guidelines for FreeBSD. I'll do some research and discuss it with FreeBSD people to get a better understanding of the possible issues and get back to this when I know more
Author
Owner

@jhollowe commented on GitHub (Jan 17, 2023):

@einsibjarni any update from the FreeBSD side of things? Do you have an example of other packages that add in their tests which I can look at?

<!-- gh-comment-id:1386036914 --> @jhollowe commented on GitHub (Jan 17, 2023): @einsibjarni any update from the FreeBSD side of things? Do you have an example of other packages that add in their tests which I can look at?
Author
Owner

@einsibjarni commented on GitHub (Jan 17, 2023):

Hi John,

On 1/17/23 20:53, John Hollowell wrote:

@einsibjarni https://github.com/einsibjarni any update from the
FreeBSD side of things? Do you have an example of other packages that
add in their tests which I can look at?

Sure. I did a quick search in the ports tree and here are a couple of
packages which are fetched from PyPI and run pytest tests.

astroid
bitstring
execnet
fuzzy

While searching I found quite a few python ports that fetch the source
from github instead of pypi, despite FreeBSD ports guidelines saying the
source should be fetched from PyPI "unless there is specific reason not
to, and to work with upstream to fix it".

.einar

<!-- gh-comment-id:1386111674 --> @einsibjarni commented on GitHub (Jan 17, 2023): Hi John, On 1/17/23 20:53, John Hollowell wrote: > @einsibjarni <https://github.com/einsibjarni> any update from the > FreeBSD side of things? Do you have an example of other packages that > add in their tests which I can look at? > Sure. I did a quick search in the ports tree and here are a couple of packages which are fetched from PyPI and run pytest tests. astroid bitstring execnet fuzzy While searching I found quite a few python ports that fetch the source from github instead of pypi, despite FreeBSD ports guidelines saying the source should be fetched from PyPI "unless there is specific reason not to, and to work with upstream to fix it". .einar
Author
Owner

@jhollowe commented on GitHub (Jan 27, 2023):

Since there are other packages which are not including the tests, I'm going to say we do not need to either. The tests are not really a part of the "built" program but pre-build checks. As such, it doesn't make sense to me to ship the tests in the PyPI package when the test are easy enough to pull directly from GitHub in various formats (git clone, download a zip/tar, HTTP, etc).

<!-- gh-comment-id:1407113602 --> @jhollowe commented on GitHub (Jan 27, 2023): Since there are other packages which are not including the tests, I'm going to say we do not need to either. The tests are not really a part of the "built" program but pre-build checks. As such, it doesn't make sense to me to ship the tests in the PyPI package when the test are easy enough to pull directly from GitHub in various formats (git clone, download a zip/tar, HTTP, etc).
Author
Owner

@vishwin commented on GitHub (Jan 28, 2023):

FreeBSD python@ member here. The presence of individual cases of ports fetching from GitHub and not PyPI does not invalidate the strong recommendation overall (not just within Python ports) to use proper release distributions (usually source tarballs) over git tags (which include exact revision references). Chief amongst those reasons is our strict checksum requirement for distribution files, and git tags are not reliable for that. Additionally, the way we fetch tags from GitHub at all is through an undocumented interface that, while satisfying our strict checksum requirement for distribution files, GitHub strongly discourages anyone from using and can remove at any time.

If your development and verification processes include running tests, then the release distribution should also include tests so those who must only use release distributions can still run them. Please reconsider.

<!-- gh-comment-id:1407245837 --> @vishwin commented on GitHub (Jan 28, 2023): FreeBSD python@ member here. The presence of individual cases of ports fetching from GitHub and not PyPI does not invalidate the strong recommendation overall (not just within Python ports) to use proper release distributions (usually source tarballs) over git tags (which include exact revision references). Chief amongst those reasons is our strict checksum requirement for distribution files, and git tags are not reliable for that. Additionally, the way we fetch tags from GitHub at all is through an undocumented interface that, while satisfying our strict checksum requirement for distribution files, GitHub strongly discourages anyone from using and can remove at any time. If your development and verification processes include running tests, then the release distribution should also include tests so those who must only use release distributions can still run them. Please reconsider.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/proxmoxer#67
No description provided.