commit b347acbfd18552be8a84cb5a18aa57f011ac0b69 Author: Jean-Marie Mineau Date: Fri Mar 24 18:46:12 2023 +0100 first commit diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 0000000..86b806c --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,13 @@ +{ + "project_name": "", + "project_short_description": "", + "full_name": "Jean-Marie 'Histausse' Mineau", + "email": "histausse@protonmail.com", + "git_user": "histausse", + "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}", + "project_url": "https://git.mineau.eu/{{ cookiecutter.git_user }}/{{ cookiecutter.project_slug }}", + "git_ogirin": "git@git.mineau.eu/{{ cookiecutter.git_user }}/{{ cookiecutter.project_slug }}.git", + "version": "0.1.0", + "open_source_license": ["GNU General Public License v3", "MIT license", "BSD license", "ISC license", "Apache Software License 2.0", "Not open source"], + "python_min_version": "3.10" +} diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py new file mode 100644 index 0000000..e01a4e3 --- /dev/null +++ b/hooks/post_gen_project.py @@ -0,0 +1,11 @@ +import subprocess + +subprocess.call(["git", "init"]) +subprocess.call(["git", "add", "*"]) +subprocess.call(["git", "commit", "-m", "Initial commit"]) +subprocess.call(["git", "config", "user.name", "{{ cookiecutter.git_user }}"]) +subprocess.call(["git", "config", "user.email", "{{ cookiecutter.email }}"]) +subprocess.call(["git", "remote", "add", "origin", "{{ cookiecutter.git_ogirin }}"]) +subprocess.call(["git", "branch", "-u", "origin/master"]) + +subprocess.call(["python", "-m", "venv", "venv"]) diff --git a/{{ cookiecutter.project_name }}/.gitignore b/{{ cookiecutter.project_name }}/.gitignore new file mode 100644 index 0000000..a23a015 --- /dev/null +++ b/{{ cookiecutter.project_name }}/.gitignore @@ -0,0 +1,32 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# virtualenv +venv/ + +# mypy +.mypy_cache/ diff --git a/{{ cookiecutter.project_name }}/LICENSE b/{{ cookiecutter.project_name }}/LICENSE new file mode 100644 index 0000000..24b2600 --- /dev/null +++ b/{{ cookiecutter.project_name }}/LICENSE @@ -0,0 +1,111 @@ +{% if cookiecutter.open_source_license == 'MIT license' -%} +MIT License + +Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +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.full_name }} +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +{% elif cookiecutter.open_source_license == 'ISC license' -%} +ISC License + +Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.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.full_name }} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +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.project_short_description }} + Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. +{% endif %} diff --git a/{{ cookiecutter.project_name }}/pyproject.toml b/{{ cookiecutter.project_name }}/pyproject.toml new file mode 100644 index 0000000..2f8ce77 --- /dev/null +++ b/{{ cookiecutter.project_name }}/pyproject.toml @@ -0,0 +1,42 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "{{ cookiecutter.project_slug }}" +version = "{{ cookiecutter.version }}" +authors = [ + { name="{{ cookiecutter.full_name }}", email="{{ cookiecutter.email }}" }, +] +description = "{{ cookiecutter.project_short_description }}" +readme = "README.md" + +requires-python = ">={{ cookiecutter.python_min_version }}" +dependencies = [] + +[project.urls] +"Homepage" = "{{ cookiecutter.project_url }}" +"Bug Tracker" = "{{ cookiecutter.project_url }}/issues" +[histausse@grace-hopper {{ cookiecutter.project_name }}]$ cat ../../pyproject.toml +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "{{ cookiecutter.project_slug }}" +version = "{{ cookiecutter.version }}" +authors = [ + { name="{{ cookiecutter.full_name }}", email="{{ cookiecutter.email }}" }, +] +description = "{{ cookiecutter.project_short_description }}" +readme = "README.md" + +requires-python = ">={{ cookiecutter.python_min_version }}" +dependencies = [] + +[project.urls] +"Homepage" = "{{ cookiecutter.project_url }}" +"Bug Tracker" = "{{ cookiecutter.project_url }}/issues" + +[project.scripts] +analyse_artifact = "{{ cookiecutter.project_slug }}.cli:main"