diff --git a/.auto-changelog-template.hbs b/.auto-changelog-template.hbs index 5a2c3f90..60d2ab92 100644 --- a/.auto-changelog-template.hbs +++ b/.auto-changelog-template.hbs @@ -33,6 +33,8 @@ Example Definitions "([bB]reaking change:)": "", "(^[bB]uild:)": "", "(^[bB]uild\\()": "\\(", + "(^[dD]eprecate:)": "", + "(^[dD]eprecate\\()": "\\(", "(^[fF]eat:)": "", "(^[fF]eat\\()": "\\(", "(^[fF]ix:)": "", @@ -84,7 +86,7 @@ Example Definitions - {{#if commit.breaking}}**Breaking change:** {{/if}}{{commit.subject}}{{#each fixes}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}){{/each}} {{/each}} - {{! List commits with 'breaking:' or 'Breaking change:' anywhere in the message under a heading}} + {{! List merge commits with 'breaking:' or 'Breaking change:' anywhere in the message under a heading}} {{#commit-list merges heading='### Breaking Changes :warning:' message='[bB]reaking [cC]hange:|[bB]reaking:' exclude='\[skip-changelog\]'}} - {{message}} @{{author}} {{/commit-list}} @@ -94,6 +96,10 @@ Example Definitions - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) {{/commit-list}} + {{#commit-list merges heading='### Deprecated Features' message='^[dD]eprecate:|^[dD]eprecate\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}} + - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) + {{/commit-list}} + {{#commit-list merges heading='### New Features' message='^[fF]eat:|^[fF]eat\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}} - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) {{/commit-list}} @@ -130,7 +136,7 @@ Example Definitions - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) {{/commit-list}} - {{#commit-list merges heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}} + {{#commit-list merges heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[dD]eprecate:|^[dD]eprecate\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}} - {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}}) {{/commit-list}} @@ -144,6 +150,10 @@ Example Definitions - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) {{/commit-list}} + {{#commit-list commits heading='### Deprecated Features' message='^[dD]eprecate:|^[dD]eprecate\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}} + - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) + {{/commit-list}} + {{#commit-list commits heading='### New Features' message='^[fF]eat:|^[fF]eat\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}} - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) {{/commit-list}} @@ -180,7 +190,7 @@ Example Definitions - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) {{/commit-list}} - {{#commit-list commits heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}} + {{#commit-list commits heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[dD]eprecate:|^[dD]eprecate\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}} - {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}}) {{/commit-list}} diff --git a/.copier-answers.yml b/.copier-answers.yml index 7a869408..69c0f61d 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ # Changes here will be overwritten by Copier -_commit: 0.1.36 +_commit: 0.1.44 _src_path: git@bbpgitlab.epfl.ch:neuromath/python-template.git author_email: '' author_name: Blue Brain Project, EPFL @@ -22,6 +22,7 @@ ssh_url: git@github.com:BlueBrain/NeuroTS.git support_py37: false team_name: neuromath tracker_url: https://github.com/BlueBrain/NeuroTS/issues +use_pyproject_toml: false version: 3.2.0 # End of Copier answers diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 00000000..fe3f5ac2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,114 @@ +# docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema + +name: Create a bug report regarding NeuroTS runtime behavior +description: Errors and regression reports with complete reproducing test cases and/or stack traces. +labels: [bug] +title: "[Bug report] " +body: + - type: markdown + attributes: + value: " +Thanks for taking the time to fill out this bug report! + + +Before submitting, make sure you search in the [issue list](https://github.com/BlueBrain/NeuroTS/issues) that a similar issue was not already reported. +If it is not the case, please read the following guidelines. + +### GUIDELINES FOR REPORTING BUGS + +Bug reports that are not properly formulated and formatted or without enough details can be very hard for us to understand and fix. +In order to ensure we can help you fixing your bug, please follow these guidelines. + + +Your reports must include the following features: + +1. **succinct description** of the problem - typically a line or two at most. + +2. **succinct, dependency-free code** which reproduces the problem, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example. + IF YOU DO NOT HAVE A COMPLETE, RUNNABLE TEST CASE WRITTEN DIRECTLY IN THE TEXTAREA BELOW, YOUR ISSUE MAY BE CLOSED. + +3. **complete stack traces for all errors** - please avoid screenshots, use formatted text inside issues. + +4. other relevant things as applicable: **dependencies**, **comparative performance timings** for performance issues, etc. +" + + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: input + id: relevant_documentation + attributes: + label: Optional link from https://NeuroTS.readthedocs.io which documents the behavior that is expected + description: " +Please make sure the behavior you are seeing is definitely in contradiction to what's documented as the correct behavior. +" + validations: + required: false + + - type: textarea + attributes: + label: To Reproduce + description: " +Provide your [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example here." + placeholder: "# Insert code here (text area already python formatted)" + render: Python + validations: + required: true + + - type: textarea + attributes: + label: Error + description: " +Provide the complete text of any errors received **including the complete stack trace**. +If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py`` +" + placeholder: "# Copy the complete stack trace and error message here (text area already formatted for Python backtrace)" + render: Python traceback + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + validations: + required: false + + - type: input + id: package_version + attributes: + label: neurots Version in Use + description: e.g. 1.4.42, 2.0.2, etc or commit hash + validations: + required: true + + - type: input + id: python_version + attributes: + label: Python Version + description: Assumes cpython unless otherwise stated, e.g. 3.10, 3.11, pypy + validations: + required: true + + - type: dropdown + id: os + attributes: + label: Operating system + description: Check all that apply + multiple: true + options: + - Linux + - MacOS + - Windows + - Other + validations: + required: true + + - type: markdown + attributes: + value: "### Thanks! Have a nice day!" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..0086358d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 00000000..c82314a0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,56 @@ +# docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema + +name: Request a new use case +description: Support for new features +labels: [enhancement] +title: "[Feature request] " +body: + - type: markdown + attributes: + value: " +Thanks for taking the time to fill out this feature request! + + +Before submitting, make sure the feature does not already exist in the [documentation](https://NeuroTS.readthedocs.io) and that you searched in the [issue list](https://github.com/BlueBrain/NeuroTS/issues) that a similar feature request has not already been reported. +If it is not the case, please read the following guidelines. + +### GUIDELINES FOR REQUESTING HELP + +Feature requests that are not properly formulated and formatted or without enough details can be very hard for us to understand. +In order to ensure we can help you, please follow these guidelines. + + +Your requests must include the following features: + +1. **succinct description** of the feature - typically a line or two at most to describe what the new feature would do. + +2. **succinct, dependency-free code** which shows how you would like to use this feature, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example. + +3. Why do you need this feature? What would be the use cases? +" + + - type: textarea + attributes: + label: Describe the feature + description: A clear and concise description of what the feature would consist in. + validations: + required: true + + - type: textarea + attributes: + label: Example Use + description: Provide a clear example of what the usage of this feature would look like. + validations: + required: true + + - type: textarea + attributes: + label: Use cases + description: Add as much information as possible about the use cases here. + validations: + required: true + + - type: markdown + attributes: + value: "### Thanks! Have a nice day!" diff --git a/.github/ISSUE_TEMPLATE/how_to_use.yaml b/.github/ISSUE_TEMPLATE/how_to_use.yaml new file mode 100644 index 00000000..63c1a652 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/how_to_use.yaml @@ -0,0 +1,91 @@ +# docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms +# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema + +name: Ask for help about NeuroTS +description: Questions about neurots features. +labels: [how to use] +title: "[How to use] " +body: + - type: markdown + attributes: + value: " +Thanks for using this package and taking the time to fill out this help request! + + +Before submitting, make sure you read the [documentation](https://NeuroTS.readthedocs.io) carefully. +If you still have a question, you should search in the [issue list](https://github.com/BlueBrain/NeuroTS/issues) that a similar issue has not already been reported, you might find your answer there. +If it is not the case, please read the following guidelines. + +### GUIDELINES FOR REQUESTING HELP + +Questions that are not properly formulated and formatted or without enough details can be very hard for us to understand. +In order to ensure we can help you, please follow these guidelines. + + +Your requests must include the following features: + +1. **succinct description** of the problem - typically a line or two at most to describe what you want to achieve. + +2. **succinct, dependency-free code** which shows what you tried to do, otherwise known as a [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve). + +3. **expected results** + +4. **complete stack traces for all errors** if you have any - please avoid screenshots, use formatted text inside issues. + +5. other relevant things: **dependencies**, **operating system**, **comparative performance timings** for performance issues. +" + + - type: textarea + attributes: + label: Describe the problem + description: A clear and concise description of what you want to achieve. + validations: + required: true + + - type: textarea + attributes: + label: Show what you tried to do. + description: " +Provide your [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve) here." + placeholder: "# Insert code here (text area already python formatted)" + render: Python + validations: + required: true + + - type: textarea + attributes: + label: Describe what you expected. + description: A clear and concise description of what you which result you expected by doing this. + validations: + required: true + + - type: textarea + attributes: + label: Error + description: " +If you are facing an arror, provide the complete text of any errors received **including the complete stack trace**. +If the message is a warning, run your program with the ``-Werror`` flag: ``python -Werror myprogram.py`` +" + placeholder: "# Copy the complete stack trace and error message here (text area already formatted for Python backtrace)" + render: Python traceback + validations: + required: false + + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + validations: + required: false + + - type: input + id: package_version + attributes: + label: neurots Version in Use + description: e.g. 1.4.42, 2.0.2, etc or commit hash + validations: + required: true + + - type: markdown + attributes: + value: "### Thanks! Have a nice day!" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..a3728e0f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ + + + +### Description + + +### Checklist + + +This pull request is: + +- [ ] A documentation / typographical error fix + - Good to go, no issue or tests are needed +- [ ] A short code fix + - [ ] Please include: `Fixes: #` in the description if it solves an existing issue + (which must include a complete example of the issue). + - [ ] Please include tests that fail with the `main` branch and pass with the provided fix. +- [ ] A new feature implementation or update an existing feature + - [ ] Please include: `Fixes: #` in the description if it solves an existing issue + (which must include a complete example of the feature). + - [ ] Please include tests that cover every lines of the new/updated feature. + - [ ] Please update the documentation to describe the new/updated feature. + + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59c0ef63..9bf3d1c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.4.0 + rev: v9.5.0 hooks: - id: commitlint stages: @@ -24,11 +24,11 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.4 hooks: - id: codespell args: ["-x", ".codespellignorelines"] diff --git a/commitlint.config.js b/commitlint.config.js index 80904874..df424e49 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -20,6 +20,7 @@ module.exports = { 'Build', 'Chore', 'CI', + 'Deprecate', 'Docs', 'Feat', 'Fix', @@ -101,6 +102,11 @@ module.exports = { title: 'Release', emoji: '🎉', }, + Deprecate: { + description: 'Deprecate a feature', + title: 'Deprecations', + emoji: '🗳', + }, }, }, scope: { diff --git a/package.json b/package.json index 89bc6df3..2b86e819 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "(^[cC]hore\\((.*)\\): ?)": "\\($2\\)", "(^[cC][iI]: ?)": "", "(^[cC][iI]\\((.*)\\): ?)": "\\($2\\)", + "(^[dD]eprecate: ?)": "", + "(^[dD]eprecate\\((.*)\\): ?)": "\\($2\\)", "(^[dD]ocs: ?)": "", "(^[dD]ocs\\((.*)\\): ?)": "\\($2\\)", "(^[fF]eat: ?)": "", diff --git a/pyproject.toml b/pyproject.toml index 187aeee4..d7f2a325 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,21 @@ -# SETUPTOOLS [build-system] requires = [ - "setuptools>=42", - "wheel", - "setuptools_scm[toml]>=3.4", + "setuptools>=45", + "setuptools_scm[toml]>=6.2", ] build-backend = "setuptools.build_meta" -# BLACK +[tool.setuptools_scm] + [tool.black] line-length = 100 target-version = [ "py38", "py39", + "py310", + "py311", ] -# PYDOCSTYLE [tool.pydocstyle] # ignore the following: # - D107: Missing docstring in __init__ @@ -25,13 +25,11 @@ add-ignore = [ convention = "google" match = 'neurots\/.*\.py$|docs\/source\/conf\.py$|setup\.py$|examples\/.*.py$' -# ISORT [tool.isort] profile = "black" line_length = 100 force_single_line = true -# PYTEST [tool.pytest.ini_options] testpaths = [ "tests",