Skip to content

Commit

Permalink
Prettier (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Jul 14, 2023
1 parent 83be262 commit 4d7befb
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 105 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120
indent_size = 4
indent_style = space

[*.{yml,yaml}]
indent_size = 2
80 changes: 40 additions & 40 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,51 @@ name: Publish Python 🐍 distributions 📦 to PyPI
on:
push:
branches:
- 'main'
- 'test_deploy'
- main
- test_deploy
tags:
- '*'
- "*"

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # allow deriving correct version from git tags

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip

- name: Install pypa/build
run: >-
python -m
pip install
build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_PASSWORD }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # allow deriving correct version from git tags

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip

- name: Install pypa/build
run: >-
python -m
pip install
build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_PASSWORD }}
92 changes: 46 additions & 46 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Unit Tests
on:
push:
branches:
- 'main'
- main
pull_request:
branches:
- '*'
- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -27,57 +27,57 @@ jobs:
fail-fast: false
matrix:
config:
- { name: '3.11', os: ubuntu-latest, python: '3.11', r: 'release' }
- { name: '3.10', os: ubuntu-latest, python: '3.10', r: 'release' }
- { name: '3.9', os: ubuntu-latest, python: '3.9', r: 'release' }
- { name: '3.8', os: ubuntu-latest, python: '3.8', r: 'oldrel' }
- { name: "3.11", os: ubuntu-latest, python: "3.11", r: release }
- { name: "3.10", os: ubuntu-latest, python: "3.10", r: release }
- { name: "3.9", os: ubuntu-latest, python: "3.9", r: release }
- { name: "3.8", os: ubuntu-latest, python: "3.8", r: oldrel }

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install system dependencies
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: pandoc gfortran libblas-dev liblapack-dev libedit-dev llvm-dev libcurl4-openssl-dev ffmpeg libhdf5-dev
version: 1.0
- name: Install system dependencies
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: pandoc gfortran libblas-dev liblapack-dev libedit-dev llvm-dev libcurl4-openssl-dev ffmpeg libhdf5-dev
version: 1.0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python }}
cache: pip
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python }}
cache: pip

- name: Set up R
id: setup-r
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- name: Set up R
id: setup-r
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- name: Install python tools
run: |
python -m pip install --upgrade pip wheel
pip install --upgrade build
- name: Install python tools
run: |
python -m pip install --upgrade pip wheel
pip install --upgrade build
- name: Set up rpy2
run: |
pip install rpy2
echo "LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Set up rpy2
run: |
pip install rpy2
echo "LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1 # increment to bust cache
packages: |
bioc::SingleCellExperiment
bioc::scRNAseq
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1 # increment to bust cache
packages: |
bioc::SingleCellExperiment
bioc::scRNAseq
- name: Install anndata2ri
run: |
python -m build --wheel
pip install $(ls -1 dist/anndata2ri*.whl)[test]
python -c "import anndata2ri"
- name: Install anndata2ri
run: |
python -m build --wheel
pip install $(ls -1 dist/anndata2ri*.whl)[test]
python -c "import anndata2ri"
- name: Run tests
run: pytest --verbose --color=yes
- name: Run tests
run: pytest --verbose --color=yes
32 changes: 18 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: "23.3.0"
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
hooks:
- id: prettier
7 changes: 7 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
overrides:
# JSON with comments and trailing commas
- files: .vscode/*.json
options:
parser: json5
quoteProps: preserve
singleQuote: false
8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ build:
python: "3.11"
python:
install:
- method: pip
path: .
extra_requirements:
- doc
- method: pip
path: .
extra_requirements:
- doc
sphinx:
configuration: docs/conf.py
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": false,
}
}

0 comments on commit 4d7befb

Please sign in to comment.