Skip to content

Commit 31439c2

Browse files
committed
python publish update
1 parent 0b1d858 commit 31439c2

4 files changed

Lines changed: 89 additions & 3 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow will upload a Python Package to PyPI when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
release-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.x"
28+
29+
- name: Build release distributions
30+
run: |
31+
# NOTE: put your own distribution build steps here.
32+
python -m pip install build
33+
python -m build
34+
35+
- name: Upload distributions
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: release-dists
39+
path: dist/
40+
41+
pypi-publish:
42+
runs-on: ubuntu-latest
43+
needs:
44+
- release-build
45+
permissions:
46+
# IMPORTANT: this permission is mandatory for trusted publishing
47+
id-token: write
48+
49+
# Dedicated environments with protections for publishing are strongly recommended.
50+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51+
environment:
52+
name: pypi
53+
url: https://pypi.org/p/cozipy/
54+
#
55+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
56+
# ALTERNATIVE: exactly, uncomment the following line instead:
57+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
58+
59+
steps:
60+
- name: Retrieve release distributions
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: release-dists
64+
path: dist/
65+
66+
- name: Publish release distributions to PyPI
67+
uses: pypa/gh-action-pypi-publish@release/v1
68+
with:
69+
packages-dir: dist/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# COZIpy - Neighbor preference analysis with a conditional z-score
22
![License](https://img.shields.io/badge/license-MIT-green)
33

4-
COZI is a python package for neighbor preference (NEP) analysis of cell type labelled spatial data. As described in [Schiller *et al.* bioRxiv 2025](https://doi.org/10.1101/2025.03.31.646289), COZI is one optimized flavor of neighbor preference analysis and infers directinoal neighbor preferences based on label permutations.
4+
COZI is a python package for neighbor preference (NEP) analysis of cell type labelled spatial data. As described in [Schiller *et al.* bioRxiv 2025](https://doi.org/10.1101/2025.03.31.646289), COZI is one optimized flavor of neighbor preference analysis and infers directional neighbor preferences based on label permutations.
55

66
## Installation
77

@@ -33,7 +33,7 @@ COZI requires x and y-coordinates and cell type label information as input. The
3333

3434
### Tutorial
3535

36-
Check the [Tutorial](tutorial/script/cozipy_tutorial.ipynb) for a code example.
36+
Check the [Tutorial](https://github.com/SchapiroLabor/COZIpy/blob/main/tutorial/cozipy_tutorial.ipynb) for a code example.
3737

3838
## Contributing
3939
Contributions, issues, and feature requests are welcome!

pyproject.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,26 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "cozipy"
7-
version = "0.0.1"
7+
dynamic = ["version"]
88
description = "COZI neighbor preference analysis package"
9+
readme = "README.md"
10+
license = { file = "LICENSE" }
911
authors = [
1012
{name="Chiara Schiller", email="chiara.schiller@uni-heidelberg.de"}
1113
]
14+
keywords = ["neighborhood", "spatial", "directionality"]
15+
classifiers = [
16+
"Intended Audience :: Science/Research",
17+
"Programming Language :: Python :: 3",
18+
"License :: OSI Approved :: MIT License"
19+
]
20+
1221
requires-python = ">=3.9"
1322
dependencies = ["numpy", "scipy", "pandas", "scikit-learn"]
23+
24+
[project.urls]
25+
Homepage = "https://github.com/schapirolabor/cozipy"
26+
Issues = "https://github.com/schapirolabor/cozipy/issues"
27+
28+
[tool.setuptools.dynamic]
29+
version = {attr = "cozipy.__version__"}

src/cozipy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from cozipy.nep_cozi import nep_analysis, run_cozi
22
from cozipy.neighbors import knn_graph, radius_graph, delaunay_graph
33

4+
__version__ = "0.1.0"
45
__all__ = ["nep_analysis", "run_cozi", "knn_graph", "radius_graph", "delaunay_graph"]

0 commit comments

Comments
 (0)