Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Need help packaging python-thewalrus

  1. #1
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    189

    Default Need help packaging python-thewalrus

    Hello,

    I have been trying to package python-thewalrus.
    https://build.opensuse.org/package/s...thon-thewalrus
    https://github.com/XanaduAI/thewalrus/issues/184

    But the error is always this.
    Code:
    [   58s] ==================================== ERRORS ====================================
    [   58s] ___________ ERROR collecting thewalrus/tests/test_fock_gradients.py ____________
    [   58s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/thewalrus-0.12.0/thewalrus/tests/test_fock_gradients.py'.
    [   58s] Hint: make sure your test modules/packages have valid Python names.
    [   58s] Traceback:
    [   58s] thewalrus/tests/test_fock_gradients.py:16: in <module>
    [   58s]     from thewalrus.fock_gradients import (
    [   58s] E   ModuleNotFoundError: No module named 'thewalrus'
    So I tired building it locally with pip and test with pytest.
    I download the thewalrus-0.12.0.tar.gz from github and install with

    Code:
    pip install thewalrus-0.12.0.tar.gz
    cd /home/andy/.local/lib/python3.8/site-packages/thewalrus
    pytest
    =========================================================================================================== test session starts ============================================================================================================
    platform linux -- Python 3.8.4, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
    benchmark: 3.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
    rootdir: /home/andy/.local/lib/python3.8/site-packages/thewalrus/tests
    plugins: asdf-2.6.0, asyncio-0.14.0, aspectlib-1.5.0, benchmark-3.2.3
    collected 951 items                                                                                                                                                                                                                        
    
    test_fock_gradients.py ...............                                                                                                                                                                                               [  1%]
    test_hafnian.py ...........................................................................................                                                                                                                          [ 11%]
    test_hafnian_approx.py .......                                                                                                                                                                                                       [ 11%]
    test_hafnian_repeated.py ........................................                                                                                                                                                                    [ 16%]
    test_hermite_multidimensional.py ........                                                                                                                                                                                            [ 16%]
    test_integration.py .......                                                                                                                                                                                                          [ 17%]
    test_permanent.py ........................                                                                                                                                                                                           [ 20%]
    test_quantum.py .................................................................................................................................................................................................................... [ 42%]
    .................................................................................................................................................................................................................................... [ 66%]
    .....................................................................................................                                                                                                                                [ 77%]
    test_reference.py ...........................                                                                                                                                                                                        [ 79%]
    test_samples.py ........................................                                                                                                                                                                             [ 84%]
    test_samples_classical.py .......                                                                                                                                                                                                    [ 84%]
    test_symplectic.py .....................................................................................                                                                                                                             [ 93%]
    test_torontonian.py ...........................................................                                                                                                                                                      [100%]
    
    ===================================================================================================== 951 passed in 436.84s (0:07:16) ======================================================================================================
    Which passed flawlessly.

    I'm not sure what the error implies.
    This also happen to pythno-sat-stac
    https://build.opensuse.org/package/s...ython-sat-stac


    Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,704
    Blog Entries
    15

    Default Re: Need help packaging python-thewalrus

    Hi
    Not sure it's really a python- package since it's a python library, not a module, your probably better off to just package as thewalrus.

    AFAIKT, you need to cd into the test directory, then call your macro.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    189

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Not sure it's really a python- package since it's a python library, not a module, your probably better off to just package as thewalrus.

    AFAIKT, you need to cd into the test directory, then call your macro.
    I have tried,

    Code:
    cd thewalrus/tests
    %pytest
    cd ../../
    Code:
    cd thewalrus
    %pytest
    cd ..
    but still same error. It seems that pytest could not find the test for some reason, or I might understand it wrong.

    Code:
    [  296s] ============================= test session starts ==============================
    [  296s] platform linux -- Python 3.8.4, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3
    [  296s] cachedir: .pytest_cache
    [  296s] benchmark: 3.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
    [  296s] rootdir: /home/abuild/rpmbuild/BUILD/thewalrus-0.12.0
    [  296s] plugins: benchmark-3.2.3
    [  298s] collecting ... collected 0 items / 13 errors
    [  298s] 
    [  298s] ==================================== ERRORS ====================================
    [  298s] ___________ ERROR collecting thewalrus/tests/test_fock_gradients.py ____________
    [  298s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/thewalrus-0.12.0/thewalrus/tests/test_fock_gradients.py'.
    [  298s] Hint: make sure your test modules/packages have valid Python names.
    [  298s] Traceback:
    [  298s] test_fock_gradients.py:16: in <module>
    [  298s]     from thewalrus.fock_gradients import (
    [  298s] E   ModuleNotFoundError: No module named 'thewalrus'
    I will change the package name, thanks.

    In the case of sat-stac, it solve the issue for me by cd into the test, but it does not work for thewalrus.

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,704
    Blog Entries
    15

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by andythe_great View Post
    I have tried,

    Code:
    cd thewalrus/tests
    %pytest
    cd ../../
    Code:
    cd thewalrus
    %pytest
    cd ..
    but still same error. It seems that pytest could not find the test for some reason, or I might understand it wrong.

    Code:
    [  296s] ============================= test session starts ==============================
    [  296s] platform linux -- Python 3.8.4, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3
    [  296s] cachedir: .pytest_cache
    [  296s] benchmark: 3.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
    [  296s] rootdir: /home/abuild/rpmbuild/BUILD/thewalrus-0.12.0
    [  296s] plugins: benchmark-3.2.3
    [  298s] collecting ... collected 0 items / 13 errors
    [  298s] 
    [  298s] ==================================== ERRORS ====================================
    [  298s] ___________ ERROR collecting thewalrus/tests/test_fock_gradients.py ____________
    [  298s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/thewalrus-0.12.0/thewalrus/tests/test_fock_gradients.py'.
    [  298s] Hint: make sure your test modules/packages have valid Python names.
    [  298s] Traceback:
    [  298s] test_fock_gradients.py:16: in <module>
    [  298s]     from thewalrus.fock_gradients import (
    [  298s] E   ModuleNotFoundError: No module named 'thewalrus'
    I will change the package name, thanks.

    In the case of sat-stac, it solve the issue for me by cd into the test, but it does not work for thewalrus.
    Hi
    If you rename and give me a link, will branch and have a play
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    189

    Default Re: Need help packaging python-thewalrus


  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,704
    Blog Entries
    15

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by andythe_great View Post
    Hi
    The tests are to be run after install as per the source instructions, nothing to do at build time
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    189

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by malcolmlewis View Post
    Hi
    The tests are to be run after install as per the source instructions, nothing to do at build time
    Is it normal to do it like this? Isn't the package suppose to test as it is installed?

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,704
    Blog Entries
    15

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by andythe_great View Post
    Is it normal to do it like this? Isn't the package suppose to test as it is installed?
    Hi
    You could add as post install option, in this case as the packager/tester I would suggest you run locally after install...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    189

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by malcolmlewis View Post
    Hi
    You could add as post install option, in this case as the packager/tester I would suggest you run locally after install...
    I tried using gtest instead of pytest as the doc suggest. The check is now passing.
    But is it ok to do it this way?

    Code:
    %check
    cd tests
    %make_build test
    cd ..

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,704
    Blog Entries
    15

    Default Re: Need help packaging python-thewalrus

    Quote Originally Posted by andythe_great View Post
    I tried using gtest instead of pytest as the doc suggest. The check is now passing.
    But is it ok to do it this way?

    Code:
    %check
    cd tests
    %make_build test
    cd ..
    Hi
    If it works, don't see why not
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •