Skip to content

Commit

Permalink
Merge pull request #84 from csdms/mcflugen/update-templates
Browse files Browse the repository at this point in the history
Update templates
  • Loading branch information
mcflugen authored Mar 5, 2024
2 parents 34af626 + c3c5674 commit 20fff37
Show file tree
Hide file tree
Showing 37 changed files with 865 additions and 485 deletions.
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)
=====================

Copyright © `2020` `Community Surface Dynamics Modeling System`
Copyright (c) `2020` `Community Surface Dynamics Modeling System`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
26 changes: 0 additions & 26 deletions babelizer/data/.travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion babelizer/data/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"ci": {
"os": ["ubuntu", "macos", "windows"],
"python_version": ["3.7", "3.8", "3.9"]
"python_version": ["3.10", "3.11", "3.12"]
},
"package_name": "package",
"package_requirements": "",
Expand Down
7 changes: 7 additions & 0 deletions babelizer/data/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from collections import defaultdict
from pathlib import Path

from logoizer import logoize


PROJECT_DIRECTORY = Path.cwd().resolve()
LIB_DIRECTORY = Path("{{ cookiecutter.package_name }}", "lib")

Expand Down Expand Up @@ -84,6 +87,10 @@ def write_api_yaml(folderpath, **kwds):
if __name__ == "__main__":
keep = set()

make_folder(PROJECT_DIRECTORY / "docs" / "_static")
logoize("{{ cookiecutter.package_name }}", PROJECT_DIRECTORY / "docs" / "_static" / "logo-light.svg", light=True)
logoize("{{ cookiecutter.package_name }}", PROJECT_DIRECTORY / "docs" / "_static" / "logo-dark.svg", light=False)

{%- if cookiecutter.language == 'c' %}

keep |= set(["__init__.py", "bmi.c", "bmi.h"])
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12

- name: Lint
run: |
pip install flake8
flake8 {{ cookiecutter.package_name }}
pip install nox
nox -s lint
3 changes: 3 additions & 0 deletions babelizer/data/{{cookiecutter.package_name}}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ ENV/
# mypy
.mypy_cache/

# nox virtual envs
.nox/

{% if cookiecutter.language == 'fortran' -%}
{%- for babelized_class in cookiecutter.components %}
# Fortran files generated by the babelizer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
language_version: python3
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi]
- id: black-jupyter
name: black-jupyter
description:
"Black: The uncompromising Python code formatter (with Jupyter Notebook support)"
entry: black
language: python
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi, jupyter]
additional_dependencies: [".[jupyter]"]

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify

- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
args: [--py39-plus]

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
files: \.py$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: trailing-whitespace

- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
files: babelizer/.*\.py$
args:
- --convention=numpy
- --add-select=D417
additional_dependencies: [".[toml]"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
hooks:
- id: mypy
additional_dependencies: [types-all]
9 changes: 5 additions & 4 deletions babelizer/data/{{cookiecutter.package_name}}/CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Changelog for {{cookiecutter.package_name}}
=============={{ '=' * cookiecutter.package_name | length }}
Release Notes
=============

0.2.0 (unreleased)
-------------------
.. towncrier-draft-entries:: Not yet released

.. towncrier release notes start
0.1.0 ({% now 'local', '%Y-%m-%d' %})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% if cookiecutter.open_source_license == 'MIT License' -%}
MIT License
===========

Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.info.full_name }}
Copyright (c) *{% now 'local', '%Y' %}*, *{{ cookiecutter.info.full_name }}*

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,10 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{% elif cookiecutter.open_source_license == 'BSD License' %}

BSD License
===========

Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.info.full_name }}
Copyright (c) *{% now 'local', '%Y' %}*, *{{ cookiecutter.info.full_name }}*
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -53,16 +54,18 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISE
OF THE POSSIBILITY OF SUCH DAMAGE.
{% elif cookiecutter.open_source_license == 'ISC License' -%}
ISC License
===========

Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.info.full_name }}
Copyright (c) *{% now 'local', '%Y' %}*, *{{ cookiecutter.info.full_name }}*

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
{% elif cookiecutter.open_source_license == 'Apache Software License 2.0' -%}
Apache Software License 2.0
===========================

Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.info.full_name }}
Copyright (c) *{% now 'local', '%Y' %}*, *{{ cookiecutter.info.full_name }}*

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -77,10 +80,12 @@ See the License for the specific language governing permissions and
limitations under the License.
{% elif cookiecutter.open_source_license == 'GNU General Public License v3' -%}
GNU GENERAL PUBLIC LICENSE
==========================

Version 3, 29 June 2007

{{ cookiecutter.info.project_short_description }}
Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.info.full_name }}
Copyright (c) *{% now 'local', '%Y' %}*, *{{ cookiecutter.info.full_name }}*

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 20fff37

Please sign in to comment.