FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

1.12.1 pypi dist file doesn't include gitlab/tests/json.data · Issue #907 · python-gitlab/python-gitlab · GitHub

Repository navigation

1.12.1 pypi dist file doesn't include gitlab/tests/json.data #907

Description

FreeBSD ports system uses the distfile from pypi. When running test on python-gitlab with the dist file from pypi it appears gitlab/tests/json.data isn't included.

...
test_todo (gitlab.tests.test_gitlab.TestGitlab) ... ERROR 
...
======================================================================                                                                                                                                      
ERROR: test_todo (gitlab.tests.test_gitlab.TestGitlab)                                                                                                                                                      
----------------------------------------------------------------------                                                                                                                                      
Traceback (most recent call last):                                                                                                                                                                          
  File "/wrkdirs/usr/ports/devel/py-python-gitlab/work-py36/python-gitlab-1.12.1/gitlab/tests/test_gitlab.py", line 676, in test_todo                                                                       
    todo_content = open(os.path.dirname(__file__) + "/data/todo.json", "r").read()                                                                                                                          
FileNotFoundError: [Errno 2] No such file or directory: '/wrkdirs/usr/ports/devel/py-python-gitlab/work-py36/python-gitlab-1.12.1/gitlab/tests/data/todo.json'
Ran 103 tests in 0.510s                                                                                                                                                                                     
                                                                                                                                                                                                            
FAILED (errors=1)                                                                                                                                                                                           
Test failed: <unittest.runner.TextTestResult run=103 errors=1 failures=0>                                                                                                                                   
error: Test failed: <unittest.runner.TextTestResult run=103 errors=1 failures=0>                                                                                                                            
*** Error code 1                                                                                                                                                                                           

Manually placing the file allows all tests to pass.

Activity

  1. max-wittig commented on Oct 21, 2019

    Member

    @derekschrock Hi. Could you elaborate why you need the testdata files in the distribution?

  2. derekschrock commented on Oct 21, 2019

    ContributorAuthor
  3. koobs commented on Oct 22, 2019

    PyPI sdists are designed to be canonical and complete "source distributions" available to consumers, which may be processed or otherwise different from the underlying repository files.

    Consumers of source distributions (PyPI sdists in this case, but not only pypi source distributions) ought to be able to test/verify the software locally. This test/verification use-case is separate from and independent to the "running tests for development purposes" use-case.

    While it just happens to be the case that downstream OS packagers are a subset/subclass of "consumers" like regular users, it is by no means the case that the ability to test/verify source distributions is only required for OS packagers.

    The additional benefit to ensuring that the source distribution is canonical and complete is that the entire Python packaging pipeline is correctly used and tested

  4. koobs commented on Oct 22, 2019

    If there is a concern that test data files constitute an "undue size burden" (ie: "we want our sdist to be small"), there is an option available to package the test data files separately, so that this package may:

    setup.py: tests_require: gitlab-testdata
    

    We did this for the cryptography package which had its test vectors packaged separately [1][2]

    In this particular case though, the test vectors were huge and represented a very compelling case to package separately. For the vast majority of Python packages, this is not necessary, and should be the exception rather than the rule.

    [1] https://pypi.org/project/cryptography-vectors/
    [2] https://cryptography.io/en/latest/development/test-vectors/

  5. max-wittig commented on Oct 22, 2019

    Member

    That makes sense. I guess we should bundle these then.

  6. added a commit that references this issue on Oct 22, 2019
    3133ed7
  7. koobs commented on Oct 22, 2019

    @max-wittig Much appreciated Max, thank you! This helps us all ensure a quality experience for users of your software on our OS's

  8. max-wittig commented on Oct 22, 2019

    Member

    @koobs @derekschrock Thanks for the heads up!

  9. locked as resolved and limited conversation to collaborators on Nov 8, 2021
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL