Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ name: Python package

on:
push:
branches:
branches:
- master
- dev
- dev
- windows
pull_request:
branches:
branches:
- master
- dev
- dev

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
ver=`python setup.py --version`
tag="refs/tags/$ver"
if [[ "$tag" != $GITHUB_REF ]]
if [[ "$tag" != $GITHUB_REF ]]
then echo Tag $GITHUB_REF does not match $ver from setup.py >&2
echo Please update rocrate/_version.py
false
Expand All @@ -41,5 +41,5 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ENV/
.mypy_cache/
.pytest_cache

# vim
# vim
*.swp

# other
Expand Down
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-json
- id: check-yaml
- id: debug-statements
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ author:
- family-names: Thomas
given-names: Laurent
orcid: https://orcid.org/0000-0001-7686-3249

title: "ro-crate-py"
version: 0.14.2
doi: 10.5281/zenodo.3956493
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ pip install flake8
flake8 --exclude venv ./
```

### Pre-commit hooks
ro-crate-py comes with a configuration file for [pre-commit](https://github.com/pre-commit/pre-commit) `.pre-commit-config.yaml`.
This configuration file defines so-called "hooks" which are executed upon each commit, to automatically format the code in the commited files according to the requirements defined for instance in the flake8 configuration file (e.g removing spaces from blank lines...).

To benefit from these automated hooks, you need first to install the pre-commit package.
`pip install pre-commit`

The hooks should then be installed once for your local copy of the repository by running the following command in the root of the repo.
`pre-commit install`

Once installed the hooks will be executed each time a new commit is made, for the files being commited.
If some checks failed or could not be fixed automatically, an error message will be shown and the commit will be aborted.

While not recommended, you can bypass the hooks by passing the additional flag `--no-verify` to the `git commit` command.

Some IDEs have plugins for precommit (e.g [here](https://marketplace.visualstudio.com/items?itemName=elagil.pre-commit-helper) for VSCode), which would for instance run the hooks for the currently opened file each time it is saved. The plugins typically pick up the configuration file automatically.

### Testing

Testing is done with [pytest](https://pytest.org):
Expand Down
1 change: 0 additions & 1 deletion notebooks/ExploreSchemaOrg.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1170,4 +1170,3 @@
"nbformat": 4,
"nbformat_minor": 2
}

1 change: 0 additions & 1 deletion notebooks/ROcrate-linked-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2775,4 +2775,3 @@
"nbformat": 4,
"nbformat_minor": 2
}

1 change: 0 additions & 1 deletion notebooks/ROcrate-validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,3 @@
"nbformat": 4,
"nbformat_minor": 2
}

2 changes: 1 addition & 1 deletion notebooks/sample_data/clinvap/ro-crate-metadata.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion notebooks/sample_data/methylseq/ro-crate-metadata.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion rocrate/data/schema.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -39103,4 +39103,4 @@
}
],
"@id": "http://schema.org/#10.0"
}
}
8 changes: 4 additions & 4 deletions rocrate/templates/preview_template.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
{% else %}
<dt>Creator</dt>
<dd>{{ stringify(crate.creator) }}</dd>
{%endif %}
{%endif %}
{%endif %}
{%endif %}

{% if crate.publisher %}
{% if is_object_list(crate.publisher) %}
Expand All @@ -134,8 +134,8 @@
{% else %}
<dt>Publisher</dt>
<dd>{{ stringify(crate.publisher) }}</dd>
{%endif %}
{%endif %}
{%endif %}
{%endif %}

{% if crate.url %}
<dt>URL</dt>
Expand Down
1 change: 0 additions & 1 deletion test/test-data/read_crate/abstract_wf.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,3 @@ steps:
stats:
doc: input
type: File

2 changes: 1 addition & 1 deletion test/test-data/read_crate/test_galaxy_wf.ga
Original file line number Diff line number Diff line change
Expand Up @@ -898,4 +898,4 @@
"tags": [],
"uuid": "8352059b-e7b8-428b-a4f1-103a6306b2ab",
"version": 15
}
}
2 changes: 1 addition & 1 deletion test/test-data/read_extra/ro-crate-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
"@type": "File"
}
]
}
}
1 change: 0 additions & 1 deletion test/test-data/ro-crate-galaxy-sortchangecase/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,3 @@
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

1 change: 0 additions & 1 deletion test/test-data/sample_cwl_wf.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,3 @@ steps:
stats:
doc: input
type: File

2 changes: 1 addition & 1 deletion test/test-data/test_galaxy_wf.ga
Original file line number Diff line number Diff line change
Expand Up @@ -898,4 +898,4 @@
"tags": [],
"uuid": "8352059b-e7b8-428b-a4f1-103a6306b2ab",
"version": 15
}
}