Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package with Hatch #27

Merged
merged 11 commits into from
Oct 31, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .devcontainer/Dockerfile

This file was deleted.

33 changes: 0 additions & 33 deletions .devcontainer/devcontainer.json

This file was deleted.

3 changes: 0 additions & 3 deletions .devcontainer/noop.txt

This file was deleted.

38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to PyPI

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Check out the code
uses: actions/checkout@v4

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

- name: Install Hatch
run: pip install hatch

- name: Build the package with Hatch
run: hatch build

- name: Publish to PyPI
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.TELOCLIP_PYPI_TOKEN }}
run: hatch publish
47 changes: 47 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Python Tests

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
# Checkout the latest commit associated with the PR
- uses: actions/checkout@v4

- name: Debug matrix value
run: echo "Python version is ${{ matrix.python-version }}"

# Set up Miniconda
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true # Optional: update Conda to the latest version
python-version: ${{ matrix.python-version }}

# Create and activate the Conda environment using the environment.yml file
- name: Create and activate Conda environment
run: |
conda env create -f environment.yml -n test-env
conda activate test-env
shell: bash -l {0} # Use bash with the login shell to activate Conda

# Install any additional dependencies not listed in environment.yml
- name: Install additional dependencies
run: |
conda activate test-env
pip install '.[tests]' # Install all dependencies, including test-specific ones
shell: bash -l {0}

# Run pytest on the specified directory
- name: Run tests
run: |
conda activate test-env
pytest tests
shell: bash -l {0}

23 changes: 23 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Ruff Formatting
on: [pull_request]
jobs:
ruff:
if: ${{ github.actor != 'dependabot[bot]' }} # Do not run on commits created by dependabot
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files.
contents: write # Allows reading and writing repository contents (e.g., commits)
pull-requests: write # Allows reading and writing pull requests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: chartboost/ruff-action@v1
with:
src: './src/teloclip'
args: 'format --target-version py310'
- uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
with:
commit_message: 'Style fixes by Ruff'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Package notes
pkg-mgt/

# Mac stuff
.DS_Store

# Versioning
src/teloclip/_version.py

Expand Down
20 changes: 12 additions & 8 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Use the Gitpod base image for Python 3.10
FROM gitpod/workspace-python-3.12
# Image source code: https://github.com/axonasif/workspace-images/tree/tmp
# Also see https://github.com/gitpod-io/workspace-images/issues/1071
FROM axonasif/workspace-base@sha256:8c057b1d13bdfe8c279c68aef8242d32110c8d5310f9a393f9c0417bc61367d9

# Set user
USER gitpod

# Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p $HOME/miniconda && \
rm ~/miniconda.sh

# Add Miniconda to PATH
ENV PATH="$HOME/miniconda/bin:$PATH"

ENV PYTHONPATH="$HOME/miniconda/bin"

# Initialize conda in bash config fiiles:
# Initialize conda in bash config files:
RUN conda init bash

# Set up Conda channels
Expand All @@ -25,5 +24,10 @@ RUN conda config --add channels conda-forge && \
# Set libmamba as solver
RUN conda config --set solver libmamba

# Remove the undesired location from PATH
RUN export PATH=$(echo $PATH | tr ':' '\n' | grep -v '/home/gitpod/.pyenv/shims' | tr '\n' ':')
# Persist ~/ (HOME) and lib
RUN echo 'create-overlay $HOME /lib' > "$HOME/.runonce/1-home-lib_persist"

# Referenced in `.vscode/settings.json`
ENV PYTHON_INTERPRETER="$HOME/miniconda/bin/python"
# Pycharm recognizes this variables
ENV PYCHARM_PYTHON_PATH="${PYTHON_INTERPRETER}"
8 changes: 1 addition & 7 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ tasks:
conda env update -n base --file environment.yml
# Run on every workspace start
command: |
echo 'Installing requirements.txt'
pip3 install -r requirements.txt
echo 'Installing teloclip in interactive mode.'
#pip3 install --upgrade setuptools-scm
python setup.py --version
pip3 install -e .
#python3 -m pip install --upgrade build && python3 -m build
pip3 install -e ".[tests]"
echo 'Finished!'

vscode:
Expand All @@ -25,4 +20,3 @@ vscode:
- ms-toolsai.jupyter
- ms-toolsai.jupyter-keymap
- oderwat.indent-rainbow
- ms-python.black-formatter
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<br clear="left"/>

<p align="center">
<img src="https://github.com/Adamtaranto/teloclip/blob/2d9628d453e832ac0de15577c6cdde6835fb6417/docs/teloclip_hexlogo.jpg?raw=true" width="180px" title="teloclip_hex"/>
<img src="https://raw.githubusercontent.com/Adamtaranto/teloclip/main/docs/teloclip_hexlogo.jpg" width="180" height="180" title="teloclip_hex" />
</p>

<h1>Teloclip</h1>
Expand Down Expand Up @@ -103,7 +103,10 @@ Alternatively, [launch a Gitpod Workspace](https://gitpod.io/#https://github.com
## Example Usage

Basic use case:
![teloclip_example](docs/teloclip_example_graphic.png)

<p align="center">
<img src="https://raw.githubusercontent.com/Adamtaranto/teloclip/main/docs/teloclip_example_graphic.png" title="teloclip_example" />
</p>

**First index the reference assembly**

Expand Down Expand Up @@ -337,6 +340,4 @@ Submit feedback to the [Issue Tracker](https://github.com/Adamtaranto/teloclip/i

## License

Software provided under MIT license.

Teloclip hex-sticker was designed by [@Super_Coleider](www.instagram.com/Super_Coleider).
Software provided under MIT license.
7 changes: 2 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: teloclip-dev
name: teloclip
channels:
- conda-forge
- bioconda
- defaults
- nanoporetech # Has minimap and samtools for Apple Silicon
dependencies:
- python >=3.12
- minimap2
Expand All @@ -15,5 +13,4 @@ dependencies:
#- regex
#- pysam
- pytest
- build
- twine
- hatch
Loading
Loading