Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
File renamed without changes.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Python CI

on:
push:
branches: [ master, main, dev-master, dev-refactored, refactor-phylo ]
pull_request:
branches: [ master, main, dev-master, dev-refactored, refactor-phylo ]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
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 }}

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
sudo apt-get install -qq phyml
python -m pip install --upgrade pip setuptools wheel
pip install --only-binary=numpy,scipy numpy scipy
pip install matplotlib ipython jupyter sympy pytest codecov pytest-cov
pip install -r requirements.txt
pip install -e .

- name: Run tests
run: pytest --cov=OrthoEvol --cov-report=xml --junitxml=junit.xml tests/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Notify failure
if: failure()
run: echo "Build failed"
73 changes: 73 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Documentation

on:
push:
branches: [ master, main, dev-master, dev-refactored ]
paths:
- 'docs/**'
- 'OrthoEvol/**'
- 'setup.py'
- '.readthedocs.yml'
pull_request:
branches: [ master, main, dev-master, dev-refactored ]
paths:
- 'docs/**'
- 'OrthoEvol/**'
- 'setup.py'
- '.readthedocs.yml'
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-docs-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-docs-

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install sphinx pypandoc
pip install -r requirements.txt
pip install -e .

- name: Update and build documentation
run: |
python docs/update_docs.py

- name: Check for documentation errors
run: |
if [ -d "docs/docs/_build" ] && [ -f "docs/docs/_build/index.html" ]; then
echo "✓ Documentation built successfully"
echo "Found HTML files:"
find docs/docs/_build -maxdepth 1 -name "*.html" | head -5
echo "Build directory structure:"
ls -la docs/docs/_build/ | head -10
else
echo "✗ Documentation build failed"
echo "Checking build directory:"
ls -la docs/docs/_build/ 2>&1 || echo "Build directory does not exist"
exit 1
fi

- name: Upload documentation artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/docs/_build
retention-days: 7
23 changes: 21 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Read the Docs configuration for OrthoEvolution
# https://docs.readthedocs.io/en/stable/config-file/v2.html

version: 2

build:
image: latest
os: ubuntu-22.04
# Pre-build job: Run update_docs.py to regenerate API docs and convert READMEs
# This runs before Sphinx builds the documentation
commands:
- python docs/update_docs.py --skip-build

python:
version: 3.6
setup_py_install: true
version: 3.9
install:
- method: pip
path: .
- method: pip
# Install documentation dependencies
pip_install:
- sphinx
- pypandoc

# Sphinx will be auto-detected from docs/docs/source/conf.py
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0b2] - 2025-12-02

### Added
- Comprehensive test suites for `utilities`, `Manager`, and `Tools` modules
- Added 20+ test methods for `BlastUtils`, `GenbankUtils`, `OrthologUtils`, `ManagerUtils`, `PackageVersion`, and `FullUtilities` classes
- Added 16 test methods for `Management`, `RepoManagement`, `UserManagement`, `WebsiteManagement`, `ProjectManagement`, and `BaseDatabaseManagement` classes
- Added 5 test methods for `LogIt`, `PyBasher`, `NcbiFTPClient`, and `Multiprocess` classes
- Total of ~705 lines of new test code across three test files
- Docstrings added to Orthologs module

### Fixed
- Fixed typo in `FullUtilities.__init__()`: `Ortho0logUtils` → `OrthologUtils` (resolves `AttributeError`)
- Fixed missing docstrings across codebase
- Fixed various test issues and code coverage gaps

### Changed
- Updated Python version requirements and examples
- Refactored code structure (#177)
- Moved templates to `.github` directory
- Updated Python tasks configuration

## [1.0.0b1] - Development

### Added
- Test infrastructure improvements and codecov integration
- GitHub Actions CI/CD pipeline replacing Travis CI
- pytest configuration and test suite expansion
- Test GPCR dataset for testing
- PyBasher commands for bash operations
- Tarfile member sanitization for security (#173)

### Changed
- Removed Travis CI in favor of GitHub Actions
- Updated Python version support (3.9, 3.10, 3.11)
- Upgraded Biopython version
- Bumped dependencies: tqdm (4.25.0 → 4.66.3), jinja2, werkzeug, sqlalchemy

### Fixed
- Fixed tarfile member sanitization in extractall() (#173)
- Fixed various test failures and code coverage issues
- Fixed requirements.txt security vulnerabilities (#179, #175, #176, #170, #169, #168)
- Fixed Cookies tests and Oven/CookBook text issues
- Fixed log level color formatting
- Fixed Flask version requirements and psutil requirement

## [0.9.0a2] - Previous Release

### Added
- Initial test suite
- Basic CI/CD setup

### Changed
- Package structure and organization

---

## Version History Notes

- **1.0.0b2**: Latest release (2025-12-02) - Test coverage improvements and bug fixes
- **1.0.0b1**: Previous beta release - Test infrastructure and CI/CD improvements
- **0.9.0a2**: Previous tagged release (alpha)
93 changes: 89 additions & 4 deletions OrthoEvol/Cookies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,105 @@ to set up your directory if you intend to create a web app/interface for your pr

Learn more about the [cookiecutter](https://github.com/audreyr/cookiecutter) package.

## Examples
## Overview

The Cookies module provides two main classes:

- **CookBook**: Manages cookiecutter template paths and configurations
- **Oven**: Deploys cookiecutter templates to create directory structures

The [Manager module](https://github.com/datasnakes/OrthoEvolution/tree/master/OrthoEvol/Manager)
uses the _CookBook_ and _Oven_ classes as a primary means of functioning.

### A Simple Implementation
## Available Templates

* Templates used when creating a full repository:
* `new_repository` - Creates a full repository structure
* `new_user` - Creates a user directory structure
* `new_project` - Creates a project directory structure
* `new_research` - Creates a research directory structure
* `new_database_repo` - Creates database repository structure
* `new_app` - Creates R-Shiny application structure
* `new_website` - Creates Flask website structure

* Template for standalone projects:
* `new_basic_project` - Creates a basic standalone project structure

## Examples

### Simple Implementation

```python
from OrthoEvol.Cookies import Oven

# Create an Oven instance
Kitchen = Oven(repo="repo", user="username", project="project-name",
output_dir="path/to/project")

# Access ingredients (parameters)
Pantry = Kitchen.Ingredients

# To create a user directory
Kitchen.bake_the_user()
# Create different directory structures
Kitchen.bake_the_repo() # Create repository
Kitchen.bake_the_user() # Create user directory
Kitchen.bake_the_project() # Create project directory
```

### Full Repository Setup

```python
from OrthoEvol.Cookies import Oven
from pathlib import Path
import os

# Set up paths and names
home = os.getcwd()
repo = "Development"
user = "username"
project = "MyProject"
research = "GPCR"
research_type = "comparative_genetics"

# Create paths
repo_path = Path(home) / Path(repo)
user_path = repo_path / Path('users')
project_path = user_path / Path(user) / Path('projects')
research_path = project_path / Path(project)

# Initialize Oven for full repository
Full_Kitchen = Oven(repo=repo, user=user, project=project,
basic_project=False, output_dir=home)

# Create the full structure
Full_Kitchen.bake_the_repo()
Full_Kitchen.bake_the_user(cookie_jar=user_path)
Full_Kitchen.bake_the_project(cookie_jar=project_path)
Full_Kitchen.bake_the_research(research=research,
research_type=research_type,
cookie_jar=research_path)
```

### Basic Standalone Project

```python
from OrthoEvol.Cookies import Oven

# Initialize Oven for basic project
Basic_Kitchen = Oven(project="MyProject", basic_project=True,
output_dir=os.getcwd())

# Create the basic project
Basic_Kitchen.bake_the_project()
```

### Available Methods

The `Oven` class provides the following methods:

- `bake_the_repo(cookie_jar=None)` - Create a repository structure
- `bake_the_user(cookie_jar=None)` - Create a user directory structure
- `bake_the_project(cookie_jar=None)` - Create a project directory structure
- `bake_the_research(research_type, research, cookie_jar=None)` - Create a research directory
- `bake_the_db_repo(db_config_file, db_path, cookie_jar=None, archive_flag=False, delete=False)` - Create database repository
- `bake_the_website(host, port, website_path, cookie_jar=None)` - Create a Flask website
- `bake_the_app(app, cookie_jar=None)` - Create an R-Shiny app structure
Loading