Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3da8d24
use uv
MAfarrag Dec 27, 2025
cfca9b2
change ci to use uv
MAfarrag Dec 27, 2025
5e6a51f
correct uv sync command
MAfarrag Dec 27, 2025
55aee25
correct uv sync command
MAfarrag Dec 27, 2025
1a31834
use uv
MAfarrag Dec 27, 2025
0e7a347
Update pyproject.toml
MAfarrag Dec 28, 2025
57842e5
use the composite action for uv setup
MAfarrag Dec 30, 2025
96809b8
remove the poetry lock file
MAfarrag Dec 30, 2025
61cce20
clean wrong mypy config overrides
MAfarrag Dec 30, 2025
46686a3
update deprecated "A-Oct" to "YE-OCT" in ams_analysis function"
MAfarrag Dec 30, 2025
f6d8b6b
commit the lock file
MAfarrag Dec 30, 2025
b50ecdb
remove the unused increment input to the workflow
MAfarrag Dec 31, 2025
1a41f4a
move the configs to a separate uv.toml file
MAfarrag Jan 3, 2026
e53b607
update lock file
MAfarrag Jan 3, 2026
ed139a8
use composite action for the github release
MAfarrag Jan 3, 2026
49e73b7
bump: version 0.6.3 → 0.6.4
MAfarrag Jan 3, 2026
e6f2a44
update commitizen configs
MAfarrag Jan 3, 2026
7355110
Merge branch 'dev/uv-package-manager' of github.com:Serapieum-of-alex…
MAfarrag Jan 3, 2026
349d1ea
revert
MAfarrag Jan 3, 2026
e84d44e
bump: version 0.6.3 → 0.7.0
MAfarrag Jan 3, 2026
bdd2c5b
add full inputs
MAfarrag Jan 3, 2026
6a3361b
revert
MAfarrag Jan 3, 2026
41e4cb7
simplify
MAfarrag Jan 3, 2026
89e1ecd
bump: version 0.6.3 → 0.6.4
MAfarrag Jan 3, 2026
c8e6aeb
revert
MAfarrag Jan 3, 2026
bcb9bc6
bump: version 0.6.3 → 0.6.4
MAfarrag Jan 3, 2026
ceb4a28
revert
MAfarrag Jan 3, 2026
d0eaab5
bump: version 0.6.3 → 0.6.4
MAfarrag Jan 3, 2026
06ac6ec
remove the release-notes input
MAfarrag Jan 3, 2026
d12f602
Merge branch 'dev/uv-package-manager' of github.com:Serapieum-of-alex…
MAfarrag Jan 3, 2026
3126e07
revert
MAfarrag Jan 3, 2026
02eea82
update
MAfarrag Jan 3, 2026
d83b2a1
bump: version 0.6.3 → 0.6.4
MAfarrag Jan 3, 2026
ce0d8bf
revert
MAfarrag Jan 3, 2026
a37f66f
bump: version 0.6.3 → 0.7.0b0
MAfarrag Jan 3, 2026
8dbb72b
revert
MAfarrag Jan 3, 2026
7675bcb
remove the github-release.yml workflow
MAfarrag Jan 3, 2026
3900d64
unify parameter name
MAfarrag Jan 3, 2026
1112ef1
use composite actions
MAfarrag Jan 3, 2026
c7ab063
rename
MAfarrag Jan 3, 2026
b3ae024
use composite actions v1 for python setup
MAfarrag Jan 4, 2026
7a9b4f0
use updated composite version syntax for install-groups
MAfarrag Jan 4, 2026
79957e3
update the uv action in the test workflow to use uv/v1
MAfarrag Jan 10, 2026
c380418
update the mkdocs action in the workflow to use mkdocs/v1
MAfarrag Jan 10, 2026
f660888
remove the upload to codecov action step
MAfarrag Jan 10, 2026
f2ab05d
checkout the repo in the workflow not in the composite action
MAfarrag Jan 10, 2026
cd5cb12
correct calls for the mkdocs action
MAfarrag Jan 10, 2026
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: 29 additions & 14 deletions .github/workflows/github-pages-mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ jobs:
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install .[docs]
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install Dependencies
run: uv sync --frozen --group docs

- name: Deploy to GitHub Pages (Pull Request)
env:
Expand All @@ -40,7 +45,7 @@ jobs:
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'

mike deploy --push develop
uv run mike deploy --push develop

deploy-main:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand All @@ -55,18 +60,23 @@ jobs:
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install .[docs]
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install Dependencies
run: uv sync --frozen --group docs

- name: Deploy to GitHub Pages (Main)
env:
ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }}
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
mike deploy --push main
mike set-default --push main
uv run mike deploy --push main
uv run mike set-default --push main

deploy-release:
if: github.event_name == 'release'
Expand All @@ -80,9 +90,14 @@ jobs:
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install .[docs]
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install Dependencies
run: uv sync --frozen --group docs

- name: Set release notes tag
run: |
Expand All @@ -95,5 +110,5 @@ jobs:
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
mike deploy --push --update-aliases ${RELEASE_TAG_VERSION} latest
mike set-default --push latest
uv run mike deploy --push --update-aliases ${RELEASE_TAG_VERSION} latest
uv run mike set-default --push latest
18 changes: 14 additions & 4 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install Dependencies
run: uv sync --frozen --group dev

- name: Install tools
run: |
python -m pip install --upgrade pip
pip install wheel twine build
uv pip install twine

- name: Build and publish
run: |
python -m build --sdist --wheel
uv build
twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERS }}
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/release-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,21 @@ jobs:
with:
python-version: 3.13

- name: Install Commitizen
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Verify lock file is up to date
run: |
python -m pip install --upgrade pip
pip install commitizen>=4.8.3
uv lock --check

- name: Install Dependencies
run: uv sync --frozen --group dev --group docs

- name: Generate changelog
run: cz changelog --unreleased-version="${{ steps.get_version.outputs.VERSION }}" --incremental
run: uv run cz changelog --unreleased-version="${{ steps.get_version.outputs.VERSION }}" --incremental

- name: Get user info
id: user_info
Expand All @@ -88,7 +96,14 @@ jobs:
run: |
set -e # Exit immediately if a command exits with a non-zero status
echo "Bumping version to ${{ steps.get_version.outputs.VERSION }}"
cz bump --yes --check-consistency "${{ steps.get_version.outputs.VERSION }}"
uv run cz bump --yes --check-consistency "${{ steps.get_version.outputs.VERSION }}"

echo "Updating lock file after version bump"
uv lock

echo "Committing lock file update"
git add uv.lock
git commit -m "chore: update lock file after version bump" || echo "No lock file changes to commit"

echo "Pushing changes to repository"
if ! git push; then
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ permissions:

on:
push:
branches: ['main']
pull_request:
branches: [main]

jobs:
main-package:
Expand All @@ -22,20 +19,34 @@ jobs:
OS: ${{ matrix.os }}

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Verify lock file is up to date
shell: bash
run: |
uv lock --check

- name: Install dependencies
run: |
pip install .[dev]
uv sync --frozen --group dev

- name: Run Tests
run: |
pytest -vvv --cov=src/statista --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
uv run pytest -vvv --cov=src/statista --cov-report=xml --junitxml=junit.xml -o junit_family=legacy

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
Expand All @@ -46,4 +57,4 @@ jobs:

- name: test Jupyter notebook
run: |
pytest --nbval --nbval-lax --verbose
uv run pytest --nbval --nbval-lax --verbose
115 changes: 83 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name = "statista"
version = "0.6.3"
description = "statistics package"
readme = "README.md"
requires-python = ">=3.11,<4"
license = {text = "GPL-3.0-or-later"}
authors = [
{name = "Mostafa Farrag", email = "moah.farag@gmail.com"},
Expand Down Expand Up @@ -31,6 +30,7 @@ classifiers = [
"Intended Audience :: Developers",
]

requires-python = ">=3.11"
dependencies = [
"numpy>=2.0.0",
"matplotlib>=3.9.0",
Expand All @@ -40,14 +40,20 @@ dependencies = [
"loguru>=0.7.2",
]

[project.optional-dependencies]
[dependency-groups]
dev = [
"nbval >=0.11.0",
"pre-commit >=3.7.1",
"pre-commit-hooks >=4.6.0",
"pytest >=8.2.2",
"pytest-cov >=5.0.0",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"pre-commit>=4.3.0",
"pre-commit-hooks>=6.0.0",
"pytest-asyncio>=1.2.0",
"nest-asyncio>=1.6.0",
"nbval>=0.11.0",
"pytest-xdist>=3.8.0",
"mypy>=1.19.0",
"types-PyYAML>=6.0.12",
]

docs = [
"mkdocs >=1.5.3",
"mkdocs-material >=9.5.3",
Expand All @@ -60,22 +66,48 @@ docs = [
"mkdocs-table-reader-plugin >=3.1.0",
"mkdocs-mermaid2-plugin >=1.2.1",
"jupyter-contrib-nbextensions >=0.7.0",
"mkdocs-panzoom-plugin",
"notebook<7.0",
"jupyter",
"commitizen (>=4.8.3,<5.0.0)",
]

[tool.setuptools.packages.find]
where = ["src"]
include = ["statista", "statista.*"]


[project.urls]
Homepage = "https://github.com/Serapieum-of-alex/statista"
Documentation = "https://github.com/Serapieum-of-alex/statista"
Repository = "https://github.com/Serapieum-of-alex/statista"


[tool.hatch.build.targets.wheel]
packages = ["src/statista"]
#include = ["src/tsvkw/data/*"]


[tool.commitizen]
name = "cz_conventional_commits"
version_provider = "pep621"
tag_format = "$version"
changelog_file = "docs/change-log.md"

[tool.flake8]
ignore = "E203, E266, E501, W503, E741"
max-line-length = 88
max-complexity = 18
select = "B,C,E,F,W,T4"
count = true


[tool.black]
profile = "flake8"
line-length = 88
skip-string-normalization = true

[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3

[tool.pytest.ini_options]

addopts = [
Expand All @@ -85,7 +117,8 @@ addopts = [
"--cov-report=html",
"--cov-report=xml:coverage-reports/coverage.xml"
]
testpaths = ["tests"]
testpaths = "tests"
norecursedirs = "docs"
markers = [
"slow: mark test as slow.",
"fast: mark test as fast.",
Expand All @@ -94,28 +127,46 @@ markers = [
"integration: marks tests as integration (deselect with '-m \"not integration\"')",
]

[tool.flake8]
ignore = "E203, E266, E501, W503, E741"
max-line-length = 88
max-complexity = 18
select = "B,C,E,F,W,T4"

[tool.black]
profile = "flake8"
line-length = 88
skip-string-normalization = true
[tool.mypy]
python_version = "3.12"
warn_return_any = false
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_decorators = false
warn_redundant_casts = true
warn_unused_ignores = false
warn_no_return = true
warn_unreachable = true
strict_optional = true
ignore_missing_imports = true
no_implicit_optional = false

[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true

[tool.commitizen]
name = "cz_conventional_commits"
version_provider = "pep621"
tag_format = "$version"
changelog_file = "docs/change-log.md"
[[tool.mypy.overrides]]
module = "setup"
ignore_errors = true

[[tool.mypy.overrides]]
module = "tsvkw.toetsmodel.models"
# Complex parsing logic with dynamic types
warn_return_any = false
disallow_any_expr = false

[[tool.mypy.overrides]]
module = "tsvkw.config"
# Configuration loading from YAML - unavoidable Any returns
warn_return_any = false


#[tool.uv]
#managed = false

[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"
Loading
Loading