Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[bumpversion]
current_version = 0.1.0
commit = False
tag = False


[bumpversion:file:README.md]

[bumpversion:file:src/TRIPs/__init__.py]

[bumpversion:file:tests/__init__.py]

[bumpversion:file:pyproject.toml]

19 changes: 19 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: '9030931'
_src_path: git@tanuki-data.pnnl.gov:ciemss/ceda-project-copier.git
author: Jeremy Zucker
copyright_date: '2025'
copyright_holder: Jeremy Zucker
coverage: true
deptry: true
email: Jeremy.Zucker@pnnl.gov
include_gitlab_ci: true
mkdocs: true
namespace: jeremy.zucker
open_source_license: MIT License
package_manager: uv
project_description: This repo contains code for pre-processing, cycle analysis, promoter
distance analysis, and trip analysis for bacterium.
project_name: TRIPs
project_slug: TRIPs
type_checker: mypy
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*]
max_line_length = 88

[*.md]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
147 changes: 147 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@

# MkDocs documentation
docs/source
public/


# SLURM logs
logs/

# Based on https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore

# 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/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# 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
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

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

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

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

# basedpyright/pyright
.pyright_cache/
pyrightconfig.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Vscode config files
.vscode/

# Exclude .DS_Store files from being added
.DS_Store
118 changes: 118 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
stages:
- quality
- test
- docs
- deploy

variables:
PRE_COMMIT_KEY: pre-commit-$CI_COMMIT_REF_SLUG
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.cache/pre-commit
UV_CACHE_DIR: .uv-cache
UV_VERSION: 0.6
PYTHON_VERSION: 3.12 # Default Python version; others are tested in the test job
BASE_LAYER: bookworm

default:

cache: &global_cache
key:
files:
- uv.lock
paths:
- $UV_CACHE_DIR
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
before_script:
- uv sync --frozen # Environment syncing common to all jobs
after_script:
- uv cache prune --ci # Cache pruning common to all jobs


# Default trigger rules: push to default branch or merge request. Do not trigger on
# tags.
.default_rules: &default_rules
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_TAG
when: never

# Testing trigger rules: to avoid unnecessary testing on simple changes to the default
# branch (e.g. fixing typos in documentation), we only test on the default branch if the
# changes are made to package files or testing files
.testing_rules: &testing_rules
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "merge_request_event"
changes:
- pyproject.toml
- uv.lock

- "src/TRIPs/**/*"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_TAG
when: never

# Trigger rules for semantic version tags of the type (v)x(.x)(.x) used for deployment
.tag_rules: &tag_rules
- if: $CI_COMMIT_TAG =~ /^v?(\d+\.)?(\d+\.)?(\*|\d+)$/

quality:
cache:
<<: *global_cache # Inherit global cache settings
key: $PRE_COMMIT_KEY
paths:
- .cache/pre-commit
stage: quality
rules: *default_rules
script:

- uvx --from go-task-bin task check



mypy:
stage: test
rules: *testing_rules
script:

- uvx --from go-task-bin task mypy

allow_failure: true




test:
stage: test
rules: *testing_rules

parallel:
matrix:
- PYTHON_VERSION: ["3.10", "3.11", "3.12", "3.13"]
script:
- uvx --from go-task-bin task test


coverage: /TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml



docs:
stage: docs
rules: *default_rules
script:

- uvx --from go-task-bin task docs


deploy-pages:
stage: deploy
rules: *tag_rules
script:

- uvx --from go-task-bin task docs

pages: true

14 changes: 14 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://github.com/gitleaks/gitleaks?tab=readme-ov-file#configuration

[extend]
useDefault = true

[[rules]]
id = "SLURM account"
description = "SLURM account"
regex = '''#SBATCH --account=(\w+)'''

[[rules]]
id = "SLURM email"
description = "SLURM email"
regex = '''#SBATCH --mail-user=(\w+)'''
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.0
hooks:
- id: ruff
args: [--exit-non-zero-on-fix, --config=pyproject.toml]
- id: ruff-format
args: [--config=pyproject.toml]

- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.0
hooks:
- id: gitleaks
Loading