Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95",
"checkout": "v0.7.0",
"context": {
"cookiecutter": {
"project_name": "firstTask",
"package_name": "myeditdistance",
"project_description": "Calculating the edit distance",
"author_full_name": "Öykü Süoglu",
"author_email": "[email protected]",
"github_user": "sueoglu",
"github_repo": "myeditdistance",
"license": "MIT License",
"ide_integration": true,
"_copy_without_render": [
".github/workflows/build.yaml",
".github/workflows/test.yaml",
"docs/_templates/autosummary/**.rst"
],
"_exclude_on_template_update": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"docs/api.md",
"docs/index.md",
"docs/notebooks/example.ipynb",
"docs/references.bib",
"docs/references.md",
"src/**",
"tests/**"
],
"_render_devdocs": false,
"_jinja2_env_vars": {
"lstrip_blocks": true,
"trim_blocks": true
},
"_template": "https://github.com/scverse/cookiecutter-scverse",
"_commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95"
}
},
"directory": null
}
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Report something that is broken or incorrect
labels: bug
type: Bug
body:
- type: markdown
attributes:
Expand All @@ -9,8 +9,7 @@ body:
detailing how to provide the necessary information for us to reproduce your bug. In brief:
* Please provide exact steps how to reproduce the bug in a clean Python environment.
* In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
* Sometimes it is not possible to share the data, but usually it is possible to replicate problems on publicly
available datasets or to share a subset of your data.
* Replicate problems on public datasets or share data subsets when full sharing isn't possible.
- type: textarea
id: report
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature request
description: Propose a new feature for firstTask
labels: enhancement
type: Enhancement
body:
- type: textarea
id: description
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
shell: bash -euo pipefail {0}

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: pyproject.toml
uses: astral-sh/setup-uv@v7
- name: Build package
run: uv build
- name: Check package
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
release:
types: [published]

defaults:
run:
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
shell: bash -euo pipefail {0}

# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
jobs:
release:
Expand All @@ -20,14 +15,12 @@ jobs:
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: pyproject.toml
uses: astral-sh/setup-uv@v7
- name: Build package
run: uv build
- name: Publish package distributions to PyPI
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
shell: bash -euo pipefail {0}

jobs:
# Get the test environment from hatch as defined in pyproject.toml.
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
Expand All @@ -28,12 +23,12 @@ jobs:
outputs:
envs: ${{ steps.get-envs.outputs.envs }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
- name: Get test environments
id: get-envs
run: |
Expand All @@ -51,6 +46,8 @@ jobs:
# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
test:
needs: get-environments
permissions:
id-token: write # for codecov OIDC

strategy:
fail-fast: false
Expand All @@ -60,29 +57,36 @@ jobs:

name: ${{ matrix.env.label }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.env.python }}
cache-dependency-glob: pyproject.toml
- name: create hatch environment
run: uvx hatch env create ${{ matrix.env.name }}
- name: run tests using hatch
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: uvx hatch run ${{ matrix.env.name }}:run-cov
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
- name: generate coverage report
run: uvx hatch run ${{ matrix.env.name }}:coverage xml
run: |
# See https://coverage.readthedocs.io/en/latest/config.html#run-patch
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
- name: Upload coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
use_oidc: true

# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ __pycache__/
# Tests and coverage
/data/
/node_modules/
/.coverage*

# docs
/docs/generated/
Expand Down
19 changes: 5 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v1.9.4
rev: v2.3.10
hooks:
- id: biome-format
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.6.0
rev: v2.11.1
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
rev: v0.14.10
hooks:
- id: ruff
- id: ruff-check
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: detect-private-key
- id: check-ast
Expand All @@ -36,12 +36,3 @@ repos:
# Check that there are no merge conflicts (could be generated by template sync)
- id: check-merge-conflict
args: [--assume-in-merge]
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit rej files
entry: |
Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
Fix the merge conflicts manually and remove the .rej files.
language: fail
files: '.*\.rej$'
3 changes: 2 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"
python: "3.13"
nodejs: latest
jobs:
create_environment:
- asdf plugin add uv
Expand Down
5 changes: 3 additions & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "useEditorconfig": true },
"overrides": [
{
"include": ["./.vscode/*.json", "**/*.jsonc"],
"includes": ["./.vscode/*.json", "**/*.jsonc"],
"json": {
"formatter": { "trailingCommas": "all" },
"parser": {
Expand Down
13 changes: 9 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------
import shutil
import sys
from datetime import datetime
from importlib.metadata import metadata
from pathlib import Path

from sphinxcontrib import katex

HERE = Path(__file__).parent
sys.path.insert(0, str(HERE / "extensions"))

Expand All @@ -19,7 +22,7 @@
# NOTE: If you installed your project in editable mode, this might be stale.
# If this is the case, reinstall it to refresh the metadata
info = metadata("firstTask")
project_name = info["Name"]
project = info["Name"]
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}."
version = info["Version"]
Expand Down Expand Up @@ -54,9 +57,9 @@
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinxcontrib.bibtex",
"sphinxcontrib.katex",
"sphinx_autodoc_typehints",
"sphinx_tabs.tabs",
"sphinx.ext.mathjax",
"IPython.sphinxext.ipython_console_highlighting",
"sphinxext.opengraph",
*[p.stem for p in (HERE / "extensions").glob("*.py")],
Expand Down Expand Up @@ -92,7 +95,8 @@
}

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
# TODO: replace `3.13` with `3` once ReadTheDocs supports building with Python 3.14
"python": ("https://docs.python.org/3.13", None),
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
Expand All @@ -113,7 +117,7 @@
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]

html_title = project_name
html_title = project

html_theme_options = {
"repository_url": repository_url,
Expand All @@ -123,6 +127,7 @@
}

pygments_style = "default"
katex_prerender = shutil.which(katex.NODEJS_BINARY) is not None

nitpick_ignore = [
# If building the documentation fails because of a missing link that is outside your control,
Expand Down
Loading