From 39010ad5dde1434e9707933dff9a21d500389639 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Tue, 13 Sep 2022 13:53:46 +0200 Subject: [PATCH] Change markdown templates to YAML. Add version to init. --- .github/ISSUE_TEMPLATE/bug_report.md | 40 ---------------- .github/ISSUE_TEMPLATE/bug_report.yml | 55 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 25 ++++++++++ README.md | 6 ++- src/mypackage/__init__.py | 5 ++ 5 files changed, 90 insertions(+), 41 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 1f319df..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: - -**For issues with the Jupyter book** -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**For issues with the package** - -1. Add the version of the package (`python3 -c "import mypackage; print(mypackage.__version__)"`) -2. Add name of demo/test that is failing -3. Show all input and how the demo/test is executed -4. Add full error log. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Operating system:** - - OS: [e.g. Mac, Windows, Linux] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..405ad33 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,55 @@ +name: Bug report +description: Create a report if you believe something is not working +title: "[BUG]: " +labels: ["bug"] + +body: + - type: textarea + id: description + attributes: + label: How to reproduce the bug + description: Tell us how one can reproduce the bug + placeholder: Run `python3 -m pytest -xvs test` + validations: + required: true + - type: textarea + id: output + attributes: + label: Error output + description: If you get an error message or any output, please add it here + render: bash + placeholder: | + root@1516b1da338c:~/shared# python3 -m pytest -xvs test/ + ============================================= test session starts ============================================== + platform linux -- Python 3.10.4, pytest-7.1.3, pluggy-1.0.0 -- /usr/bin/python3 + cachedir: .pytest_cache + rootdir: /root/shared + plugins: anyio-3.6.1, cov-3.0.0 + collected 1 item + + test/test_code.py::test_addition PASSED + ============================================== 1 passed in 0.01s =============================================== + validations: + required: false + - type: dropdown + id: version + attributes: + label: Version + description: What version of our software are you running? + options: + - 0.1.0 + - main branch + validations: + required: true + - type: textarea + id: output + attributes: + label: system + description: What operating system are you using? + placeholder: i.e. "I'm Ubuntu 20.04" or "Im using Windows 11" + - type: textarea + id: extra + attributes: + label: Additional information + description: If you have any additional information, please add it here. + placeholder: You can drag and drop files here to attach them diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..9ec68e1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,25 @@ +name: Feature request +description: Add a request for a new/missing feature +title: "[Feature Request]: " +labels: ["newfeature"] + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + - type: textarea + id: description + attributes: + label: Describe new/missing feature + description: Tell us about what feature you are missing, and how you would like it to work. + placeholder: I would like you to add a `subtraction` subroutine... + validations: + required: true + - type: textarea + id: code-block + attributes: + label: Suggestion user interface + description: Please create a minimal (Python) code that shows how you would like the feature to work. + render: python3 + placeholder: No 3x``` encapsulation of code required \ No newline at end of file diff --git a/README.md b/README.md index a701549..1ef19be 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,20 @@ This repository is a template for how to set up a reproducible python environmen To be able to create a python package, we need a folder with the name of the package (in this repository `mypackage`), and a `pyproject.toml` file. + ## Make a repository citable The easiest way to make your repository citable is to add a `CITATION.cff` file to the repository, as it is supported by both [Zenodo's](https://zenodo.org/) and it's [Github integration](https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content) and [Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files) itself. +## Adding an issue template +See [Adding an issue template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) for more information. + ## Contributing Contributions are always welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for ways to get started. -A good idea is to look at the [issue tracker](https://github.com/jorgensd/reproducibility/issues) and see if you can resolve any open issues. +A good idea is to look at the [issue tracker](https://github.com/jorgensd/reproducibility/issues) and see if you can resolve any open issues. A list of good first issues can be found [here](https://github.com/jorgensd/reproducibility/contribute) If you find a bug in the source code, please [open an issue](https://github.com/jorgensd/reproducibility/issues/new). \ No newline at end of file diff --git a/src/mypackage/__init__.py b/src/mypackage/__init__.py index fb89dd5..a1a8f90 100644 --- a/src/mypackage/__init__.py +++ b/src/mypackage/__init__.py @@ -4,6 +4,11 @@ # This file is part of my_package # SPDX-License-Identifier: MIT +import importlib.metadata + from .functions import addition, print_add +__version__ = importlib.metadata.version(__package__) + + __all__ = ["addition", "print_add"]