Skip to content

Commit a665880

Browse files
author
Donglai Wei
committed
codebase cleanup
1 parent 520e6d2 commit a665880

File tree

14 files changed

+2768
-1
lines changed

14 files changed

+2768
-1
lines changed

.github/workflows/build-wheels.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build Wheels
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-20.04, macos-11, windows-2019]
16+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build wheel setuptools
30+
31+
- name: Build wheel
32+
run: python -m build --wheel
33+
34+
- name: Upload wheels
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: wheels
38+
path: dist/*.whl
39+
40+
build_sdist:
41+
name: Build source distribution
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.10'
50+
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install build
55+
56+
- name: Build sdist
57+
run: python -m build --sdist
58+
59+
- name: Upload sdist
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: sdist
63+
path: dist/*.tar.gz
64+
65+
upload_pypi:
66+
name: Upload to PyPI
67+
needs: [build_wheels, build_sdist]
68+
runs-on: ubuntu-latest
69+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
70+
steps:
71+
- uses: actions/download-artifact@v3
72+
with:
73+
name: wheels
74+
path: dist
75+
76+
- uses: actions/download-artifact@v3
77+
with:
78+
name: sdist
79+
path: dist
80+
81+
- name: Publish to PyPI
82+
uses: pypa/gh-action-pypi-publish@release/v1
83+
with:
84+
user: __token__
85+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main, master, v2.0 ]
6+
pull_request:
7+
branches: [ main, master, v2.0 ]
8+
9+
jobs:
10+
build-docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -e .[docs]
24+
25+
- name: Build documentation
26+
run: |
27+
cd docs
28+
make html
29+
30+
- name: Deploy to GitHub Pages
31+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./docs/build/html

.github/workflows/tests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master, v2.0 ]
6+
pull_request:
7+
branches: [ main, master, v2.0 ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: ['3.8', '3.9', '3.10', '3.11']
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pytest pytest-cov
29+
pip install -e .
30+
31+
- name: Run tests
32+
run: |
33+
pytest tests/ -v --cov=connectomics --cov-report=xml
34+
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v3
37+
with:
38+
file: ./coverage.xml
39+
flags: unittests
40+
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v4
49+
with:
50+
python-version: '3.10'
51+
52+
- name: Install linters
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install black flake8 isort mypy
56+
57+
- name: Run black
58+
run: black --check connectomics/
59+
60+
- name: Run flake8
61+
run: flake8 connectomics/ --max-line-length=100
62+
63+
- name: Run isort
64+
run: isort --check connectomics/
65+
66+
- name: Run mypy
67+
run: mypy connectomics/ --ignore-missing-imports

MANIFEST.in

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Include documentation files
2+
include README.md
3+
include QUICKSTART.md
4+
include TROUBLESHOOTING.md
5+
include INSTALLATION.md
6+
include LICENSE
7+
include CONTRIBUTING.md
8+
include RELEASE_NOTES.md
9+
10+
# Include configuration examples
11+
recursive-include tutorials *.yaml *.yml
12+
13+
# Include notebooks
14+
recursive-include notebooks *.ipynb
15+
16+
# Exclude unnecessary files
17+
global-exclude *.py[cod] __pycache__ *.so *.dylib
18+
exclude .gitignore
19+
exclude .gitattributes
20+
21+
# Exclude development and CI files
22+
exclude .github
23+
recursive-exclude .github *
24+
exclude .claude
25+
recursive-exclude .claude *
26+
exclude docker
27+
recursive-exclude docker *
28+
exclude scripts
29+
recursive-exclude scripts *
30+
31+
# Exclude outputs and temporary files
32+
exclude outputs
33+
recursive-exclude outputs *
34+
exclude datasets
35+
recursive-exclude datasets *
36+
prune tests

0 commit comments

Comments
 (0)