metaparticle-io / package

Metaparticle/Package: Language Fluent Containerization and Deployment in Java, .NET and Javascript (and more coming soon)
https://metaparticle.io
MIT License
493 stars 55 forks source link

[bug] Python setup.py not loading version.json, tox broken #100

Closed cgmcintyr closed 6 years ago

cgmcintyr commented 6 years ago

Bug:

When checked out on public_python (https://github.com/metaparticle-io/package/commit/f550ca1c4b75f34915a394b8976562625c94baa6 at time of writing) or master (https://github.com/metaparticle-io/package/commit/0bf29e17b9ce6d472f1fb06ffb8271b557569258 at time of writing) both tox and setup.py are broken.

Output:

tox

``` GLOB sdist-make: /home/cgmcintyre/devel/metaparticle/package/python/setup.py ERROR: invocation failed (exit code 1), logfile: /home/cgmcintyre/devel/metaparticle/package/python/.tox/log/tox-0.log ERROR: actionid: tox msg: packaging cmdargs: ['/home/cgmcintyre/.virtualenvs/METAPARTICLE/bin/python3', local('/home/cgmcintyre/devel/metaparticle/package/python/setup.py'), 'sdist', '--formats=zip', '--dist-dir', local('/home/cgmcintyre/devel/metaparticle/package/python/.tox/dist')] Traceback (most recent call last): File "setup.py", line 4, in config = json.loads('./metaparticle_pkg/version.json') File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ERROR: FAIL could not package project - v = InvocationError('/home/cgmcintyre/.virtualenvs/METAPARTICLE/bin/python3 /home/cgmcintyre/devel/metaparticle/package/python/setup.py sdist --formats=zip --dist-dir /home/cgmcintyre/devel/metaparticle/package/python/.tox/dist (see /home/cgmcintyre/devel/metaparticle/package/python/.tox/log/tox-0.log)', 1) ``` Collapsible until here.

setup.py test

``` Traceback (most recent call last): File "setup.py", line 4, in config = json.loads('./metaparticle_pkg/version.json') File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ```


Causes:

setup.py is not loading python/metaparticle_pkg/version.json. python/metaparticle_pkg/version.json has a trailing comma. python/metaparticle_pkg/version.json is not included in the setup.py's files to distribute.

Related testing issue: tox.ini's second coverage command is not pointing at source metaparicle_pkg but is trying to report on coverage of non-existent metaparticle python package.


I've implemented a fix in https://github.com/cgmcintyr/package/commit/6c5bae4183df2bfa3175722f2030569871be4b7d

I'm happy to submit a pull request if this looks okay :)