Skip to content

Commit 1a1f227

Browse files
authored
Merge pull request #19 from js2264/PEP621_compliant
2 parents 55fef37 + 72d81d5 commit 1a1f227

43 files changed

Lines changed: 610 additions & 599 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
*
22
Dockerfile*
33
.dockerignore
4-
!metator/*
5-
!setup.py
6-
!setup.cfg
4+
!src/*
5+
!external/*
76
!metator.yaml
8-
!requirements.txt
7+
!pyproject.toml
98
!MANIFEST.in
109
!README.md
11-
!external

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test and Doc
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
defaults:
8+
run:
9+
shell: bash -l {0}
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
Test:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest]
20+
python-version: [ "3.9", "3.10", "3.11" ]
21+
include:
22+
- os: ubuntu-latest
23+
# - os: windows-latest
24+
# - os: macos-latest
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
29+
- uses: actions/checkout@v4
30+
31+
- name: 🛠️ Install Python ${{ matrix.python-version }} and deps with micromamba
32+
uses: mamba-org/setup-micromamba@v1
33+
with:
34+
environment-file: metator.yaml
35+
init-shell: bash
36+
cache-environment: false
37+
post-cleanup: 'none'
38+
generate-run-shell: true
39+
create-args: >-
40+
python=${{ matrix.python-version }}
41+
42+
- name: 📦 Install package
43+
run: |
44+
pip install .[test]
45+
shell: micromamba-shell {0}
46+
47+
- name: 🧪 Run tests with Python ${{ matrix.python-version }}
48+
run: |
49+
ruff check . --select=E9,F63,F7,F82
50+
pytest --cov --cov-report=xml
51+
shell: micromamba-shell {0}

.github/workflows/pypi-publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ name: Upload Python Package on PyPI
55
on:
66
release:
77
types: [created]
8-
branches: [master]
98

109
jobs:
1110
deploy:
1211

1312
runs-on: ubuntu-latest
1413

1514
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python 3.8
18-
uses: actions/setup-python@v2
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.10
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.8'
20+
python-version: '3.10'
2121

2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25-
pip install setuptools wheel twine
25+
pip install hatch
2626
2727
- name: Build and publish
2828
env:
2929
TWINE_USERNAME: __token__
3030
TWINE_PASSWORD: ${{secrets.PYPI_TOKEN}}
3131
run: |
32-
python setup.py sdist bdist_wheel
33-
twine upload dist/*
32+
hatch build
33+
twine upload dist/*

.github/workflows/python-package.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ wheels/
3535
.installed.cfg
3636
*.egg
3737
MANIFEST
38+
metator.code-workspace
3839

3940
# PyInstaller
4041
# Usually these files are written by a python script from a template
@@ -133,6 +134,9 @@ venv.bak/
133134
dmypy.json
134135
nf-metator.sif
135136

136-
# Louvain and Leiden installation
137-
external/gen-louvain/
138-
networkanalysis
137+
# Artifacts installation
138+
artifacts/
139+
gen-louvain/
140+
networkanalysis/
141+
pairix/
142+
bowtie2/

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/psf/black
9+
rev: 22.3.0
10+
hooks:
11+
- id: black
12+
args: ['--config=./pyproject.toml']
13+
- repo: https://github.com/charliermarsh/ruff-pre-commit
14+
rev: v0.6.9
15+
hooks:
16+
- id: ruff

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33

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

6+
## [1.3.4] - 2025-02-19
7+
- Package now relies on `pyproject.toml` for build configuration with `hatch`.
8+
- Binaries for `louvain` and `leiden` clustering algorithms are now embedded in the package.
9+
- Uses pre-commit hooks for code formatting and linting.
10+
- Fix deprecated Bio.SeqUtils.GC to Bio.SeqUtils.gc_fraction.
11+
- `Biopython` is pinned <= 1.80 to work with `micomplete 1.1.1`.
12+
613
## [1.3.3] - 2023-11-27
714
- Improve ci.
815
- Add pairix as requirements.

Dockerfile

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,21 @@
1-
# syntax=docker/dockerfile:1
2-
31
FROM mambaorg/micromamba:latest
42

5-
LABEL Name=metator Version=1.3.3
3+
LABEL Name=metator Version=1.3.4
64

75
COPY --chown=$MAMBA_USER:$MAMBA_USER . ./
86

97
# Install 3rd party packages
108
USER root
119
RUN apt update && \
12-
apt install -y --no-install-recommends git make g++ curl default-jre default-jdk zlib1g-dev
13-
14-
# Install Louvain
15-
RUN cd ./external && \
16-
tar -xzf louvain-generic.tar.gz && \
17-
cd gen-louvain && \
18-
make && \
19-
cd ../
20-
ENV LOUVAIN_PATH=./external/gen-louvain
21-
22-
# Install Leiden through Network analysis repo
23-
RUN git clone https://github.com/vtraag/networkanalysis.git && \
24-
cd ./networkanalysis && \
25-
./gradlew build && \
26-
cd ../
27-
ENV LEIDEN_PATH=$(pwd)/networkanalysis/build/libs/networkanalysis-1.2.0.jar
10+
apt install -y --no-install-recommends git make g++ curl default-jre default-jdk zlib1g-dev unzip
2811

29-
## Install dependencies
12+
# ## Install dependencies
3013
USER mambauser
3114
RUN micromamba install -y -n base --file metator.yaml && \
32-
micromamba install -y -n base pip && \
3315
micromamba clean --all --yes
3416

3517
# Install metator
36-
RUN micromamba run -n base python3 -m pip install -e .
18+
RUN micromamba run -n base pip install -e .[dev]
3719

3820
WORKDIR /home/mambauser/
3921
ENTRYPOINT [ "/bin/bash" ]

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include requirements.txt
21
include README.md
2+
include external/artifacts/*
33
recursive-exclude test_data *
44
recursive-exclude tests *

0 commit comments

Comments
 (0)