Skip to content

Add packaging config: dependency bounds, console script, and pyproject-based install#211

Open
trehansalil wants to merge 5 commits into
VectifyAI:mainfrom
trehansalil:main
Open

Add packaging config: dependency bounds, console script, and pyproject-based install#211
trehansalil wants to merge 5 commits into
VectifyAI:mainfrom
trehansalil:main

Conversation

@trehansalil
Copy link
Copy Markdown

This pull request sets up the initial project configuration for a new Python package named pageindex. The main changes include specifying Python version requirements and adding project metadata and dependencies.

Project setup and configuration:

  • Added a .python-version file to specify Python 3.12 as the required version for development.
  • Created a pyproject.toml file with project metadata, Python version requirement (>=3.12), dependencies (litellm, pymupdf, PyPDF2, python-dotenv, pyyaml), and build system configuration using Hatchling.

Copilot AI review requested due to automatic review settings April 2, 2026 10:53
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@trehansalil trehansalil changed the title Refactor code structure for readability and maintainability Adding PyProjects.toml so that this could be used as a package in other projects Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial Python packaging configuration for the pageindex project, establishing Python version requirements and a Hatchling-based build setup to support distribution as a Python package.

Changes:

  • Added pyproject.toml with PEP 621 project metadata, runtime dependencies, and Hatchling build configuration.
  • Added .python-version to standardize local development on Python 3.12.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Defines package metadata, Python requirement (>=3.12), dependencies, and Hatchling wheel packaging for pageindex.
.python-version Pins the local dev Python version to 3.12.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
Comment thread pyproject.toml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jakob1379
Copy link
Copy Markdown

you should add boundaries to the dependencies, simplest solution is usually uvx uv-bump

@jakob1379
Copy link
Copy Markdown

title is misleading, you can already add the project as git+https://github.com/VectifyAI/PageIndex.git in dependencies, it does have the requirements.txt

@trehansalil
Copy link
Copy Markdown
Author

@claude review and work on jakob's comments

@jakob1379
Copy link
Copy Markdown

pr should delete requirements.txt and add run as [project.scripts]

Resolves @jakob1379's review comments on VectifyAI#211:

- Add lower bounds to dependencies (matching the pinned versions) so the
  package metadata no longer drifts from the locked versions.
- Add an `[project.scripts]` entry (`pageindex`) wired to a new
  `pageindex.cli:main`; `run_pageindex.py` becomes a thin wrapper that
  delegates to it for backward compatibility.
- Delete `requirements.txt`; installation now flows through the package
  (`pip install .` / `pip install git+https://...` / `.[examples]`).
- Update README install/usage instructions accordingly and add an
  `examples` optional-dependency extra for the openai-agents demo.
- Regenerate uv.lock to reflect the new bounds and extra.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@trehansalil trehansalil changed the title Adding PyProjects.toml so that this could be used as a package in other projects Add packaging config: dependency bounds, console script, and pyproject-based install Jun 2, 2026
@trehansalil
Copy link
Copy Markdown
Author

Thanks @jakob1379 — addressed all three points in 85f25e8:

  1. Dependency boundaries — added lower bounds to every dependency in pyproject.toml (matching the previously pinned versions, e.g. litellm>=1.83.7, pymupdf>=1.26.4), and regenerated uv.lock.
  2. requirements.txt — deleted. Installation now goes through the package itself (pip install ., pip install "git+https://github.com/VectifyAI/PageIndex.git", or .[examples] for the agents demo). README install/usage instructions updated accordingly.
  3. [project.scripts] — added a pageindex console script pointing at a new pageindex.cli:main. run_pageindex.py is now a thin wrapper that delegates to it, so existing usage keeps working.

Also updated the PR title so it reflects the actual change.

@trehansalil trehansalil requested a review from Copilot June 3, 2026 07:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Comment thread README.md
Comment on lines +152 to +155
Install the package (along with its pinned dependencies) from the repository root:

```bash
pip3 install --upgrade .
Comment thread pyproject.toml
Comment on lines +8 to +15
requires-python = ">=3.12"
dependencies = [
"litellm>=1.83.7",
"pymupdf>=1.26.4",
"PyPDF2>=3.0.1",
"python-dotenv>=1.2.2",
"pyyaml>=6.0.2",
]
Comment thread pageindex/cli.py
Comment on lines +135 to +138
if not args.pdf_path and not args.md_path:
raise ValueError("Either --pdf_path or --md_path must be specified")
if args.pdf_path and args.md_path:
raise ValueError("Only one of --pdf_path or --md_path can be specified")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants