Skip to content

Commit 6377f77

Browse files
committed
First commit
0 parents  commit 6377f77

File tree

15 files changed

+1185
-0
lines changed

15 files changed

+1185
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @clintval
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Code checks
2+
3+
on: [push]
4+
5+
env:
6+
POETRY_VERSION: 1.8.2
7+
8+
jobs:
9+
Tests:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
PYTHON_VERSION: ["3.11", "3.12"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python ${{ matrix.PYTHON_VERSION }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.PYTHON_VERSION }}
21+
22+
- name: Get full Python version
23+
id: full-python-version
24+
shell: bash
25+
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT
26+
27+
- name: Install poetry
28+
run: |
29+
python -m pip install --upgrade pipx
30+
pipx install poetry==${{env.POETRY_VERSION}}
31+
32+
- name: Set up cache
33+
uses: actions/cache@v4
34+
id: cache
35+
with:
36+
path: .venv
37+
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
38+
39+
- name: Ensure cache is healthy
40+
if: steps.cache.outputs.cache-hit == 'true'
41+
shell: bash
42+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
43+
44+
- name: Install the library
45+
run: poetry install -v
46+
47+
- name: Install the task runner poethepoet
48+
run: poetry self add 'poethepoet[poetry_plugin]'
49+
50+
- name: Test the library
51+
run: poetry task check-all
52+

.gitignore

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
.vscode/
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# poetry
99+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100+
# This is especially recommended for binary packages to ensure reproducibility, and is more
101+
# commonly ignored for libraries.
102+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103+
#poetry.lock
104+
105+
# pdm
106+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107+
#pdm.lock
108+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109+
# in version control.
110+
# https://pdm.fming.dev/#use-with-ide
111+
.pdm.toml
112+
113+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114+
__pypackages__/
115+
116+
# Celery stuff
117+
celerybeat-schedule
118+
celerybeat.pid
119+
120+
# SageMath parsed files
121+
*.sage.py
122+
123+
# Environments
124+
.env
125+
.venv
126+
venv/
127+
env.bak/
128+
venv.bak/
129+
130+
# Spyder project settings
131+
.spyderproject
132+
.spyproject
133+
134+
# Rope project settings
135+
.ropeproject
136+
137+
# mkdocs documentation
138+
/site
139+
140+
# mypy
141+
.mypy_cache/
142+
.dmypy.json
143+
dmypy.json
144+
145+
# Pyre type checker
146+
.pyre/
147+
148+
# pytype static type analyzer
149+
.pytype/
150+
151+
# Cython debug symbols
152+
cython_debug/
153+
154+
# PyCharm
155+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
156+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
157+
# and can be added to the global gitignore or merged into this file. For a more nuclear
158+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
159+
.idea/

CONTRIBUTING.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Development and Testing
2+
3+
## Primary Development Commands
4+
5+
To check and resolve linting issues in the codebase, run:
6+
7+
```console
8+
poetry run ruff check --fix
9+
```
10+
11+
To check and resolve formatting issues in the codebase, run:
12+
13+
```console
14+
poetry run ruff format
15+
```
16+
17+
To check the unit tests in the codebase, run:
18+
19+
```console
20+
poetry run pytest
21+
```
22+
23+
To check the typing in the codebase, run:
24+
25+
```console
26+
poetry run mypy
27+
```
28+
29+
To generate a code coverage report after testing locally, run:
30+
31+
```console
32+
poetry run coverage html
33+
```
34+
35+
To check the lock file is up to date:
36+
37+
```console
38+
poetry check --lock
39+
```
40+
41+
## Shortcut Task Commands
42+
43+
To be able to run shortcut task commands, first install the Poetry plugin [`poethepoet`](https://poethepoet.natn.io/index.html):
44+
45+
```console
46+
poetry self add 'poethepoet[poetry_plugin]'
47+
```
48+
49+
> [!NOTE]
50+
> Upon the release of Poetry [v2.0.0](https://github.com/orgs/python-poetry/discussions/9793#discussioncomment-11043205), Poetry will automatically support bootstrap installation of [project-specific plugins](https://github.com/python-poetry/poetry/pull/9547) and installation of the task runner will become automatic for this project.
51+
> The `pyproject.toml` syntax will be:
52+
>
53+
> ```toml
54+
> [tool.poetry]
55+
> requires-poetry = ">=2.0"
56+
>
57+
> [tool.poetry.requires-plugins]
58+
> poethepoet = ">=0.29"
59+
> ```
60+
61+
###### For Running Individual Checks
62+
63+
```console
64+
poetry task check-lock
65+
poetry task check-format
66+
poetry task check-lint
67+
poetry task check-tests
68+
poetry task check-typing
69+
```
70+
71+
###### For Running All Checks
72+
73+
```console
74+
poetry task check-all
75+
```
76+
77+
###### For Running Individual Fixes
78+
79+
```console
80+
poetry task fix-format
81+
poetry task fix-lint
82+
```
83+
84+
###### For Running All Fixes
85+
86+
```console
87+
poetry task fix-all
88+
```
89+
90+
###### For Running All Fixes and Checks
91+
92+
```console
93+
poetry task fix-and-check-all
94+
```

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright © 2024 Fulcrum Genomics LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# seshatio
2+
3+
[![CI](https://github.com/clintval/seshatio/actions/workflows/python_package.yml/badge.svg?branch=main)](https://github.com/clintval/seshatio/actions/workflows/python_package.yml?query=branch%3Amain)
4+
[![Python Versions](https://img.shields.io/badge/python-3.11_|_3.12-blue)](https://github.com/clintval/seshatio)
5+
[![MyPy Checked](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
6+
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
7+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://docs.astral.sh/ruff/)
8+
9+
A toTools for programatically annotating VCFs with the Seshat TP53 database.
10+
11+
## Recommended Installation
12+
13+
Install the Python package and dependency management tool [`poetry`](https://python-poetry.org/docs/#installation) using official documentation.
14+
You must have Python 3.11 or greater available on your system path, which could be managed by [`mamba`](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html), [`pyenv`](https://github.com/pyenv/pyenv), or another package manager.
15+
Finally, install the dependencies of the project with:
16+
17+
```console
18+
poetry install
19+
```
20+
21+
To check successful installation, run:
22+
23+
```console
24+
poetry run seshatio hello --name Fulcrum
25+
```
26+
27+
## Installing into a Mamba Environment
28+
29+
Install the Python package and dependency management tool [`poetry`](https://python-poetry.org/docs/#installation) and the environment manager [`mamba`](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) using official documentation.
30+
Create and activate a virtual environment with Python 3.11 or greater:
31+
32+
```console
33+
mamba create -n seshatio python=3.11
34+
mamba activate seshatio
35+
```
36+
37+
Then, because Poetry will auto-detect an activated environment, install the project with:
38+
39+
```console
40+
poetry install
41+
```
42+
43+
To check successful installation, run:
44+
45+
```console
46+
seshatio hello --name Fulcrum
47+
```
48+
49+
## Development and Testing
50+
51+
See the [contributing guide](./CONTRIBUTING.md) for more information.

0 commit comments

Comments
 (0)