Skip to content

Commit 8781647

Browse files
authored
8 add pipeline (#9)
2 parents 8e82b4e + 1c14283 commit 8781647

File tree

9 files changed

+155
-191
lines changed

9 files changed

+155
-191
lines changed

.github/workflows/actions.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Installing and Testing
2+
on: [push]
3+
4+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
5+
# `contents` is for permission to the contents of the repository.
6+
# `pull-requests` is for permission to pull request
7+
permissions:
8+
contents: write
9+
checks: write
10+
pull-requests: write
11+
12+
env:
13+
UV_SYSTEM_PYTHON: true
14+
15+
jobs:
16+
install-and-test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python_version: ["3.9", "3.10", "3.11", "3.12"]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Python ${{matrix.python_version}}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{matrix.python_version}}
28+
- name: Install uv
29+
run: |
30+
curl -LsSf https://astral.sh/uv/install.sh | sh
31+
- name: Install dependencies
32+
run: |
33+
pip install --upgrade pip
34+
uv pip install -e '.[dev]'
35+
- name: mypy
36+
run: |
37+
python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional --exclude dependencies bam_data_store tests
38+
- name: Test with pytest
39+
run: |
40+
python -m pytest -sv --ignore=bam_data_store/dependencies tests
41+
build-and-install:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Set up Python 3.12
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: 3.12
49+
- name: Install uv
50+
run: |
51+
curl -LsSf https://astral.sh/uv/install.sh | sh
52+
- name: Build the package
53+
run: |
54+
uv pip install build
55+
python -m build --sdist
56+
- name: Install the package
57+
run: |
58+
uv pip install dist/*.tar.gz
59+
ruff-linting:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: chartboost/ruff-action@v1
64+
with:
65+
args: "check . --exclude bam_data_store/dependencies"
66+
ruff-formatting:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: chartboost/ruff-action@v1
71+
with:
72+
args: "format . --check --verbose --exclude bam_data_store/dependencies"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy MkDocs Site
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Triggers deployment on push to the main branch
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.11
21+
- name: Install Documentation Dependencies
22+
run: |
23+
pip install --upgrade pip
24+
pip install .[docu]
25+
- name: Deploy docs
26+
uses: mhausenblas/mkdocs-deploy-gh-pages@master
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
CONFIG_FILE: mkdocs.yml

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Build and Publish Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
UV_SYSTEM_PYTHON: true
20+
21+
jobs:
22+
deploy:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python 3.11
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: 3.11
30+
- name: Install uv
31+
run: |
32+
curl -LsSf https://astral.sh/uv/install.sh | sh
33+
- name: Install dependencies
34+
run: |
35+
pip install --upgrade pip
36+
uv pip install build
37+
- name: Build package
38+
run: python -m build
39+
- name: Publish package to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
user: __token__
43+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitlab-ci.yml

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

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ maintainers = [
2626
]
2727
license = { file = "LICENSE" }
2828
dependencies = [
29-
"pybis",
29+
"pybis<=1.36.3",
3030
"pandas",
3131
"openpyxl",
3232
"click",
33+
"pydantic",
3334
]
3435

3536
[project.urls]
@@ -43,6 +44,7 @@ dev = [
4344
"pytest",
4445
"pytest-timeout",
4546
"pytest-cov",
47+
"python-decouple",
4648
]
4749
jupy = [
4850
"jupyterlab",
@@ -135,13 +137,10 @@ follow_imports = "silent"
135137
no_strict_optional = true
136138
disable_error_code = "import, annotation-unchecked"
137139

138-
[tool.setuptools]
139-
package-dir = { "" = "bam_data_store" }
140-
141140
[tool.setuptools.packages.find]
142-
where = ["bam_data_store"]
141+
where = ["."]
143142
exclude = ["dependencies*"]
144143
namespaces = false
145144

146145
[tool.setuptools_scm]
147-
write_to = "bam_data_store/_version.py"
146+
write_to = "bam_data_store/_version.py"

requirements.txt

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

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup()

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def pytest_exception_interact(call):
1010

1111
@pytest.hookimpl(tryfirst=True)
1212
def pytest_internalerror(excinfo):
13-
raise excinfo.value
13+
raise excinfo.value

tests/test_dummy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_dummy():
2+
assert True

0 commit comments

Comments
 (0)