Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrovatin committed Jan 21, 2024
2 parents 3f49266 + 5863b1f commit 6605682
Show file tree
Hide file tree
Showing 30 changed files with 997 additions and 587 deletions.
11 changes: 4 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# http://editorconfig.org

root = true

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

[*.bat]
indent_style = tab
end_of_line = crlf
[*.{yml,yaml}]
indent_size = 2

[LICENSE]
insert_final_newline = false
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: Usage question
url: https://discourse.scvi-tools.org/
about: Please ask and answer non-development questions at https://discourse.scvi-tools.org/.
- name: Usage question
url: https://discourse.scvi-tools.org/
about: Please ask and answer non-development questions at https://discourse.scvi-tools.org/.
19 changes: 9 additions & 10 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ labels: releases
assignees: ""
---

- [ ] Bump version in `pyproject.toml`.
- [ ] If patch release, backport version bump PR into the appropriate branch. Else, create a new branch off `main` with the appropriate rules.
- [ ] Create a new GitHub draft release targeting the release branch with the same body as the previous release (don't release yet).
- [ ] Trigger a Docker image build in [`scvi-tools-docker`](https://github.com/YosefLab/scvi-tools-docker) targeting the release branch.
- [ ] After image builds and pushes to the registry, run the [tutorials](https://github.com/scverse/scvi-tutorials) using the new image.
- [ ] Bump version in `pyproject.toml`
- [ ] If patch release, backport version bump PR into the appropriate branch. Else, create a new branch off `main` with the appropriate rules
- [ ] Trigger a Docker image build in [`scvi-tools-docker`](https://github.com/YosefLab/scvi-tools-docker) targeting the release branch
- [ ] After image builds and pushes to the registry, run the [tutorials](https://github.com/scverse/scvi-tutorials) using the new image
- [ ] Publish a new release on the tutorials repo off `main` after all tutorials changes have been merged.
- [ ] Create a new branch off `main` in the main repo and run `git submodule update --remote`, and then merge the PR, with an appropriate backport as needed.
- [ ] Double check everything and then publish the draft release on the main repo.
- [ ] Check that the [feedstock repo](https://github.com/conda-forge/scvi-tools-feedstock) updates correctly.
- [ ] Check that the version updates correctly on [PyPI](https://pypi.org/project/scvi-tools/).
- [ ] (Optional) Post threads on Discourse and Twitter!
- [ ] Create a new branch off `main` in the main repo and run `git submodule update --remote`, and then merge the PR, with an appropriate backport as needed
- [ ] Create a new GitHub release targeting the release branch with the same body as the previous release
- [ ] Check that the version updates correctly on [PyPI](https://pypi.org/project/scvi-tools/)
- [ ] Check that the [feedstock repo](https://github.com/conda-forge/scvi-tools-feedstock) updates correctly
- [ ] (Optional) Post threads on Discourse and Twitter
6 changes: 0 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
- [ ] Closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Tests added and passed if fixing a bug or adding a new feature
- [ ] All code checks passed
- [ ] Added type annotations to new arguments/methods/functions
- [ ] Added an entry in the latest `docs/release_notes/index.md` file if fixing a bug or adding a new feature
- [ ] If the changes are patches for a version, I have added the `on-merge: backport to x.x.x` label
53 changes: 27 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
name: Check Build
name: Check build

on:
push:
branches: [main]
pull_request:
branches: [main]
push:
branches:
[main, 0.15.x, 0.16.x, 0.17.x, 0.18.x, 0.19.x, 0.20.x, 1.0.x, 1.1.x]
pull_request:
branches:
[main, 0.15.x, 0.16.x, 0.17.x, 0.18.x, 0.19.x, 0.20.x, 1.0.x, 1.1.x]

jobs:
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/pyproject.toml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

- name: Install build dependencies
run: python -m pip install --upgrade pip wheel twine build

- name: Build package
run: python -m build

- name: Check package
run: twine check --strict dist/*.whl
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "**/pyproject.toml"
- name: Install build dependencies
run: python -m pip install --upgrade pip wheel twine build
- name: Build package
run: python -m build
- name: Check package
run: twine check --strict dist/*.whl
51 changes: 24 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
name: Release

on:
push:
tags:
- "*.*.*"
release:
types: [published]

# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install hatch
run: |
python -m pip install --upgrade hatch
- name: Build project for distribution
run: hatch build

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
release:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/scvi-tools
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "pip"
- run: pip install build
- run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
62 changes: 62 additions & 0 deletions .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test (Linux)

on:
push:
branches:
[main, 0.15.x, 0.16.x, 0.17.x, 0.18.x, 0.19.x, 0.20.x, 1.0.x, 1.1.x]
pull_request:
branches:
[main, 0.15.x, 0.16.x, 0.17.x, 0.18.x, 0.19.x, 0.20.x, 1.0.x, 1.1.x]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0} # -e to fail on error

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ["3.9", "3.10", "3.11"]

name: ${{ matrix.name }} Python ${{ matrix.python }}

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install --pre ".[tests]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
coverage run -m pytest -v --color=yes
- name: Report coverage
run: |
coverage report
- name: Upload coverage
uses: codecov/codecov-action@v3
62 changes: 0 additions & 62 deletions .github/workflows/test_linux_cpu.yml

This file was deleted.

64 changes: 0 additions & 64 deletions .github/workflows/test_linux_cpu_pre.yml

This file was deleted.

Loading

0 comments on commit 6605682

Please sign in to comment.