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
42 changes: 8 additions & 34 deletions .github/actions/install-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ runs:
using: "composite"
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install R
uses: r-lib/actions/setup-r@v2
Expand All @@ -14,40 +14,14 @@ runs:
cache-version: 1
working-directory: tests

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

- name: Load cached Poetry installation
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-0

- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Load cached virtual env
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.set-up-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
shell: bash
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
shell: bash
run: poetry install --no-interaction
python-version-file: "pyproject.toml"

- name: Activate environment
- name: Install the project
shell: bash
run: source $VENV
run: uv sync --locked --all-extras --dev
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-env
- run: poetry run pre-commit run --all-files
- run: uv run pre-commit run --all-files
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-env
- run: poetry run pytest
- run: uv run pytest
2,060 changes: 0 additions & 2,060 deletions poetry.lock

This file was deleted.

3 changes: 0 additions & 3 deletions prince/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

import importlib.metadata

from . import datasets
from .ca import CA
from .famd import FAMD
Expand All @@ -10,5 +8,4 @@
from .mfa import MFA
from .pca import PCA

__version__ = importlib.metadata.version("prince")
__all__ = ["CA", "FAMD", "MCA", "MFA", "PCA", "GPA", "datasets"]
59 changes: 30 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
[tool.poetry]
[project]
authors = [
{name = "Max Halford", email = "maxhalford25@gmail.com"},
]
license = {text = "MIT"}
requires-python = "<4.0,>=3.10"
readme = "README.md"
dependencies = [
"scikit-learn<2.0.0,>=1.5.1",
"pandas<3.0.0,>=2.2.0",
"altair<6.0.0,>=5.0.0",
]
name = "prince"
version = "0.16.0"
description = "Factor analysis in Python: PCA, CA, MCA, MFA, FAMD, GPA"
authors = ["Max Halford <maxhalford25@gmail.com>"]
license = "MIT"

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
scikit-learn = "^1.5.1"
pandas = "^2.2.0"
altair = "^5.0.0"
[dependency-groups]
dev = [
"nbconvert<8.0.0,>=7.16.5",
"fbpca<2.0,>=1.0",
"pytest<9.0.0,>=8.3.4",
"ipykernel<7.0.0,>=6.13.0",
"rpy2<4.0.0,>=3.5.2",
"ruff<1.0.0,>=0.8.5",
"xarray<2026.0.0,>=2025.1.0",
"pre-commit<5.0.0,>=4.0.1",
]

[tool.poetry.group.dev.dependencies]
nbconvert = "^7.16.5"
fbpca = "^1.0"
pytest = "^8.3.4"
ipykernel = "^6.13.0"
rpy2 = "^3.5.2"
ruff = "^0.8.5"
xarray = "^2025.1.0"
pre-commit = "^4.0.1"
[tool.pytest.ini_options]
addopts = [
"--verbose",
"--doctest-modules",
"--doctest-glob=*.md"
]
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER ELLIPSIS"

[tool.ruff]
lint.select = ["E", "F", "I", "UP"] # https://beta.ruff.rs/docs/rules/
Expand All @@ -29,15 +42,3 @@ lint.ignore = ["E501"]

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
addopts = [
"--verbose",
"--doctest-modules",
"--doctest-glob=*.md"
]
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER ELLIPSIS"
Loading