Skip to content

Commit

Permalink
Set up template
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaelman committed Nov 19, 2024
1 parent 8eed4f1 commit 19958a6
Show file tree
Hide file tree
Showing 39 changed files with 1,061 additions and 64 deletions.
27 changes: 27 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"template": "https://github.com/FAIRmat-NFDI/cookiecutter-nomad-plugin",
"commit": "e759475d3f8905df4354ca83d8ce6cd632ffce99",
"checkout": null,
"context": {
"cookiecutter": {
"full_name": "Nathan Daelman",
"email": "[email protected]",
"github_username": "FAIRmat-NFDI",
"plugin_name": "nomad-parser-plugin-boss",
"module_name": "nomad_parser_plugin_boss",
"short_description": "Plugin for parsing and displaying BOSS PES arftifacts",
"version": "0.1.0",
"license": "Apache Software License 2.0",
"include_schema_package": true,
"include_normalizer": false,
"include_parser": true,
"include_app": false,
"include_example_uploads": true,
"_copy_without_render": [
"*.html"
],
"_template": "https://github.com/FAIRmat-NFDI/cookiecutter-nomad-plugin"
}
},
"directory": null
}
56 changes: 56 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: install-and-test-workflow
on: [push]
jobs:
install-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip
pip install '.[dev]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
pip install coverage coveralls
- name: Test with pytest
run: |
python -m coverage run -m pytest -sv
- name: Submit to coveralls
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
build-and-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build the package
run: |
pip install --upgrade pip
pip install build
python -m build --sdist
- name: Install the package
run: |
pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
ruff-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "check ."
# to enable auto-formatting check, uncomment the following lines below
# ruff-formatting:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: chartboost/ruff-action@v1
# with:
# args: "format . --check"
75 changes: 75 additions & 0 deletions .github/workflows/cruft-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# /.github/workflows/cruft-update.yml
name: Update repository with Cruft
permissions:
contents: write
pull-requests: write
on:
schedule:
- cron: "0 14 * * 1" # Every Monday at 2pm (UTC time)
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- add-paths: .
body: Use this to merge the changes to this repository.
branch: cruft/update
commit-message: "chore: accept new Cruft update"
title: New updates detected with Cruft
- add-paths: .cruft.json
body: Use this to reject the changes in this repository.
branch: cruft/reject
commit-message: "chore: reject new Cruft update"
title: Reject new updates detected with Cruft
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Cruft
run: pip3 install cruft

- name: Check if update is available
continue-on-error: false
id: check
run: |
CHANGES=0
if [ -f .cruft.json ]; then
if ! cruft check; then
CHANGES=1
fi
else
echo "No .cruft.json file"
fi
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT"
- name: Run update if available
if: steps.check.outputs.has_changes == '1'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub"
cruft update --skip-apply-ask --refresh-private-variables
git restore --staged .
- name: Create pull request
if: steps.check.outputs.has_changes == '1'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: ${{ matrix.add-paths }}
commit-message: ${{ matrix.commit-message }}
branch: ${{ matrix.branch }}
delete-branch: true
branch-suffix: timestamp
title: ${{ matrix.title }}
body: |
This is an autogenerated PR. ${{ matrix.body }}
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Cookiecutter repository.
24 changes: 24 additions & 0 deletions .github/workflows/mkdocs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy MkDocs Site

on:
push:
branches:
- main # Triggers deployment on push to the main branch

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
REQUIREMENTS: requirements_docs.txt
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.pyenv

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"editor.rulers": [
90
],
"editor.renderWhitespace": "all",
"editor.tabSize": 4,
"files.trimTrailingWhitespace": true,
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -178,15 +179,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include * nomad_plugin.yaml
graft src/nomad_parser_plugin_boss/example_uploads
Loading

0 comments on commit 19958a6

Please sign in to comment.