From a86476f036cf9bbb65b91bd1d3b741e208a96a8d Mon Sep 17 00:00:00 2001 From: Rachel Hu Date: Fri, 29 Mar 2024 23:19:25 -0700 Subject: [PATCH 1/3] Add basic issue template, github workflows, and run_test.sh. --- .github/CODEOWNERS | 2 + .github/ISSUE_TEMPLATE/bug-report.yml | 51 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 +++ .github/ISSUE_TEMPLATE/documentation.yml | 20 +++++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 25 +++++++++++ .github/workflows/python-app.yml | 48 ++++++++++++++++++++ run_tests.sh | 2 + 7 files changed, 153 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml create mode 100644 .github/workflows/python-app.yml create mode 100755 run_tests.sh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..9a120df --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Default codeowners/reviewers for all code changes +* @CambioML @Sdddell diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..572e7ae --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,51 @@ +name: 🐛 Bug Report +description: Create a report to help us reproduce and fix the bug + +body: +- type: markdown + attributes: + value: > + #### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/CambioML/open-parser/issues?q=is%3Aissue+sort%3Acreated-desc+). +- type: textarea + attributes: + label: 🐛 Describe the bug + description: | + Please provide a clear and concise description of what the bug is. + + If relevant, add a minimal example so that we can reproduce the error by running the code. It is very important for the snippet to be as succinct (minimal) as possible, so please take time to trim down any irrelevant code to help us debug efficiently. We are going to copy-paste your code and we expect to get the same result as you did: avoid any external data, and include the relevant imports, etc. For example: + + ```python + ... + ``` + + If the code is too long (hopefully, it isn't), feel free to put it in a public gist and link it in the issue: https://gist.github.com. + + Please also paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````. + placeholder: | + A clear and concise description of what the bug is. + + ```python + # Sample code to reproduce the problem + ``` + + ``` + The error message you got, with the full traceback. + ``` + validations: + required: true +- type: textarea + attributes: + label: Versions + description: | + Please run the following and paste the output below. + ```sh + wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py + # For security purposes, please check the contents of collect_env.py before running it. + python collect_env.py + ``` + validations: + required: true +- type: markdown + attributes: + value: > + Thanks for contributing 🎉! diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f6af5ef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Questions + url: https://cambiomlworkspace.slack.com/join/shared_invite/zt-1zes33rmt-20Rag043uvExUaUdvt5_xQ#/shared-invite/email + about: Ask questions and discuss with other CambioML community members \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 0000000..094b62b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,20 @@ +name: 📚 Documentation +description: Report an issue related to https://www.cambioml.com/docs/open-parser/index.html + +body: +- type: textarea + attributes: + label: 📚 The doc issue + description: > + A clear and concise description of what content in https://www.cambioml.com/docs/open-parser/index.html is an issue. + validations: + required: true +- type: textarea + attributes: + label: Suggest a potential alternative/fix + description: > + Tell us how we could improve the documentation in this regard. +- type: markdown + attributes: + value: > + Thanks for contributing 🎉! diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000..62a700c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,25 @@ +name: 🚀 Feature request +description: Submit a proposal/request for a new open-parser feature + +body: +- type: textarea + attributes: + label: 🚀 The feature, motivation and pitch + description: > + A clear and concise description of the feature proposal. Please outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too. + validations: + required: true +- type: textarea + attributes: + label: Alternatives + description: > + A description of any alternative solutions or features you've considered, if any. +- type: textarea + attributes: + label: Additional context + description: > + Add any other context or screenshots about the feature request. +- type: markdown + attributes: + value: > + Thanks for contributing 🎉! diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..699dafc --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,48 @@ +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + pip install black + pip install isort + python -m pip install poetry + poetry install --no-root # This will install the project dependencies defined in pyproject.toml + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. + flake8 . --count --exit-zero --max-complexity=10 --statistics + - name: Format code with Black + run: | + black . --exclude="" --check --verbose + - name: Sort imports with isort + run: | + isort . --profile=black --check-only --verbose + - name: Test with unittest + run: | + poetry run python -m unittest discover diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..45a03e8 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,2 @@ +#!/bin/sh +python -m unittest discover tests From 05ccb1fa11e392c2fb4153f8966763164dc362ff Mon Sep 17 00:00:00 2001 From: Rachel Hu Date: Fri, 29 Mar 2024 23:26:26 -0700 Subject: [PATCH 2/3] Fix missing end line in config.py. --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f6af5ef..05d2eaa 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: true contact_links: - name: Questions url: https://cambiomlworkspace.slack.com/join/shared_invite/zt-1zes33rmt-20Rag043uvExUaUdvt5_xQ#/shared-invite/email - about: Ask questions and discuss with other CambioML community members \ No newline at end of file + about: Ask questions and discuss with other CambioML community members From 7126492c959e80a443c2754634ef6803e16fba17 Mon Sep 17 00:00:00 2001 From: Rachel Hu Date: Fri, 29 Mar 2024 23:34:48 -0700 Subject: [PATCH 3/3] Add dummy unittest. --- tests/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/test.py diff --git a/tests/test.py b/tests/test.py new file mode 100644 index 0000000..1a5aaf7 --- /dev/null +++ b/tests/test.py @@ -0,0 +1,9 @@ +import unittest + + +class TestNode(unittest.TestCase): + def setUp(self): + pass + + def test(self): + pass