Skip to content
Merged
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
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x" # Use a recent stable version
ref: ${{ github.event.release.tag_name }}
fetch-depth: 0

- name: Install build dependencies
run: python -m pip install build --user
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"

- name: Build package
run: python -m build
run: uv build --clear

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 2 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build/
dist/
wheels/
*.egg-info
cytetype/_version.py

.venv
*.env
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
For Seurat workflows, use [CyteTypeR](https://github.com/NygenAnalytics/CyteTypeR).

> [!IMPORTANT]
> Already installed CyteType? Open a terminal and run `pip install -U cytetype` to update to the latest version before you start.
>
> CyteType requires an API key. Use is free for academic and non-commercial research. Commercial use requires a [license](#license).

## Quick Start
Expand Down
3 changes: 1 addition & 2 deletions cytetype/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__version__ = "0.19.5"

import requests

from ._version import __version__
from .config import logger
from .main import CyteType
from .plotting import marker_dotplot
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dev = [
]

[build-system]
requires = ["setuptools>=80.9.0", "wheel"]
requires = ["setuptools>=80.9.0", "setuptools-scm>=8", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
Expand All @@ -52,8 +52,14 @@ packages = {find = {}}
[tool.setuptools.package-data]
cytetype = ["templates/*.html"]

[tool.setuptools.dynamic]
version = {attr = "cytetype.__version__"}
[tool.setuptools_scm]
version_file = "cytetype/_version.py"

[tool.uv]
cache-keys = [
{ file = "pyproject.toml" },
{ git = { commit = true, tags = true } },
]

[tool.mypy]
strict = false
Expand All @@ -76,4 +82,4 @@ warn_unused_ignores = true

ignore_missing_imports = false

exclude = ["^build/", "^dist/", "^.*\\.egg-info/"]
exclude = ["^build/", "^dist/", "^.*\\.egg-info/", "^cytetype/_version\\.py$"]
5 changes: 5 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import stat
import threading
from importlib.metadata import version as distribution_version
from pathlib import Path
from types import SimpleNamespace
from urllib.error import HTTPError
Expand Down Expand Up @@ -34,6 +35,10 @@ def credentials() -> StoredCredentials:
)


def test_public_version_matches_distribution_metadata() -> None:
assert cli.__version__ == distribution_version("cytetype")


def test_credentials_round_trip_is_private_and_server_specific(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
Expand Down
Loading