Skip to content

Commit

Permalink
Merge branch 'staging' into update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Jul 15, 2024
2 parents d612810 + a659989 commit f3ee80f
Show file tree
Hide file tree
Showing 142 changed files with 512 additions and 118 deletions.
85 changes: 85 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Bug Report
description: Report a bug.
labels: ["bug"]
body:
- type: textarea
attributes:
label: Describe the bug
description: Provide a clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Provide detailed steps to replicate the bug.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: Current behavior
description: |
What actually happened?
Include full errors, stack traces, and/or relevant logs.
validations:
required: true
- type: textarea
attributes:
label: Possible reason(s)
description: Provide any insights into what might be causing the issue.
validations:
required: false
- type: textarea
attributes:
label: Suggested fix
description: Provide any suggestions on how to resolve the bug.
validations:
required: false
- type: textarea
attributes:
label: Branch, commit, and/or version
description: Provide the branch, commit, and/or version you're using.
placeholder: |
branch: issue-1
commit: abc123d
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots with descriptions to help explain your problem.
validations:
required: false
- type: textarea
attributes:
label: Environment details
description: Provide environment details (OS name and version, etc).
validations:
required: true
- type: textarea
attributes:
label: Additional details
description: Provide any other additional details about the problem.
validations:
required: false
- type: dropdown
attributes:
label: Contribution
description: Can you contribute to the development of this feature?
options:
- "Yes, I can create a PR for this fix."
- "Yes, but I can only provide ideas and feedback."
- "No, I cannot contribute."
validations:
required: false
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Feature Request
description: Suggest an idea for this project.
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Feature description
description: Provide a clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Use case
description: |
Why do you need this feature? For example: "I'm always frustrated when..."
validations:
required: true
- type: textarea
attributes:
label: Proposed solution
description: Provide proposed solution.
validations:
required: false
- type: textarea
attributes:
label: Alternatives considered
description: Describe any alternative solutions you've considered.
validations:
required: false
- type: textarea
attributes:
label: Implementation details
description: Provide any technical details on how the feature might be implemented.
validations:
required: false
- type: textarea
attributes:
label: Potential Impact
description: |
Discuss any potential impacts of this feature on existing functionality or performance, if known.
Will this feature cause breaking changes?
What challenges might arise?
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Provide any other context or screenshots about the feature.
validations:
required: false
- type: dropdown
attributes:
label: Contribution
description: Can you contribute to the development of this feature?
options:
- "Yes, I can create a PR for this feature."
- "Yes, but I can only provide ideas and feedback."
- "No, I cannot contribute."
validations:
required: false
8 changes: 4 additions & 4 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -23,10 +23,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -42,7 +42,7 @@ jobs:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Stalebot for issues and PRs"

on:
schedule:
- cron: "30 13 * * 1-5"

jobs:
stale-high-priority:
uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 90
days-before-pr-stale: 1
labels: priority:high

stale-medium-priority:
uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 135
days-before-pr-stale: 3
labels: priority:medium

stale-low-priority:
uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 180
days-before-pr-stale: 7
labels: priority:low
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0 # pre-commit-hooks version
hooks:
- id: check-added-large-files
- id: detect-private-key
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: detect-aws-credentials
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.5.0 # ruff version
hooks:
- id: ruff-format
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
minimum_pre_commit_version: 3.7.1
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ verify_ssl = true
pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
pre-commit = "*"
pre-commit = ">=3.7.1"
variation-normalizer = {editable = true, path = "."}
jupyter = "*"
ipykernel = "*"
psycopg2-binary = "*"
ruff = "==0.2.0"
ruff = "==0.5.0"

[packages]
"biocommons.seqrepo" = "*"
Expand Down
32 changes: 26 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dynamic = ["version"]

[project.optional-dependencies]
test = ["pytest>=6.0", "pytest-cov", "pytest-asyncio"]
dev = ["pre-commit", "ruff==0.2.0", "psycopg2-binary", "jupyter", "ipykernel"]
dev = ["pre-commit>=3.7.1", "ruff==0.5.0", "psycopg2-binary", "jupyter", "ipykernel"]

[project.urls]
Homepage = "https://github.com/cancervariants/variation-normalization"
Expand Down Expand Up @@ -72,6 +72,9 @@ branch = true

[tool.ruff]
src = ["src"]
extend-exclude = [
"codebuild/*"
]

[tool.ruff.lint]
select = [
Expand All @@ -90,16 +93,22 @@ select = [
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
fixable = [
Expand All @@ -110,15 +119,19 @@ fixable = [
"ANN",
"B",
"C4",
"LOG",
"G",
"PIE",
"PT",
"RSE",
"SIM",
"PERF",
"FURB",
"RUF"
]
# ANN101 - missing-type-self
# ANN003 - missing-type-kwargs
# ANN101 - missing-type-self
# ANN102 - missing-type-cls
# D203 - one-blank-line-before-class
# D205 - blank-line-after-summary
# D206 - indent-with-spaces*
Expand All @@ -134,7 +147,7 @@ fixable = [
# PGH003 - blanket-type-ignore
# *ignored for compatibility with formatter
ignore = [
"ANN101", "ANN003",
"ANN003", "ANN101", "ANN102",
"D203", "D205", "D206", "D213", "D300", "D400", "D415",
"E111", "E114", "E117", "E501",
"W191",
Expand All @@ -146,15 +159,22 @@ ignore = [
# ANN001 - missing-type-function-argument
# ANN2 - missing-return-type
# ANN201 - Missing type annotation
# ANN102 - missing-type-cls
# N805 - invalid-first-argument-name-for-method
# S101 - assert
# B011 - assert-false
# SLF001 - private-member-access
# INP001 - implicit-namespace-package
# RUF001 - ambiguous-unicode-character-string
"tests/*" = ["ANN001", "ANN102", "ANN2", "S101", "B011"]
# ARG002 - unused-method-argument
"tests/*" = ["ANN001", "ANN2", "S101", "B011", "SLF001", "INP001"]
"src/variation/schemas/*" = ["ANN001", "ANN201", "N805", "S101"]
"codebuild/*" = ["T201"]
"codebuild/*" = ["T201", "INP001"]
"src/variation/validators/*" = ["ARG002"]
"src/variation/translators/*" = ["ARG002"]

[tool.ruff.lint.flake8-bugbear]
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
extend-immutable-calls = ["fastapi.Query"]

[tool.ruff.format]
docstring-code-format = true
29 changes: 0 additions & 29 deletions src/variation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,30 +1 @@
"""The Variation Normalization package."""
import logging
from os import environ

if "VARIATION_NORM_EB_PROD" in environ:
LOG_FN = "/tmp/variation.log" # noqa: S108
else:
LOG_FN = "variation.log"

logging.basicConfig(
filename=LOG_FN, format="[%(asctime)s] - %(name)s - %(levelname)s : %(message)s"
)
logger = logging.getLogger("variation")
logger.setLevel(logging.DEBUG)
logger.handlers = []

logging.getLogger("cool_seq_tool").setLevel(logging.INFO)
logging.getLogger("boto3").setLevel(logging.INFO)
logging.getLogger("botocore").setLevel(logging.INFO)
logging.getLogger("urllib3").setLevel(logging.INFO)
logging.getLogger("python_jsonschema_objects").setLevel(logging.INFO)
logging.getLogger("hgvs.parser").setLevel(logging.INFO)
logging.getLogger("biocommons.seqrepo.seqaliasdb.seqaliasdb").setLevel(logging.INFO)
logging.getLogger("biocommons.seqrepo.fastadir.fastadir").setLevel(logging.INFO)
logging.getLogger("asyncio").setLevel(logging.INFO)

if "VARIATION_NORM_EB_PROD" in environ:
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
1 change: 1 addition & 0 deletions src/variation/classifiers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Classifier package level import."""

from .amplification_classifier import AmplificationClassifier
from .cdna_deletion_classifier import CdnaDeletionClassifier
from .cdna_delins_classifier import CdnaDelInsClassifier
Expand Down
Loading

0 comments on commit f3ee80f

Please sign in to comment.