From d5134f37169270734958281b555b3093fd53381b Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:13:34 +0200 Subject: [PATCH 1/6] Update pyproject.toml to version 1.0.1 with dependency adjustments and migration to Hatch for build system --- pyproject.toml | 69 +++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1c08a7e..a2021ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,40 +1,45 @@ -[tool.poetry] +[project] name = "calipytion" -version = "1.0.0" +version = "1.0.1" description = "Tool for creating standard curves and concentration calculations." -authors = ["haeussma <83341109+haeussma@users.noreply.github.com>"] -license = "MIT License" +authors = [{ name = "haeussma", email = "83341109+haeussma@users.noreply.github.com" }] +license = {text = "MIT"} readme = "Readme.md" -packages = [{include = "calipytion"}] +requires-python = ">=3.10,<3.16" +dependencies = [ + "httpx>=0.25.0", + "lmfit>=1.0.0", + "matplotlib>=3.8.0", + "mdmodels>=0.2.0", + "nbformat>=5.0.0", + 'numpy>=1.26,<2; python_version < "3.13"', + 'numpy>=2; python_version >= "3.13"', + "pandas[excel]>=2.0,<3.0", + "plotly>=6.3.0", + "pydantic>=2.0.0", + "pyenzyme>=2.1.0", + "rich>=13.0.0", + "sympy>=1.0.0", + "toml>=0.10.2", +] -[tool.poetry.dependencies] -python = "^3.10" -plotly = "^5.18.0" -numpy = "^1.26.4" -lmfit = "^1.2.2" -sympy = "^1.12" -matplotlib = ">=3.7" -nbformat = "^5.10.4" -pydantic = "^2.4" -rich = "^13" -pandas = { version = ">=2.0,<3.0", extras = ["excel"] } -toml = "^0.10.2" -pyenzyme = "^2.0.0" -httpx = ">=0.27.0" -mdmodels = "^0.2.0" +[tool.mypy] +ignore_missing_imports = true -[tool.poetry.group.dev.dependencies] -mkdocs-material = "^9.5.8" -pytest = "^8.0.0" -devtools = "^0.12.2" -notebook = "<7" -mkdocs-plotly-plugin = "^0.1.3" -pandas-stubs = "^2.2.2.240807" -nbval = "^0.11.0" +[dependency-groups] +dev = [ + "devtools>=0,<1", + "mkdocs-material>=9,<10", + "mkdocs-plotly-plugin>=0,<1", + "nbval>=0,<1", + "notebook>=6,<7", + "pandas-stubs>=2,<3", + "pytest>=8,<9", +] [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling>=1.25"] +build-backend = "hatchling.build" -[tool.mypy] -ignore_missing_imports = true +[tool.hatch.build.targets.wheel] +packages = ["calipytion"] From 25e5c5395429bb0a2e4ecead3207542a750f3bec Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:13:42 +0200 Subject: [PATCH 2/6] Update .gitignore to include .python-version and ruff_cache/ directories --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a67e51e..af058c7 100644 --- a/.gitignore +++ b/.gitignore @@ -165,4 +165,6 @@ cython_debug/ #.idea/ -.test_example.py \ No newline at end of file +.test_example.py +.python-version +.ruff_cache/ \ No newline at end of file From 33fd1e13ef21aba7565d073a7f55188d45ec7bbb Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:14:28 +0200 Subject: [PATCH 3/6] Update .gitignore to include ruff_cache/ and uv.lock --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index af058c7..49910e3 100644 --- a/.gitignore +++ b/.gitignore @@ -167,4 +167,5 @@ cython_debug/ .test_example.py .python-version -.ruff_cache/ \ No newline at end of file +.ruff_cache/ +uv.lock \ No newline at end of file From 6819a5881b869569578f68ec2e0917bc24c71106 Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:14:40 +0200 Subject: [PATCH 4/6] Refactor GitHub workflows to use 'uv' for dependency management and build processes - Replaced direct installation of dependencies with 'uv sync' in deploy_pypi.yaml, make_docs.yaml, and tests.yaml. - Updated build commands to utilize 'uv build' and 'uv run' for consistency across workflows. - Added 'uv' setup step in all relevant workflows to ensure proper environment configuration. --- .github/workflows/deploy_pypi.yaml | 14 +++++++------- .github/workflows/make_docs.yaml | 10 ++++++++-- .github/workflows/tests.yaml | 13 +++++++------ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy_pypi.yaml b/.github/workflows/deploy_pypi.yaml index 682b016..93b07de 100644 --- a/.github/workflows/deploy_pypi.yaml +++ b/.github/workflows/deploy_pypi.yaml @@ -19,14 +19,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.x" - - name: Install pypa/build - run: >- - python3 -m - pip install - build - --user + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + - name: Install dependencies + run: uv sync - name: Build a binary wheel and a source tarball - run: python3 -m build + run: uv build - name: Store the distribution packages uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/make_docs.yaml b/.github/workflows/make_docs.yaml index 44f0030..2606883 100644 --- a/.github/workflows/make_docs.yaml +++ b/.github/workflows/make_docs.yaml @@ -18,9 +18,15 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.x + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" - uses: actions/cache@v4 with: path: .cache key: ${{ github.ref }} - - run: pip install mkdocs-material jupyter nbconvert mkdocs-jupyter mkdocs-plotly-plugin - - run: mkdocs gh-deploy --force + - name: Install dependencies + run: uv sync --group dev + - name: Build and deploy docs + run: uv run mkdocs gh-deploy --force diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 92b961a..224f11a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,12 +18,13 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install poetry - poetry install --with dev + run: uv sync --group dev - name: Run tests with pytest - run: | - poetry run pytest --nbval-lax + run: uv run pytest --nbval-lax From c3a3933ea4e4493c46b233cfd592a0381e7ede59 Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:14:53 +0200 Subject: [PATCH 5/6] Add __version__ attribute to __init__.py for versioning --- calipytion/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/calipytion/__init__.py b/calipytion/__init__.py index dc17d89..bd1143c 100644 --- a/calipytion/__init__.py +++ b/calipytion/__init__.py @@ -1,3 +1,4 @@ from .tools import Calibrator __all__ = ["Calibrator"] +__version__ = "1.0.1" \ No newline at end of file From ceb5da712d3e67e0b98afe4d339eed28a1d17eb7 Mon Sep 17 00:00:00 2001 From: haeussma <83341109+haeussma@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:18:37 +0200 Subject: [PATCH 6/6] Add pre-commit configuration for code quality checks --- .pre-commit-config.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a96e58f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ +repos: + - repo: local + hooks: + - id: sort_pyproject + name: sort_pyproject + entry: toml-sort -i --sort-table-keys --sort-inline-tables + language: python + files: ^pyproject\.toml$ + additional_dependencies: ["toml-sort==0.23.1"] + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.4 + hooks: + - id: ruff-format + types_or: [python, pyi, jupyter] # drop toml to avoid conflicts + - id: ruff + types_or: [python, pyi, jupyter, toml] + args: [--fix] + + - repo: https://github.com/RobertCraigie/pyright-python + rev: v1.1.379 + hooks: + - id: pyright + # use the packaged pyright for reproducibility + language: python + additional_dependencies: ["pyright==1.1.379"] + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-merge-conflict + - id: check-added-large-files + args: ["--maxkb=5000"]