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
12 changes: 4 additions & 8 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Setup for poetry
run: |
python -m pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install environment
run: poetry install --no-interaction --no-ansi
# run pre-commit
- uses: pre-commit/action@v3.0.1
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
# run pre-commmit checks using prek for faster execution
- uses: j178/prek-action@v1
id: pre_commit
continue-on-error: true
- name: Check for changes
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Setup for poetry
run: |
python -m pip install poetry poetry-dynamic-versioning
- name: Simulate version tag for cosmicqc install compatibility
run: |
poetry version 99.0.0
- name: poetry deps
run: poetry install
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: Build documentation
run: |
mkdir pages
touch pages/.nojekyll
cd docs
poetry run sphinx-build src build
uv run --frozen --with docs sphinx-build src build
# remove any doctrees dirs which aren't needed for publishing
find ./build -type d -name '.doctrees' -exec rm -rf {} +
cp -r build/* ../pages/
Expand All @@ -45,6 +39,3 @@ jobs:
with:
branch: pages
folder: pages
- name: Reset version to 0.0.0
run: |
poetry version 0.0.0
11 changes: 4 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Setup for poetry
run: |
python -m pip install poetry poetry-dynamic-versioning
- name: Install environment
run: poetry install --without dev --no-interaction --no-ansi
- name: poetry build distribution content
run: poetry build
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: uv build distribution content
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
27 changes: 6 additions & 21 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Setup for poetry
run: |
python -m pip install poetry
- name: Simulate version tag for cosmicqc install compatibility
run: |
poetry version 99.0.0
- name: Install environment
run: poetry install --with dev --no-interaction --no-ansi
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
# run pre-commit
- uses: pre-commit/action@v3.0.1
id: pre_commit
Expand All @@ -50,24 +44,15 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
- name: Setup for poetry
run: |
python -m pip install poetry
- name: Simulate version tag for cosmicqc install compatibility
run: |
poetry version 99.0.0
- name: Install environment
run: poetry install --with dev --no-interaction --no-ansi
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: Run pytest (non-3.13)
if: ${{ matrix.python_version != '3.13' }}
# run all tests
run: poetry run pytest -o addopts=
run: uv run --frozen pytest -o addopts=
- name: Run pytest (py 3.13)
if: ${{ matrix.python_version == '3.13' }}
# run all tests except integration tests with cosmicqc
run: |
poetry run pytest -o addopts= \
uv run --frozen pytest -o addopts= \
--ignore=tests/test_project_integration.py
- name: Reset version to 0.0.0
run: |
poetry version 0.0.0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ cython_debug/

# jupyter notebook build files from myst-nb
docs/jupyter_execute

# version placeholder is updated during builds
_version.py
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ repos:
)$
- id: check-yaml
- id: detect-private-key
- repo: https://github.com/python-poetry/poetry
rev: "2.3.2"
hooks:
- id: poetry-check
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.12.1"
rev: "v2.16.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/codespell-project/codespell
Expand Down Expand Up @@ -66,14 +62,13 @@ repos:
rev: v0.6.0
hooks:
- id: pre-commit-update
args: ["--keep", "mdformat", "--keep", "pre-commit-update", "--keep", "cffconvert",
"--keep", "pyproject-fmt"]
args: ["--keep", "mdformat", "--keep", "pre-commit-update", "--keep", "cffconvert"]
- repo: local
hooks:
- id: code-cov-gen
name: Generate code coverage
language: system
entry: poetry run coverage run -m pytest -o addopts=
entry: uv run --frozen coverage run -m pytest -o addopts=
pass_filenames: false
always_run: true
- repo: https://github.com/Weird-Sheep-Labs/coverage-pre-commit
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Build Status](https://github.com/cytomining/CytoDataFrame/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/cytomining/CytoDataFrame/actions/workflows/run-tests.yml?query=branch%3Amain)
![Coverage Status](https://raw.githubusercontent.com/cytomining/CytoDataFrame/main/media/coverage-badge.svg)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Software DOI badge](https://zenodo.org/badge/DOI/10.5281/zenodo.14797074.svg)](https://doi.org/10.5281/zenodo.14797074)

![](https://raw.githubusercontent.com/cytomining/coSMicQC/refs/heads/main/docs/presentations/2024-09-18-SBI2-Conference/images/cosmicqc-example-cytodataframe.png)
Expand Down
4 changes: 2 additions & 2 deletions docs/presentations/2025-sbi2/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ See the following examples for more information:

```bash
# preview the poster during development
poetry run poe poster-preview
uv run poe poster-preview

# build the poster PDF from source
poetry run poe poster-render
uv run poe poster-render
```

## References
Expand Down
23 changes: 11 additions & 12 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please open a [new security advisory notice](https://github.com/cytomining/CytoD

## Development

This project leverages development environments managed by Python [Poetry](https://python-poetry.org/).
This project leverages development environments managed by [uv](https://docs.astral.sh/uv/).
We leverage interactions with the Docker through Python to achieve reproducible results through containers.
We use [pytest](https://docs.pytest.org/) for testing and [GitHub actions](https://docs.github.com/en/actions) for automated tests.

Expand All @@ -24,8 +24,8 @@ We use [pytest](https://docs.pytest.org/) for testing and [GitHub actions](https
Perform the following steps to setup a Python development environment.

1. [Install Python](https://www.python.org/downloads/) (we recommend using [`pyenv`](https://github.com/pyenv/pyenv) or similar)
1. [Install Poetry](https://python-poetry.org/docs/#installation)
1. [Install Poetry Environment](https://python-poetry.org/docs/basic-usage/#installing-dependencies): `poetry install`
1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
1. Install project dependencies: `uv sync --all-groups`

### Linting

Expand All @@ -44,13 +44,13 @@ These automated tests generally must pass in order to merge work into this repos
### Testing

Work added to this project is automatically tested using [pytest](https://docs.pytest.org/) via [GitHub Actions](https://docs.github.com/en/actions).
Pytest is installed through the Poetry environment for this project.
Pytest is installed through the uv-managed environment for this project.
We recommend testing your work before opening pull requests with proposed changes.

You can run pytest on your work using the following example:

```sh
% poetry run pytest
% uv run pytest
```

Pytest output includes a terminal coverage summary to help track current
Expand Down Expand Up @@ -89,13 +89,12 @@ We will check for accuracy, style, code coverage, and scope.

## Versioning

We use [`poetry-dynamic-versioning`](https://github.com/mtkennerly/poetry-dynamic-versioning) to help version this software through [`PEP 440`](https://peps.python.org/pep-0440/) standards.
We use [`setuptools-scm`](https://setuptools-scm.readthedocs.io/) to help version this software through [`PEP 440`](https://peps.python.org/pep-0440/) standards.
Configuration for versioning is found within the `pyproject.toml` file.
All builds for packages include dynamic version data to help label distinct versions of the software.
`poetry-dynamic-versioning` uses `git` tags to help distinguish version data.
We also use the `__init__.py` file as a place to persist the version data for occaissions where the `git` history is unavailable or unwanted.
`setuptools-scm` uses `git` tags to help distinguish version data.
We also use `src/cytodataframe/_version.py` as a place to persist version data for occasions where the `git` history is unavailable or unwanted.

The following command is used to add `poetry-dynamic-versioning` to Poetry for use with this project: `poetry self add "poetry-dynamic-versioning[plugin]"`.
Versioning for the project is intended to align with GitHub Releases which provide `git` tag capabilities.

### Releases
Expand All @@ -109,7 +108,7 @@ Several manual and automated steps are involved with publishing CytoDataFrame re
See below for an overview of how this works.

Notes about [semantic version](https://en.wikipedia.org/wiki/Software_versioning#Semantic_versioning) (semver) specifications:
CytoDataFrame version specifications are controlled through [`poetry-dynamic-versioning`](https://github.com/mtkennerly/poetry-dynamic-versioning) which leverages [`dunamai`](https://github.com/mtkennerly/dunamai) to create version data based on [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) and commits.
CytoDataFrame version specifications are controlled through [`setuptools-scm`](https://setuptools-scm.readthedocs.io/) to create version data based on [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) and commits.
CytoDataFrame release git tags are automatically applied through [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases) and related inferred changes from [`release-drafter`](https://github.com/release-drafter/release-drafter).

1. Open a pull request and use a repository label for `release-<semver release type>` to label the pull request for visibility with [`release-drafter`](https://github.com/release-drafter/release-drafter) (for example, see [CytoDataFrame#24](https://github.com/cytomining/CytoDataFrame/pull/24) as a reference of a semver patch update).
Expand All @@ -130,9 +129,9 @@ See below for some examples of how to build documentation locally.
```shell
# build single-version sphinx documentation
# (useful for troubleshooting potential issues)
poetry run sphinx-build docs/src docs/build
uv run sphinx-build docs/src docs/build

# build multi-version sphinx documentation
# (used in production)
poetry run sphinx-multiversion docs/src docs/build
uv run sphinx-multiversion docs/src docs/build
```
Loading