ReproNim / reproschema

A standardized form generation and data collection schema to harmonize results by design across projects.
https://www.repronim.org/reproschema/
Other
14 stars 20 forks source link

failed to generate release using python script #499

Closed yibeichan closed 3 months ago

yibeichan commented 3 months ago

@satra on README, it says running the following command to generate a release

python scripts/makeRelease.py <version>
python scripts/editProperties.py <version>

but I got errors using makeRelease.py,

python scripts/makeRelease.py 1.0.0                                                                                 main
Generating release for version: 1.0.0
Traceback (most recent call last):
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/documentloader/requests.py", line 72, in loader
    'document': response.json()
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/context_resolver.py", line 143, in _fetch_context
    remote_doc = jsonld.load_document(url,
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/jsonld.py", line 6583, in load_document
    remote_doc = options['documentLoader'](url, options)
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/documentloader/requests.py", line 100, in loader
    raise JsonLdError(
pyld.jsonld.JsonLdError: ('Could not retrieve a JSON-LD document from the URL.',)
Type: jsonld.LoadDocumentError
Code: loading document failed
Cause: Expecting value: line 1 column 1 (char 0)  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/documentloader/requests.py", line 72, in loader
    'document': response.json()
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/yibeichen/Downloads/reproschema/reproschema/scripts/makeRelease.py", line 55, in <module>
    create_release(version)
  File "/Users/yibeichen/Downloads/reproschema/reproschema/scripts/makeRelease.py", line 15, in create_release
    terms.extend(json.loads(to_newformat(os.path.join(root, name), "jsonld")))
  File "/Users/yibeichen/Downloads/reproschema/reproschema-py/reproschema/jsonldutils.py", line 174, in to_newformat
    data = load_file(path)
  File "/Users/yibeichen/Downloads/reproschema/reproschema-py/reproschema/jsonldutils.py", line 77, in load_file
    data = jsonld.expand(data, options={"base": base_url})
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/jsonld.py", line 163, in expand
    return JsonLdProcessor().expand(input_, options)
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/jsonld.py", line 870, in expand
    expanded = self._expand(active_ctx, None, document, options,
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/jsonld.py", line 2302, in _expand
    active_ctx = self._process_context(
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/jsonld.py", line 3049, in _process_context
    resolved = options['contextResolver'].resolve(active_ctx, local_ctx, options.get('base', ''))
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/context_resolver.py", line 58, in resolve
    resolved = self._resolve_remote_context(
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/context_resolver.py", line 108, in _resolve_remote_context
    context, remote_doc = self._fetch_context(active_ctx, url, cycles)
  File "/Users/yibeichen/miniconda3/envs/tes-reproschema/lib/python3.10/site-packages/pyld/context_resolver.py", line 148, in _fetch_context
    raise jsonld.JsonLdError(
pyld.jsonld.JsonLdError: ('Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.',)
Type: jsonld.InvalidUrl
Code: loading remote context failed
Details: {'url': 'http://localhost:8000/contexts/base', 'cause': JsonLdError('Could not retrieve a JSON-LD document from the URL.')}

something related here? https://github.com/ReproNim/reproschema-py/blob/e70e58c6b4f46e3c1727ecb4444bfbe08ed3dc87/reproschema/jsonldutils.py#L66

did I miss something here? how you generated previous releases? I'll probably generate it manually thru github

satra commented 3 months ago

the whole process has changed with the introduction of linkml. so that part of the readme needs to be adjusted based on that. at the end of the day a release is what is contained in the release folder. the intent is in the code and yes, it was generated manually not through actions.

satra commented 3 months ago

if you take a look at makerelease there are various assumptions in there.

djarecka commented 3 months ago

we have new GA, closing