Skip to content

Commit

Permalink
add build system (#117)
Browse files Browse the repository at this point in the history
* update path to readme image

* remove __pycache__

* move codebase version to src/refactor

* move dnadiffusion to src

* remove pre-commit

* will lint with actions / ruff

* lint with ruff

* add hatch build

* add mock cli

* add stub tests

* add workflow to build and test

* add build instructions to README
  • Loading branch information
cameronraysmith authored Mar 23, 2023
1 parent 1413ec9 commit 11253c6
Show file tree
Hide file tree
Showing 105 changed files with 48,826 additions and 48,795 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on:
workflow_dispatch:
push:
pull_request:

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python_version: ['3.10']

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
hatch env create
- name: Lint and typecheck
run: |
hatch run lint-check
- name: Test
run: |
hatch run test-cov-xml
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
36 changes: 0 additions & 36 deletions .github/workflows/ci.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .pre-commit-config.yaml

This file was deleted.

64 changes: 62 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Understanding the code of life: generative models of regulatory DNA sequences based on diffusion models.
# DNA Diffusion

<img src='https://github.com/pinellolab/DNA-Diffusion/raw/1413ec9c974d54a1e2885a250540dc89955d10c0/docs/images/diff_first.gif'> </img>

<p align="center">
<em>Generative modeling of regulatory DNA sequences with diffusion probabilistic models.</em>
</p>

[![build](https://github.com/pinellolab/DNA-Diffusion/workflows/Build/badge.svg)](https://github.com/pinellolab/DNA-Diffusion/actions)
[![codecov](https://codecov.io/gh/pinellolab/DNA-Diffusion/branch/main/graph/badge.svg)](https://codecov.io/gh/pinellolab/DNA-Diffusion)
[![PyPI version](https://badge.fury.io/py/dnadiffusion.svg?kill_cache=1)](https://badge.fury.io/py/dnadiffusion)

---

**Documentation**: <a href="https://pinellolab.github.io/DNA-Diffusion" target="_blank">https://pinellolab.github.io/DNA-Diffusion</a>

**Source Code**: <a href="https://github.com/pinellolab/DNA-Diffusion" target="_blank">https://github.com/pinellolab/DNA-Diffusion</a>

---


<img src='https://raw.githubusercontent.com/pinellolab/DNA-Diffusion/f028558816fe5832097c270f424e3b3c3db48d8d/diff_first.gif'> </img>

## Abstract

Expand Down Expand Up @@ -164,3 +182,45 @@ Join the OpenBioML discord: https://discord.gg/Y9CN2dUzQJ, we are discussing thi
## Known contributors

You can access the contributor list [here](https://docs.google.com/spreadsheets/d/1_nxDI6DIoWbyUDpIDX-tJIILejrJ0kEYrcXXdWlzPvU/edit#gid=1871728801).

## Development

### Setup environment

We use [hatch](https://hatch.pypa.io/latest/install/) to manage the development environment and production build. It is often convenient to install hatch with [pipx](https://pypa.github.io/pipx/installation/).

### Run unit tests

You can run all the tests with:

```bash
hatch run test
```

### Format the code

Execute the following command to apply linting and check typing:

```bash
hatch run lint
```

### Publish a new version

You can check the current version with:

```bash
hatch version
```

You can bump the version with commands such as `hatch version dev` or `patch`, `minor` or `major`. Or edit the `src/dnadiffusion/__about__.py` file. After changing the version, when you push to github, the Test Release workflow will automatically publish it on Test-PyPI and a github release will be created as a draft.

## Serve the documentation

You can serve the mkdocs documentation with:

```bash
hatch run docs-serve
```

This will automatically watch for changes in your code.
Loading

0 comments on commit 11253c6

Please sign in to comment.