forked from teast21/snpOracle
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from foundryservices/dev
Release v2.2.0
- Loading branch information
Showing
48 changed files
with
1,016 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copy the contents on this file to a new file called .env | ||
|
||
HF_ACCESS_TOKEN = 'REPLACE_WITH_HUGGINGFACE_ACCESS_KEY' | ||
WANDB_API_KEY = 'REPLACE_WITH_WANDB_API_KEY' | ||
WANDB_API_KEY = 'REPLACE_WITH_WANDB_API_KEY' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[flake8] | ||
extend-ignore = | ||
# E203 Whitespace before ":" | ||
E203, | ||
|
||
# E266, # E266 Too many leading "###" for block comment | ||
|
||
# E501 line too long (XX > 79 characters) | ||
E501 | ||
|
||
# W503, # W503 Line break before binary operator | ||
# F403, # F403 Used `from module import *` | ||
# F401 # F401 `module` imported but not used | ||
exclude = | ||
# No need to traverse our git directory | ||
.git, | ||
|
||
# There's no value in checking cache directories | ||
__pycache__, | ||
|
||
# No need to traverse example code | ||
*/examples/*, | ||
|
||
# No need to traverse docs | ||
docs, | ||
|
||
# Additional folders to skip | ||
mining_models, | ||
contrib, | ||
scripts, | ||
.venv | ||
max-complexity = 10 | ||
max-line-length = 79 | ||
per-file-ignores = __init__.py:F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Cache and Load Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
command: | ||
required: true | ||
type: string | ||
name: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
reusable-build: | ||
name: ${{ inputs.name }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
#------------------------------------------------ | ||
# Checkout repo and setup python | ||
#------------------------------------------------ | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
#------------------------------------------------ | ||
# Load cached venv if cache exists | ||
#------------------------------------------------ | ||
- name: Restore cached virtualenv | ||
uses: actions/cache/restore@v4 | ||
id: restore-cache | ||
with: | ||
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('dev_requirements.txt') }} | ||
path: .venv | ||
|
||
#------------------------------------------------ | ||
# Install dependencies - if cache does not exist | ||
#------------------------------------------------ | ||
- name: Install dependencies | ||
if: steps.restore-cache.outputs.cache-hit != 'true' | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
python -m pip install .[DEV] | ||
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH | ||
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | ||
#------------------------------------------------ | ||
# Save venv to cache - if not exists | ||
#------------------------------------------------ | ||
- name: Saved cached virtualenv | ||
if: steps.restore-cache.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
key: ${{ steps.restore-cache.outputs.cache-primary-key }} | ||
path: .venv | ||
|
||
#------------------------------------------------ | ||
# Run custom command(s) within venv | ||
#------------------------------------------------ | ||
- name: Run commands | ||
run: | | ||
source .venv/bin/activate | ||
${{ inputs.command }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main, dev] | ||
|
||
jobs: | ||
#---------------------------------------------- | ||
# Build Environment | ||
#---------------------------------------------- | ||
build: | ||
name: Build | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: Cache | ||
command: | | ||
python -m pip list | ||
python --version | ||
echo "Build successful" | ||
#---------------------------------------------- | ||
# Run Linters | ||
#---------------------------------------------- | ||
lint-black: | ||
name: Linter | ||
needs: build | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: Black | ||
command: python -m black --check . | ||
lint-isort: | ||
name: Linter | ||
needs: build | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: Isort | ||
command: python -m isort --check-only . | ||
lint-mypy: | ||
name: Linter | ||
needs: build | ||
if: false # This condition ensures the job is never executed | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: Mypy | ||
command: python -m mypy --verbose 0 . | ||
lint-flake8: | ||
name: Linter | ||
needs: build | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: Flake8 | ||
command: python -m flake8 . | ||
|
||
#---------------------------------------------- | ||
# Run Tests | ||
#---------------------------------------------- | ||
test-unittest: | ||
name: Tests | ||
needs: [ | ||
lint-black, | ||
lint-isort, | ||
lint-mypy, | ||
lint-flake8, | ||
] | ||
# `${{ always() }}` will run the tests regardless of linting success | ||
if: false # This condition ensures the job is never executed | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
name: Unittests | ||
command: pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.python-version | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
########################## | ||
# FORMATTERS # | ||
########################## | ||
- id: black | ||
name: black | ||
description: Format Python code | ||
language: system | ||
types: [python] | ||
entry: black | ||
exclude: | | ||
(?x)^( | ||
.git/.*| | ||
docs/.*| | ||
mining_models/.*| | ||
contrib/.*| | ||
scripts/.*| | ||
.venv/.* | ||
)$ | ||
- id: isort | ||
name: isort | ||
description: Format Python import statements | ||
language: system | ||
types: [python] | ||
entry: isort | ||
exclude: | | ||
(?x)^( | ||
.git/.*| | ||
docs/.*| | ||
mining_models/.*| | ||
contrib/.*| | ||
scripts/.*| | ||
.venv/.* | ||
)$ | ||
########################## | ||
# LINTERS # | ||
########################## | ||
# - id: mypy | ||
# name: mypy | ||
# description: Enforce correct python type hints | ||
# language: system | ||
# types: [python] | ||
# entry: mypy | ||
- id: flake8 | ||
name: flake8 | ||
description: Enforce PEP8 Python Style Guide | ||
language: system | ||
types: [python] | ||
entry: flake8 | ||
exclude: | | ||
(?x)^( | ||
.git/.*| | ||
docs/.*| | ||
mining_models/.*| | ||
contrib/.*| | ||
scripts/.*| | ||
.venv/.* | ||
)$ | ||
########################## | ||
# STANDARD # | ||
########################## | ||
- id: check-added-large-files | ||
name: check for added large files | ||
description: prevents giant files from being committed. | ||
entry: check-added-large-files | ||
language: system | ||
stages: [pre-commit, pre-push, manual] | ||
minimum_pre_commit_version: 3.2.0 | ||
args: ['--maxkb=500'] | ||
- id: check-ast | ||
name: check python ast | ||
description: simply checks whether the files parse as valid python. | ||
entry: check-ast | ||
language: system | ||
types: [python] | ||
- id: check-merge-conflict | ||
name: check for merge conflicts | ||
description: checks for files that contain merge conflict strings. | ||
entry: check-merge-conflict | ||
language: system | ||
types: [text] | ||
- id: check-toml | ||
name: check toml | ||
description: checks toml files for parseable syntax. | ||
entry: check-toml | ||
language: system | ||
types: [toml] | ||
- id: end-of-file-fixer | ||
name: fix end of files | ||
description: ensures that a file is either empty, or ends with one newline. | ||
entry: end-of-file-fixer | ||
language: system | ||
types: [text] | ||
stages: [pre-commit, pre-push, manual] | ||
minimum_pre_commit_version: 3.2.0 | ||
- id: no-commit-to-branch | ||
name: "don't commit to branch" | ||
entry: no-commit-to-branch | ||
language: system | ||
pass_filenames: false | ||
always_run: true | ||
args: [--branch, main, --branch, dev] | ||
- id: requirements-txt-fixer | ||
name: fix requirements.txt | ||
description: sorts entries in requirements.txt. | ||
entry: requirements-txt-fixer | ||
language: system | ||
files: (requirements|dev_requirements).*\.txt$ | ||
- id: trailing-whitespace | ||
name: trim trailing whitespace | ||
description: trims trailing whitespace. | ||
entry: trailing-whitespace-fixer | ||
language: system | ||
types: [text] | ||
stages: [pre-commit, pre-push, manual] | ||
minimum_pre_commit_version: 3.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.