-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into pr/bjourne/1548
- Loading branch information
Showing
34 changed files
with
903 additions
and
931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"@context": "https://w3id.org/codemeta/3.0", | ||
"@type": "SoftwareSourceCode", | ||
"targetProduct": { | ||
"@type": "SoftwareLibrary", | ||
"name": "brian2", | ||
"runtimePlatform": [ | ||
"Python", | ||
"Python 3" | ||
] | ||
}, | ||
"maintainer": [ | ||
{ | ||
"@id": "https://orcid.org/0000-0002-2648-4790" | ||
} | ||
], | ||
"author": [ | ||
{ | ||
"@id": "https://orcid.org/0000-0002-2648-4790", | ||
"@type": "Person", | ||
"familyName": "Stimberg", | ||
"givenName": "Marcel", | ||
"identifier": "https://github.com/mstimberg" | ||
}, | ||
{ | ||
"@id": "https://orcid.org/0000-0003-1007-6474", | ||
"@type": "Person", | ||
"familyName": "Goodman", | ||
"givenName": "Dan F. M.", | ||
"identifier": "https://github.com/thesamovar" | ||
}, | ||
{ | ||
"@id": "https://orcid.org/0000-0002-1734-6070", | ||
"@type": "Person", | ||
"familyName": "Evans", | ||
"givenName": "Benjamin D.", | ||
"identifier": "https://github.com/bdevans" | ||
}, | ||
{ | ||
"@id": "https://orcid.org/0000-0003-0110-1623", | ||
"@type": "Person", | ||
"familyName": "Brette", | ||
"givenName": "Romain", | ||
"identifier": "https://github.com/romainbrette" | ||
} | ||
], | ||
"codeRepository": "https://github.com/brian-team/brian2", | ||
"continuousIntegration": "https://github.com/brian-team/brian2/actions", | ||
"issueTracker": "https://github.com/brian-team/brian2/issues", | ||
"keywords": [ | ||
"biological neural networks", | ||
"computational neuroscience", | ||
"neural networks", | ||
"research", | ||
"simulation", | ||
"spiking neurons" | ||
], | ||
"operatingSystem": "OS Independent", | ||
"softwareHelp": "https://brian2.readthedocs.io/", | ||
"developmentStatus": "active", | ||
"description": "A clock-driven simulator for spiking neural networks", | ||
"license": "https://spdx.org/licenses/CECILL-2.1", | ||
"name": "Brian simulator", | ||
"url": "https://briansimulator.org", | ||
"programmingLanguage": [ | ||
"Python" | ||
], | ||
"runtimePlatform": [ | ||
"Python", | ||
"Python 3" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import re | ||
import os | ||
import pkg_resources | ||
import tomllib | ||
import json | ||
import sys | ||
|
||
|
||
if __name__ == "__main__": | ||
if not len(sys.argv) == 2: | ||
raise ValueError("Usage: python create_codemeta.py <version>") | ||
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") | ||
|
||
with open(os.path.join(basedir, "pyproject.toml"), "rb") as f: | ||
pyproject = tomllib.load(f) | ||
with open(os.path.join(basedir, ".codemeta", "codemeta_base.json"), "r", encoding="utf-8") as f: | ||
codemeta = json.load(f) | ||
with open(os.path.join(basedir, "AUTHORS"), "r", encoding="utf-8") as f: | ||
authors = f.read().splitlines()[6:] | ||
|
||
# Add software requirements from pyproject.toml | ||
parsed_deps = pkg_resources.parse_requirements(pyproject['project']['dependencies']) | ||
codemeta["softwareRequirements"] = [] | ||
for dep in parsed_deps: | ||
version = ",".join(f"{op}{v}" for op,v in dep.specs) | ||
requirement = {"name": dep.project_name,"@type": "SoftwareApplication", "runtimePlatform": "Python 3"} | ||
if version: | ||
requirement["version"] = version | ||
codemeta["softwareRequirements"].append(requirement) | ||
|
||
# Add contributors from AUTHORS | ||
codemeta["contributor"] = [] | ||
for author in authors: | ||
matches = re.match(r"^(\w[\w-]*?) ([\w]+[.]? )??(\w+) \(@(.*)\)$", author) | ||
if not matches: | ||
raise ValueError("author not matched:", author) | ||
given_name, middle_name, family_name, github = matches.groups() | ||
|
||
contributor = {"@type": "Person", "givenName": given_name, "familyName": family_name, "identifier": f"https://github.com/{github}"} | ||
# FIXME: additionalName does not seem to be recognized by codemeta (validation fails) | ||
if middle_name: | ||
contributor["givenName"] += " " + middle_name.strip() | ||
codemeta["contributor"].append(contributor) | ||
|
||
# Add version from setuptools_scm | ||
version = sys.argv[1] | ||
codemeta["version"] = version | ||
codemeta["softwareVersion"] = version | ||
|
||
# Write codemeta.json | ||
with open(os.path.join(basedir, "codemeta.json"), "w", encoding="utf-8") as f: | ||
json.dump(codemeta, f, indent=2, ensure_ascii=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Update metadata after release | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: true # Needed to push changes back to the repository | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- name: Install dependencies | ||
run: python -m pip install cffconvert pyaml ruamel.yaml requests | ||
- name: Update metadata | ||
run: python dev/continuous-integration/update_zenodo_swh.py | ||
- name: Verify CITATION.cff | ||
run: cffconvert --validate | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
delete-branch: true | ||
branch: update-metadata-post-release | ||
title: Update CITATION.cff and README.md with metadata from Zenodo/SWH | ||
commit-message: | | ||
Update CITATION.cff and README.md with metadata from Zenodo/SWH | ||
[ci skip] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: " GitHub Actions Security Analysis with Zizmor" | ||
|
||
# The scheduled workflow runs every Sunday at 23:45 UTC. | ||
on: | ||
push: | ||
schedule: | ||
- cron: '45 23 * * 0' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Setup Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Get zizmor | ||
run: cargo install zizmor | ||
# https://github.com/woodruffw/zizmor | ||
- name: Run zizmor | ||
run: zizmor --format sarif . > results.sarif | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: results.sarif | ||
category: zizmor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.