Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update templates #84

Merged
merged 36 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
84649ff
clean up the conf.py for building the docs
mcflugen Nov 28, 2022
c0fbea8
move static metadata into pyproject.toml
mcflugen Nov 28, 2022
ebe3a22
Merge branch 'develop' into mcflugen/update-templates
mcflugen Nov 28, 2022
75fe27d
set docs language to "en"
mcflugen Nov 28, 2022
9f5361c
add .nox folder to gitignore
mcflugen Nov 28, 2022
d8d522f
remove the recipe folder
mcflugen Nov 28, 2022
e439d49
make the bmi module private
mcflugen Nov 28, 2022
6b63054
add a pre-commit config file
mcflugen Nov 28, 2022
0a2edc7
add _version module to hold the current version
mcflugen Nov 28, 2022
64ffdcd
add a nox config file
mcflugen Nov 28, 2022
afd7d62
add an api folder to the docs
mcflugen Nov 28, 2022
3adeeed
move setup utilities into a separate file
mcflugen Nov 29, 2022
0483b0e
remove old travis config file
mcflugen Nov 29, 2022
9e0704d
create a csdms-styled logo for the babelized component
mcflugen Nov 29, 2022
16cbcad
switch to furo theme for docs
mcflugen Nov 29, 2022
98945c1
remove unicode from license
mcflugen Nov 29, 2022
47b3ccf
add towncrier section to pyproject.toml
mcflugen Nov 29, 2022
0c64060
remove minor lint
mcflugen Nov 29, 2022
6c28bfb
add an update session to the template nox file
mcflugen Dec 2, 2022
f06e9a2
format license as rst, add .rst extension
mcflugen Dec 2, 2022
6675189
fix adding extra lines when rendering babel.toml
mcflugen Dec 2, 2022
89d0be1
fix setup_utils.py after rendering project
mcflugen Dec 2, 2022
2ddef07
add stub files for package metadata
mcflugen Dec 2, 2022
8d6b6d3
add install instructions and quick intro environments
mcflugen Dec 2, 2022
ef3c4a4
add quickstart, usage, and updating sections to readme
mcflugen Dec 2, 2022
e53eaf8
add new sections to the table of contents
mcflugen Dec 2, 2022
515824a
remove unused doc files
mcflugen Dec 2, 2022
b1215ed
remove lint
mcflugen Dec 2, 2022
de7aab5
remove unused api/index
mcflugen Dec 2, 2022
a0559eb
add missing type hint
mcflugen Dec 2, 2022
bfed30c
fix stub files to point to correct files
mcflugen Dec 2, 2022
ca56148
clean up text on main docs page
mcflugen Dec 2, 2022
154923a
remove setuptools version requirement
mcflugen Dec 2, 2022
afad29e
add news fragment
mcflugen Dec 2, 2022
9f9e134
Merge branch 'develop' into mcflugen/update-templates
mcflugen Mar 5, 2024
c3c5674
update python versions for the templates to 3.10+
mcflugen Mar 5, 2024
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
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
Loading