Nic30 / pyDigitalWaveTools

Python library for operations with VCD and other digital wave files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing unit test when using PyPI : example0.json missing

aktentasche opened this issue · comments

Hi,

when installing release 1.0 of this package via PyPI and instructing it to run the unit tests, the test_example0 test fails.

    ERROR: test_example0 (pyDigitalWaveTools.tests.jsonWriter_test.JsonWriterTC)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/pip-install-r7y8dw2a/pydigitalwavetools_53b789ff10e641ee8f68685039d63da2/pyDigitalWaveTools/tests/jsonWriter_test.py", line 42, in test_example0
        with open(os.path.join(BASE, "example0.json")) as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-r7y8dw2a/pydigitalwavetools_53b789ff10e641ee8f68685039d63da2/pyDigitalWaveTools/tests/example0.json'

I think it is because example0.json is missing in pyDigitalWaveTools.egg-info/SOURCES.txt:

MANIFEST.in
README.md
setup.cfg
setup.py
pyDigitalWaveTools/__init__.py
pyDigitalWaveTools.egg-info/PKG-INFO
pyDigitalWaveTools.egg-info/SOURCES.txt
pyDigitalWaveTools.egg-info/dependency_links.txt
pyDigitalWaveTools.egg-info/not-zip-safe
pyDigitalWaveTools.egg-info/top_level.txt
pyDigitalWaveTools/json/__init__.py
pyDigitalWaveTools/json/value_format.py
pyDigitalWaveTools/json/writer.py
pyDigitalWaveTools/tests/AxiRegTC_test_write.vcd
pyDigitalWaveTools/tests/__init__.py
pyDigitalWaveTools/tests/example0.vcd
pyDigitalWaveTools/tests/jsonWriter_test.py
pyDigitalWaveTools/tests/vcdParser_test.py
pyDigitalWaveTools/tests/vcdWriter_test.py
pyDigitalWaveTools/tests/verilog2005-sample0.vcd
pyDigitalWaveTools/tests/verilog2005-sample1.vcd
pyDigitalWaveTools/vcd/__init__.py
pyDigitalWaveTools/vcd/common.py
pyDigitalWaveTools/vcd/parser.py
pyDigitalWaveTools/vcd/value_format.py
pyDigitalWaveTools/vcd/writer.py

But I am not sure because I am not accustomed with how PyPI packaging actually works. Background is that I would like to use this package in a nix environment and in contrast to pip it runs the unit tests by default.

Steps for reproduction

  1. Uninstall any previous versions of pyDigitalWaveTools: pip uninstall pyDigitalWaveTools
  2. Install and run unit tests: pip install pyDigitalWaveTools --install-option test

Thanks,
aktentasche

commented

Hello @aktentasche,

thank you for reporting, the mentioned json was really missing because it was not added in MANIFEST.in.

But in next version https://github.com/Nic30/pyDigitalWaveTools/releases/tag/v1.1 (uploaded to pip just now)
the tests are removed from the pip package entirely to minimize its size.
That means that the user has to download git and checkout that specific tag in order to run tests.

If you think that this solution is sub-optimal the discussion is opened.

Awesome, thanks! I personally think the PyPI package does not need the tests as someone who develops would not use PyPI but rather work on this repo directly.

I will try with 1.1 and report back if all went fine.

commented

@aktentasche I hope everything went fine. I am closing this issue because it seems to be fixed.

Yes, all ok now. Thanks again.