Skip to content

Commit 83d8860

Browse files
authored
publish to Pypi (#260)
* drop libsqlite pin (pks seems fixed) * updates to CI/CD * drop the venv * fix norns: pkg_resources * test pip and conda installs * fix conda action * fix pip action
1 parent 5a9b906 commit 83d8860

File tree

5 files changed

+146
-10
lines changed

5 files changed

+146
-10
lines changed

.github/workflows/ci-cd.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: CI/CD
2+
on:
3+
push:
4+
branches: [ "master", "develop" ]
5+
pull_request:
6+
branches: [ "master", "develop" ]
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
jobs:
11+
ci_pip:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
shell: bash -l {0}
16+
17+
steps:
18+
19+
- name: Cleanup build folder 🧹
20+
run: |
21+
ls -la ./
22+
rm -rf ./* || true
23+
rm -rf ./.??* || true
24+
ls -la ./
25+
26+
- name: Setup Python 3.12 🐍
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: 3.12
30+
31+
- name: Setup backend 🏗️
32+
run: |
33+
pip install uv
34+
uv pip install --system hatch pytest pytest-rerunfailures autoflake==1.7 isort==6.0 black==25.1
35+
36+
- name: Checkout 🛎️
37+
uses: actions/checkout@v4
38+
39+
# Builds a wheel needed for the CD
40+
- name: Build wheel 🎡
41+
run: hatch build -t wheel
42+
43+
# Store the wheel in GitHub Actions
44+
- name: Upload artifact ❄️
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: genomepy_wheel
48+
path: dist/
49+
50+
# Test if the created wheel can be installed
51+
- name: Install 🛠️
52+
run: uv pip install --system dist/*.whl --force-reinstall
53+
54+
- name: Unit tests 📜
55+
run: pytest -vvv --reruns 1 --reruns-delay 10 tests/test_01_basic.py
56+
57+
- name: Integration tests 📚
58+
run: |
59+
genomepy --help
60+
genomepy annotation --help
61+
genomepy install --help
62+
genomepy search --help
63+
64+
ci_conda:
65+
runs-on: ubuntu-latest
66+
defaults:
67+
run:
68+
shell: bash -l {0}
69+
70+
steps:
71+
72+
- name: Cleanup build folder 🧹
73+
run: |
74+
ls -la ./
75+
rm -rf ./* || true
76+
rm -rf ./.??* || true
77+
ls -la ./
78+
79+
- name: Checkout 🛎️
80+
uses: actions/checkout@v4
81+
82+
- name: Setup backend 🏗️
83+
uses: conda-incubator/setup-miniconda@v3
84+
with:
85+
environment-file: environment.yml
86+
miniforge-version: latest
87+
88+
- name: Install 🛠️
89+
run: pip install . --no-deps --ignore-installed
90+
91+
- name: Unit tests 📜
92+
run: pytest -vvv --reruns 1 --reruns-delay 10 tests/test_01_basic.py
93+
94+
- name: Integration tests 📚
95+
run: |
96+
genomepy --help
97+
genomepy annotation --help
98+
genomepy install --help
99+
genomepy search --help
100+
101+
cd:
102+
needs: ci_pip
103+
runs-on: ubuntu-latest
104+
# Only run this job if new work is pushed to "master"
105+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
106+
# # Only run this job on a tagged commit
107+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
108+
109+
steps:
110+
111+
- name: Cleanup build folder 🧹
112+
run: |
113+
ls -la ./
114+
rm -rf ./* || true
115+
rm -rf ./.??* || true
116+
ls -la ./
117+
118+
- name: Setup Python 3.12 🐍
119+
uses: actions/setup-python@v5
120+
with:
121+
python-version: 3.12
122+
123+
- run: mkdir -p dist
124+
125+
- name: Download artifact ❄️
126+
uses: actions/download-artifact@v4
127+
with:
128+
name: genomepy_wheel
129+
path: dist/
130+
131+
- name: Publish to PyPI 🚀
132+
uses: pypa/gh-action-pypi-publish@release/v1
133+
with:
134+
user: __token__
135+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: Build and Deploy
1+
name: Documentation
22
on:
33
push:
4-
branches:
5-
- master
6-
- docs # backdoor branch to update docs
4+
branches: [ "master" ]
5+
# Allows you to run this workflow manually from the Actions tab
6+
workflow_dispatch:
77

88
jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout 🛎️
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Install & Build 📜
1616
run: |

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ env:
1717

1818
before_install:
1919
# setup mambaforge
20-
- wget -q -O Mambaforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
21-
- bash Mambaforge.sh -b -p "${HOME}/conda" > /dev/null
20+
- wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
21+
- bash Miniforge3.sh -b -p "${HOME}/conda" > /dev/null
2222
- source "${HOME}/conda/etc/profile.d/conda.sh"
2323
- source "${HOME}/conda/etc/profile.d/mamba.sh"
2424
- mamba activate

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
- click
1111
- colorama
1212
- filelock >=3.5
13-
- libsqlite <3.49 # v3.49.1: no column "size" (this is a diskcache requirement)
13+
# - libsqlite <3.49 # v3.49.1: no column "size" (this is a diskcache requirement)
1414
- loguru
1515
- mygene
1616
- mysql <=8.4 # 9.3: 'mysql_native_password' cannot be loaded
@@ -49,8 +49,8 @@ dependencies:
4949
# Testing
5050
- autoflake =1.7
5151
- black =25.1
52-
- flake8 =4.0
53-
- flake8-bugbear =23.3
52+
# - flake8 =4.0
53+
# - flake8-bugbear =23.3
5454
# - flakeheaven # v3.3.0 does not work with python 3.12
5555
- isort =6.0
5656
- pytest

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies = [
2424
"mygene",
2525
"mysql-connector-python",
2626
"norns >=0.1.6",
27+
"setuptools; python_version >= '3.12'", # norns uses pkg_resources
2728
"numpy",
2829
"pandas",
2930
"pyfaidx >=0.7.2.1",

0 commit comments

Comments
 (0)