Skip to content

Commit

Permalink
Merge pull request #2 from alliance-genome/KANBAN-504_seq-retrieval
Browse files Browse the repository at this point in the history
KANBAN-504 seq retrieval core functionality
  • Loading branch information
mluypaert committed Mar 14, 2024
2 parents 96ddfb3 + 2207ad6 commit 7df062c
Show file tree
Hide file tree
Showing 12 changed files with 727 additions and 30 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/PR-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: PR validation
on:
pull_request:
types: [synchronize, opened, reopened, edited]
branches:
- main
jobs:
pipeline-seq-retrieval-container-image-build:
name: pipeline/seq_retrieval container-image build
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
working-directory: ./pipeline/seq_retrieval/
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
pipeline/seq_retrieval/
- name: Build container image
run: |
make container-image
pipeline-seq-retrieval-python-typing-check:
name: pipeline/seq_retrieval python typing check
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
working-directory: ./pipeline/seq_retrieval/
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
pipeline/seq_retrieval/
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check python typing
run: |
make check-python-typing
pipeline-seq-retrieval-python-style-check:
name: pipeline/seq_retrieval python style check
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
working-directory: ./pipeline/seq_retrieval/
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
pipeline/seq_retrieval/
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check python style
run: |
make check-python-style
#TODO: add unit testing
#TODO: add integration testing
64 changes: 34 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Byte-compiled / optimized / DLL files
# Python files
## Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
## C extensions
*.so

# Distribution / packaging
## Distribution / packaging
.Python
build/
develop-eggs/
Expand All @@ -26,17 +27,17 @@ share/python-wheels/
*.egg
MANIFEST

# PyInstaller
## PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
## package installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
## Unit test / coverage reports
htmlcov/
.tox/
.nox/
Expand All @@ -51,75 +52,75 @@ coverage.xml
.pytest_cache/
cover/

# Translations
## Translations
*.mo
*.pot

# Django stuff:
## Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
## Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
## Scrapy stuff:
.scrapy

# Sphinx documentation
## Sphinx documentation
docs/_build/

# PyBuilder
## PyBuilder
.pybuilder/
target/

# Jupyter Notebook
## Jupyter Notebook
.ipynb_checkpoints

# IPython
## IPython
profile_default/
ipython_config.py

# pyenv
## pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
## pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
## poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
## pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
## PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
## Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
## SageMath parsed files
*.sage.py

# Environments
## Environments
.env
.venv
env/
Expand All @@ -128,33 +129,36 @@ ENV/
env.bak/
venv.bak/

# Spyder project settings
## Spyder project settings
.spyderproject
.spyproject

# Rope project settings
## Rope project settings
.ropeproject

# mkdocs documentation
## mkdocs documentation
/site

# mypy
## mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
## Pyre type checker
.pyre/

# pytype static type analyzer
## pytype static type analyzer
.pytype/

# Cython debug symbols
## Cython debug symbols
cython_debug/

# PyCharm
## PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# VS Code
.vscode/
6 changes: 6 additions & 0 deletions pipeline/seq_retrieval/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
ignore = E203, E266, E501, F401, W503, E501
max-complexity = 18
select = B,C,E,F,W,T4
exclude = venv
per-file-ignores = __init__.py:F401
13 changes: 13 additions & 0 deletions pipeline/seq_retrieval/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.12-alpine

WORKDIR /usr/src/app

RUN apk add --no-cache build-base zlib-dev bzip2-dev xz-dev

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY src/ ./

ENTRYPOINT [ "python", "main.py"]
CMD [ "--help" ]
34 changes: 34 additions & 0 deletions pipeline/seq_retrieval/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: check-venv-active check-python-typing

container-image:
docker build -t agr_pavi/seq_retrieval .
python-dependencies:
pip install -r requirements.txt

python-dependencies-update:
pip install -U -r requirements.txt

python-test-dependencies:
pip install -r tests/requirements.txt

check-python-typing: python-dependencies python-test-dependencies
mypy --install-types --non-interactive src/main.py

check-python-style: python-dependencies python-test-dependencies
flake8 ./

check-venv-active:
ifeq ($(VIRTUAL_ENV),)
@echo 'No active python virtual environment found.'\
'Please active the virtual environment first by running `source venv/bin/activate`,'\
'or read README.md for instructions on how to set up a new one.'
@exit 1
else
@:
endif

python-dependencies-dev: check-venv-active python-dependencies

python-dependencies-dev-update: check-venv-active python-dependencies-update

check-python-typing-dev: check-venv-active check-python-typing
Loading

0 comments on commit 7df062c

Please sign in to comment.