Commit 94369431 authored by Vuillaume's avatar Vuillaume
Browse files

Merge branch 'update_codemeta_release' into 'master'

release option to update codemeta

See merge request !210
parents d659d20d fe6d7f78
Pipeline #184654 passed with stages
in 10 minutes and 54 seconds
......@@ -28,7 +28,7 @@ update_codemeta:
# setuptools_scm needs to be installed before or it can't be used to determine eossr version during install
- pip install setuptools_scm
- pip install .
- python eossr/scripts/ -c codemeta.json
- python eossr/scripts/ -c codemeta.json --no-release
- cat codemeta.json
# Add all generated files to Git
- git add codemeta.json
......@@ -4,8 +4,8 @@
"name": "eossr",
"description": "<p align=\"left\"><img src=\"docs/images/eossr_logo.png\" width=\"400px\" ></p><h1>The ESCAPE OSSR library</h1><p>The eOSSR Python library gathers all the developments made for the OSSR. In particular, it includes:- an API to programmatically access the OSSR, retrieve records and publish content- functions to map and crosswalk metadata between the CodeMeta schema adopted for the OSSR and Zenodo internal schema- functions to help developers automatically contribute to the OSSR, in particular using their continuous integration (see also code snippets)</p><p>Code: <a href=\"\"></a>Documentation: <a href=\"\"></a></p><p><a href=\"\"><img alt=\"\" src=\"\" /></a><a href=\"\"><img alt=\"\" src=\"\" /></a><a href=\"\"><img alt=\"CII Best Practices\" src=\"\" /></a><a href=\"\"><img alt=\"\" src=\"\" /></a><a href=\"\"><img alt=\"\" src=\"\" /></a><a href=\"\"><img alt=\"\" src=\"\" /></a></p><h2>Former stable versions</h2><ul><li>v0.6: <a href=\"\"><img alt=\"DOI\" src=\"\" /></a></li><li>v0.5: <a href=\"\"><img alt=\"DOI\" src=\"\" /></a></li><li>v0.4: <a href=\"\"><img alt=\"DOI\" src=\"\" /></a></li><li>v0.3.3: <a href=\"\"><img alt=\"\" src=\"\" /></a></li><li>v0.2 : <a href=\"\"><img alt=\"\" src=\"\" /></a></li></ul><h2>Install</h2><p>Commands to be run in your terminal.</p><h3>For users</h3><pre><code>pip install eossr</code></pre><p>You can also run it with docker:</p><pre><code>docker run -it</code></pre><p><a href=\"\">Visit our registry</a> to see the available docker containers.</p><p>Note that <code>latest</code> tag always point to the latest stable released container.</p><h3>For developers</h3><pre><code>git clone install -e &quot;./eossr&quot;</code></pre><h4>Running tests</h4><p>To run tests locally, run:</p><pre><code>pip install -e &quot;./eossr[tests]&quot;pytest eossr</code></pre><p>Some tests will be skiped if <code>SANDBOX_ZENODO_TOKEN</code> is not defined in your environment variables.If you want to run these tests, you will need to create a <a href=\"\">sandbox zenodo token</a> and add it to your env:</p><pre><code>export SANDBOX_ZENODO_TOKEN=&quot;your_sandbox_token&quot;</code></pre><h2>License</h2><p>See <a href=\"LICENSE\">LICENSE</a></p><h2>Cite</h2><p>To cite this library, use the cite section in <a href=\"\">the Zenodo page</a> (rightcolumn, below the <code>Versions</code> section).</p>",
"license": "",
"version": "v0.7.dev25+ga13e06c",
"softwareVersion": "v0.7.dev25+ga13e06c",
"version": "v0.7.dev28+g761275e",
"softwareVersion": "v0.7.dev28+g761275e",
"codeRepository": "",
"developmentStatus": "active",
"isAccessibleForFree": true,
......@@ -43,11 +43,11 @@
"runtimePlatform": "Python 3",
"downloadUrl": "",
"releaseNotes": "eossr v0.6 Minor bug fixes and documentation improvements. Full changelog:",
"downloadUrl": "",
"releaseNotes": "",
"dateCreated": "2021-08-31",
"datePublished": "2022-06-10",
"dateModified": "2022-06-10",
"datePublished": "2022-06-29",
"dateModified": "2022-06-29",
"operatingSystem": "",
"maintainer": {
"@type": "Person",
......@@ -24,17 +24,35 @@ def build_argparser():
help="Use when making a release. Do not update the publication date, the zip archive URL and remove release notes."
return parser
if __name__ == '__main__':
parser = build_argparser()
args = parser.parse_args()
download_url = f'{eossr_version}/eossr-v{eossr_version}.zip'
if args.no_release:
publication_date = False
release_notes = ""
download_url = ""
publication_date = True
release_notes = None
download_url = f'{eossr_version}/eossr-v{eossr_version}.zip'
html = update_codemeta(
......@@ -127,6 +127,7 @@ def update_codemeta(
......@@ -142,6 +143,8 @@ def update_codemeta(
If True, updates the publication date with today's
:param download_url: str
Download URL for the software
:param release_notes: str
release notes. If None, does not update.
:param overwrite: bool
If True, overwrites the codemeta file
......@@ -163,6 +166,9 @@ def update_codemeta(
metadata['version'] = f"v{version}"
metadata['softwareVersion'] = f"v{version}"
if release_notes is not None:
metadata['releaseNotes'] = release_notes
if overwrite:
with open(codemeta_path, 'w') as file:
json.dump(metadata, file, indent=4)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment