-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: restructure project with escience center python template
eScience Center python template is used to restructure the project.
- Loading branch information
1 parent
1e5bc0a
commit 8d97b99
Showing
45 changed files
with
5,499 additions
and
3 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,10 @@ | ||
[bumpversion] | ||
current_version = 0.1.0 | ||
|
||
[bumpversion:file:nplinker/main.py] | ||
search = __version__ = "{current_version}" | ||
replace = __version__ = "{new_version}" | ||
|
||
[bumpversion:file:CITATION.cff] | ||
search = version: "{current_version}" | ||
replace = version: "{new_version}" |
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,9 @@ | ||
.bumpversion.cfg | ||
.editorconfig | ||
.git | ||
.github | ||
.gitignore | ||
.mlc-config.json | ||
.prospector.yml | ||
.vscode | ||
run_nplinker_docker.sh |
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,26 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
# 4 space indentation | ||
[*.{py,java,r,R,sh}] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# 2 space indentation | ||
[*.{js,json,y{a,}ml,html,cwl}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{md,Rmd,rst}] | ||
trim_trailing_whitespace = false | ||
indent_style = space | ||
indent_size = 2 |
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,25 @@ | ||
name: cffconvert | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- CITATION.cff | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- CITATION.cff | ||
|
||
jobs: | ||
|
||
verify: | ||
name: "cffconvert" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Check out a copy of the repository | ||
|
||
- uses: citation-file-format/cffconvert-github-action@main | ||
name: Check whether the citation metadata from CITATION.cff is equivalent to that in .zenodo.json |
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,37 @@ | ||
name: Check code style | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.py' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '**.py' | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Python info | ||
shell: bash -l {0} | ||
run: | | ||
which python3 | ||
python3 --version | ||
- name: Upgrade pip and install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip setuptools | ||
pip install "prospector[with_pyroma]" isort | ||
- name: Check style against standards using prospector | ||
run: prospector | ||
- name: Check import order | ||
run: isort --check-only . --diff |
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,24 @@ | ||
name: markdown-link-check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '**.md' | ||
|
||
jobs: | ||
|
||
markdown-link-check: | ||
name: Check markdown links | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: gaurav-nelson/github-action-markdown-link-check@v1 | ||
with: | ||
config-file: '.mlc-config.json' |
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,73 @@ | ||
name: Draft or publish Github release | ||
# this action will automatically create a tag for the latest commit | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
current_version: | ||
description: 'Current version' | ||
default: '0.0.1' | ||
type: string | ||
required: true | ||
new_version: | ||
description: 'New version to release, used for tag name and release title' | ||
default: '0.0.1' | ||
type: string | ||
required: true | ||
mode: | ||
description: 'Draft or publish Github release' | ||
default: "Draft" | ||
required: true | ||
type: choice | ||
options: | ||
- draft | ||
- publish | ||
|
||
env: | ||
REPO_NAME: nplinker-webapp | ||
CHANGELOG_FILE: CHANGELOG.md | ||
RELEASE_NOTES_FILE: release_notes.md | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: ${{ inputs.current_version != inputs.new_version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Upgrade pip and install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install bump2version | ||
- name: Update package version and change log | ||
run: | | ||
bumpversion --current-version ${{ inputs.current_version }} --new-version ${{ inputs.new_version }} part | ||
docker run --rm -v "$(pwd)":/usr/local/src/your-app \ | ||
githubchangeloggenerator/github-changelog-generator \ | ||
-u ${{ github.repository_owner }} \ | ||
-p $REPO_NAME \ | ||
--future-release=v${{ inputs.new_version }} \ | ||
-o $CHANGELOG_FILE \ | ||
-t ${{ secrets.GITHUB_TOKEN }} | ||
- name: Commit and push the changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Update version to ${{ inputs.new_version }} | ||
- name: Generate release notes | ||
run: | | ||
awk '/^## \[v${{ inputs.new_version }}/{flag=1; next}/^##/{flag=0}flag' $CHANGELOG_FILE > $RELEASE_NOTES_FILE | ||
- name: Draft a Github release | ||
if: ${{ inputs.mode == 'draft' }} | ||
run: | | ||
gh release create v${{ inputs.new_version }} --draft --title v${{ inputs.new_version }} -F $RELEASE_NOTES_FILE | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }} | ||
- name: Publish a Github release | ||
if: ${{ inputs.mode == 'publish' }} | ||
run: | | ||
gh release create v${{ inputs.new_version }} --title v${{ inputs.new_version }} -F $RELEASE_NOTES_FILE | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }} |
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,2 @@ | ||
|
||
*.pyc |
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,36 @@ | ||
{ | ||
"_comment": "Markdown Link Checker configuration, see https://github.com/gaurav-nelson/github-action-markdown-link-check and https://github.com/tcort/markdown-link-check", | ||
"ignorePatterns": [ | ||
{ | ||
"pattern": "^http://localhost" | ||
}, | ||
{ | ||
"pattern": "^https://doi.org/<replace-with-created-DOI>" | ||
}, | ||
{ | ||
"pattern": "^https://github.com/.*/settings/secrets/actions$" | ||
}, | ||
{ | ||
"pattern": "^https://github.com/organizations/.*/repositories/new" | ||
}, | ||
{ | ||
"pattern": "^https://help.github.com/.*" | ||
}, | ||
{ | ||
"pattern": "^https://docs.github.com/.*" | ||
}, | ||
{ | ||
"pattern": "^https://test.pypi.org" | ||
}, | ||
{ | ||
"pattern": "^https://bestpractices.coreinfrastructure.org/projects/<replace-with-created-project-identifier>" | ||
}, | ||
{ | ||
"pattern": "^https://readthedocs.org/dashboard/import.*" | ||
} | ||
], | ||
"replacementPatterns": [ | ||
], | ||
"retryOn429": true, | ||
"timeout": "20s" | ||
} |
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,30 @@ | ||
# prospector configuration file | ||
|
||
--- | ||
|
||
output-format: grouped | ||
|
||
strictness: medium | ||
doc-warnings: false | ||
test-warnings: true | ||
member-warnings: false | ||
|
||
ignore-paths: | ||
- docs | ||
- notebooks | ||
|
||
pyroma: | ||
run: true | ||
|
||
pycodestyle: | ||
full: true | ||
|
||
pydocstyle: | ||
disable: [ | ||
# Disable because not part of PEP257 official convention: | ||
# see http://pep257.readthedocs.io/en/latest/error_codes.html | ||
D203, # 1 blank line required before class docstring | ||
D212, # Multi-line docstring summary should start at the first line | ||
D213, # Multi-line docstring summary should start at the second line | ||
D404, # First word of the docstring should not be This | ||
] |
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 @@ | ||
{ | ||
"editor.rulers": [ | ||
72, | ||
79 | ||
], | ||
|
||
// python | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.python" | ||
}, | ||
"python.analysis.completeFunctionParens": true, | ||
"python.autoComplete.addBrackets": true, | ||
"python.defaultInterpreterPath": "", | ||
"python.languageServer": "Pylance", | ||
// formatting and linting | ||
"python.formatting.provider": "yapf", | ||
"python.linting.enabled": true, | ||
"python.linting.prospectorEnabled": true, | ||
"python.linting.pylintEnabled": false, | ||
// python docstring | ||
"autoDocstring.docstringFormat": "google", | ||
"autoDocstring.customTemplatePath": ".vscode/vscode_docstring_google_adapted.mustache", | ||
|
||
// Jupyter | ||
"jupyter.sendSelectionToInteractiveWindow": true, | ||
"jupyter.askForKernelRestart": false, | ||
"notebook.lineNumbers": "on", | ||
"notebook.diff.ignoreMetadata": true | ||
} |
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,32 @@ | ||
{{! Google Docstring Template}} | ||
{{summaryPlaceholder}} | ||
|
||
{{extendedSummaryPlaceholder}} | ||
|
||
{{ # parametersExist}} | ||
Args: | ||
{{ # args}} | ||
{{var}}({{typePlaceholder}}): {{descriptionPlaceholder}} | ||
{{/args}} | ||
{{ # kwargs}} | ||
{{var}} ({{typePlaceholder}}, optional): {{descriptionPlaceholder}}. Defaults to {{& default}}. | ||
{{/kwargs}} | ||
{{/parametersExist}} | ||
|
||
{{ # exceptionsExist}} | ||
Raises: | ||
{{ # exceptions}} | ||
{{type}}: {{descriptionPlaceholder}} | ||
{{/exceptions}} | ||
{{/exceptionsExist}} | ||
|
||
{{ # returnsExist}} | ||
Returns: | ||
{{ # returns}} | ||
{{typePlaceholder}}: {{descriptionPlaceholder}} | ||
{{/returns}} | ||
{{/returnsExist}} | ||
|
||
Examples: | ||
>>> {{#placeholder}} | ||
{{/placeholder}} |
Oops, something went wrong.