diff --git a/.github/.github/CODEOWNERS b/.github/.github/CODEOWNERS new file mode 100644 index 0000000..5a8e735 --- /dev/null +++ b/.github/.github/CODEOWNERS @@ -0,0 +1 @@ +* @biocommons/maintainers diff --git a/.github/.github/ISSUE_TEMPLATE/bug-report.md b/.github/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..7451498 --- /dev/null +++ b/.github/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,24 @@ +--- +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: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/.github/ISSUE_TEMPLATE/feature-request.md b/.github/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/.github/ISSUE_TEMPLATE/project-proposal.md b/.github/.github/ISSUE_TEMPLATE/project-proposal.md new file mode 100644 index 0000000..01cb99d --- /dev/null +++ b/.github/.github/ISSUE_TEMPLATE/project-proposal.md @@ -0,0 +1,34 @@ +--- +name: Project Proposal +about: Create a proposal for an intern or GSoC project +title: 'Project: ...' +labels: 'project' +assignees: '' + +--- + +### Summary + +1-3 sentence summary of project. + +See Background. + +## Value + +Why is this project meaningful? + +## Required and Desired Skills + +- Python +- Relational database design, SQL + +## Expected Outcomes + +- **Headline**. Description... +- **Headline**. Description... + +## Potential Mentors + +- @reece + +## Background diff --git a/.github/.github/labels.yml b/.github/.github/labels.yml new file mode 100644 index 0000000..5d14504 --- /dev/null +++ b/.github/.github/labels.yml @@ -0,0 +1,59 @@ +- name: "bug" + color: "d73a4a" + description: "Something isn't working" + +- name: "documentation" + color: "0075ca" + description: "Improvements or additions to documentation" + +- name: "duplicate" + color: "cfd3d7" + description: "This issue or pull request already exists" + +- name: "enhancement" + color: "a2eeef" + description: "New feature or request" + +- name: "good first issue" + color: "7057ff" + description: "Good for newcomers" + +- name: "help wanted" + color: "008672" + description: "Extra attention is needed" + +- name: "invalid" + color: "e4e669" + description: "This doesn't seem right" + +- name: "keep alive" + color: "666666" + description: "exempt issue from staleness checks" + from_name: "keep alive" + +- name: "project proposal" + color: "d876e3" + description: "project proposal for interns and GSoC students" + +- name: "question" + color: "d876e3" + description: "Further information is requested" + +- name: "rfc" + color: "d876e3" + description: "Request for comments" + +- name: "stale" + color: "777777" + description: "Issue is stale and subject to automatic closing" + from_name: "Stale" + +- name: "stale closed" + color: "444444" + description: "Issue was closed automatically due to inactivity" + from_name: "stale-closed" + +- name: "won't fix" + color: "ffffff" + description: "This will not be worked on" + from_name: wontfix \ No newline at end of file diff --git a/.github/.github/workflows/labels.yml b/.github/.github/workflows/labels.yml new file mode 100644 index 0000000..8bdad11 --- /dev/null +++ b/.github/.github/workflows/labels.yml @@ -0,0 +1,23 @@ +name: Synchronize labels + +on: + push: + branches: + - 'main' + paths: + - '.github/labels.yml' + - '.github/workflows/labels.yml' + +jobs: + labeler: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Run Labeler + uses: crazy-max/ghaction-github-labeler@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + yaml-file: .github/labels.yml diff --git a/.github/.github/workflows/python-package.yml b/.github/.github/workflows/python-package.yml new file mode 100644 index 0000000..788f587 --- /dev/null +++ b/.github/.github/workflows/python-package.yml @@ -0,0 +1,123 @@ +name: Python package + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + pull_request: + +jobs: + cqa: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: '**/setup.cfg' + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip + pip install --use-deprecated=legacy-resolver -e .[dev] + + - 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. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Format check with isort + run: | + isort --check src + + - name: Format check with black + run: | + black --check src + + - name: Security check with bandit + run: | + bandit -ll -r src + + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: '**/setup.cfg' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + make develop + + - name: Test with pytest + run: | + make test + + - name: Upload coverage data to Codecov + run: | + # Verify integrity of codecov download + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + # Upload coverage report + chmod +x codecov + ./codecov + + deploy: + needs: + - cqa + - test + runs-on: ubuntu-latest + + steps: + - name: Environment + run: | + echo "::group::Environment info" + echo github.event_name = ${{ github.event_name }} + echo refs = ${{ github.ref }} + echo tags = ${{ startsWith(github.ref, 'refs/tags') }} + echo "::endgroup::" + + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: '**/setup.cfg' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build package + run: python -m build + + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/.github/workflows/stale.yml b/.github/.github/workflows/stale.yml new file mode 100644 index 0000000..0829446 --- /dev/null +++ b/.github/.github/workflows/stale.yml @@ -0,0 +1,11 @@ +# https://github.com/actions/stale + +name: 'Close stale issues and PRs' +on: + workflow_dispatch: + schedule: + - cron: '1 1 * * *' + +jobs: + stale: + uses: biocommons/actions/.github/workflows/stale.yml@main diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..5a8e735 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @biocommons/maintainers diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..7451498 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,24 @@ +--- +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: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/project-proposal.md b/.github/ISSUE_TEMPLATE/project-proposal.md new file mode 100644 index 0000000..01cb99d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/project-proposal.md @@ -0,0 +1,34 @@ +--- +name: Project Proposal +about: Create a proposal for an intern or GSoC project +title: 'Project: ...' +labels: 'project' +assignees: '' + +--- + +### Summary + +1-3 sentence summary of project. + +See Background. + +## Value + +Why is this project meaningful? + +## Required and Desired Skills + +- Python +- Relational database design, SQL + +## Expected Outcomes + +- **Headline**. Description... +- **Headline**. Description... + +## Potential Mentors + +- @reece + +## Background diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..5d14504 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,59 @@ +- name: "bug" + color: "d73a4a" + description: "Something isn't working" + +- name: "documentation" + color: "0075ca" + description: "Improvements or additions to documentation" + +- name: "duplicate" + color: "cfd3d7" + description: "This issue or pull request already exists" + +- name: "enhancement" + color: "a2eeef" + description: "New feature or request" + +- name: "good first issue" + color: "7057ff" + description: "Good for newcomers" + +- name: "help wanted" + color: "008672" + description: "Extra attention is needed" + +- name: "invalid" + color: "e4e669" + description: "This doesn't seem right" + +- name: "keep alive" + color: "666666" + description: "exempt issue from staleness checks" + from_name: "keep alive" + +- name: "project proposal" + color: "d876e3" + description: "project proposal for interns and GSoC students" + +- name: "question" + color: "d876e3" + description: "Further information is requested" + +- name: "rfc" + color: "d876e3" + description: "Request for comments" + +- name: "stale" + color: "777777" + description: "Issue is stale and subject to automatic closing" + from_name: "Stale" + +- name: "stale closed" + color: "444444" + description: "Issue was closed automatically due to inactivity" + from_name: "stale-closed" + +- name: "won't fix" + color: "ffffff" + description: "This will not be worked on" + from_name: wontfix \ No newline at end of file diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..8bdad11 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,23 @@ +name: Synchronize labels + +on: + push: + branches: + - 'main' + paths: + - '.github/labels.yml' + - '.github/workflows/labels.yml' + +jobs: + labeler: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Run Labeler + uses: crazy-max/ghaction-github-labeler@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + yaml-file: .github/labels.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..788f587 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,123 @@ +name: Python package + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + pull_request: + +jobs: + cqa: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: '**/setup.cfg' + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip + pip install --use-deprecated=legacy-resolver -e .[dev] + + - 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. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Format check with isort + run: | + isort --check src + + - name: Format check with black + run: | + black --check src + + - name: Security check with bandit + run: | + bandit -ll -r src + + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: '**/setup.cfg' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + make develop + + - name: Test with pytest + run: | + make test + + - name: Upload coverage data to Codecov + run: | + # Verify integrity of codecov download + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + # Upload coverage report + chmod +x codecov + ./codecov + + deploy: + needs: + - cqa + - test + runs-on: ubuntu-latest + + steps: + - name: Environment + run: | + echo "::group::Environment info" + echo github.event_name = ${{ github.event_name }} + echo refs = ${{ github.ref }} + echo tags = ${{ startsWith(github.ref, 'refs/tags') }} + echo "::endgroup::" + + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: '**/setup.cfg' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build package + run: python -m build + + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..0829446 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,11 @@ +# https://github.com/actions/stale + +name: 'Close stale issues and PRs' +on: + workflow_dispatch: + schedule: + - cron: '1 1 * * *' + +jobs: + stale: + uses: biocommons/actions/.github/workflows/stale.yml@main