Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
psmyth94 committed Nov 18, 2024
0 parents commit 87817e3
Show file tree
Hide file tree
Showing 199 changed files with 41,999 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/conda/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
46 changes: 46 additions & 0 deletions .github/conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% set name = "biofit" %}

package:
name: "{{ name|lower }}"
version: "{{ BIOFIT_VERSION }}"

source:
path: ../../

build:
noarch: python
requirements:
host:
- python
- pip
run:
- python
- pip
- biocore
- filelock
- numpy >=1.17
- pyarrow >=8.0.0
- pyarrow-hotfix
- dill >=0.3.0,<0.3.8
- pandas
- requests >=2.19.0
- tqdm >=4.62.1
- xxhash
- multiprocess
- fsspec[http] >=2023.1.0,<=2023.10.0
- packaging
- pyyaml >=5.1
- scikit-learn >=1.4.0
test:
imports:
- biofit
about:
home: https://github.com/psmyth94/biofit
license: Apache-2.0
license_file: LICENSE
summary: A Python package for machine learning on omics datasets.
keywords:
- omics
- machine learning
- bioinformatics
- datasets
60 changes: 60 additions & 0 deletions .github/workflows/ci_cd_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI/CD Pipeline
on:
push:
branches:
- main
- "ci-*"
pull_request:
branches:
- main
jobs:
check_code_quality:
name: Check Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[quality]
- name: Run Ruff code quality checks
run: |
ruff check tests src setup.py --output-format=github
ruff format --check tests src setup.py
tests:
needs: check_code_quality
strategy:
matrix:
test: [unit]
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.test == 'integration' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv --upgrade
uv pip install --system "biofit[test] @ ."
- name: Run Tests
run: |
mkdir -p reports/${{ matrix.test }}_tests
python3 -m pytest -m ${{ matrix.test }} -n 2 --dist loadfile -sv ./tests/ --junitxml=reports/${{ matrix.test }}_tests/results.xml
- name: Upload Unit Test Results
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.test }}-test-reports
path: reports/${{ matrix.test }}_tests/results.xml
36 changes: 36 additions & 0 deletions .github/workflows/conda-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Conda - Build
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
jobs:
build_and_package:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: "build-biofit"
python-version: 3.8
channels: patrico49
- name: Setup conda env
run: |
conda install -c defaults anaconda-client conda-build
- name: Extract version
run: echo "BIOFIT_VERSION=`python setup.py --version`" >> $GITHUB_ENV
- name: Build conda packages
run: |
conda info
conda build .github/conda
- name: Upload to Anaconda
run: |
anaconda upload `conda build .github/conda --output -c conda-forge` --force
35 changes: 35 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PyPI - Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
jobs:
build_and_publish:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Extract version
run: echo "BIOFIT_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
run: |
python -m twine upload dist/* --non-interactive
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
results/
*.lock
_dev
# Ignore Nextflow-related files and directories
.nextflow*
work
_dev/in_progress*
.dev

# Ignore data directory
tests/data

# anything not ipynb related
tutorials/*
!tutorials/*.ipynb


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
.conda

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

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
cache*.arrow
cache*.yaml

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints
-checkpoint.ipynb

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to https://pipenv.pypa.io/en/latest/advanced/#pipfile-vs-pipfilelock
# PIPENV_VENV_IN_PROJECT=1
Pipfile.lock

# Poetry
# https://python-poetry.org/docs/basic-usage/#configuring-poetry
.poetry/

# virtualenv
venv/
env/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Idea project settings
.idea/

# PyCharm project settings
.idea/

# Visual Studio Code settings
.vscode/
.vs/

# MyPy
.mypy_cache/

# pycodestyle
.pytest_cache/

#Docker
*Dockerfile
*dockerignore
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit # https://github.com/charliermarsh/ruff#usage
rev: 'v0.3.0'
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
Loading

0 comments on commit 87817e3

Please sign in to comment.