Skip to content

Conversation

@thecaptain789
Copy link

@thecaptain789 thecaptain789 commented Feb 5, 2026

Summary

Adds a pyproject.toml to enable installation via standard Python package managers directly from Git sources.

Motivation

Currently, the project can only be used as a checked-out source tree. This PR enables:

# Install via uv
uv add git+https://github.com/Polymarket/agents.git

# Install via pip
pip install git+https://github.com/Polymarket/agents.git

# Install via poetry
poetry add git+https://github.com/Polymarket/agents.git

Changes

Added pyproject.toml with:

  • Build system: setuptools with wheel support
  • Core dependencies: Extracted key dependencies from requirements.txt with flexible version constraints
  • Optional dev dependencies: pre-commit and pytest for development
  • Python version: 3.9+ (as specified in README)
  • Package discovery: Properly configured to find the agents module

Dependency Notes

The dependencies use minimum version constraints (e.g., >=0.2.0) rather than pinned versions from requirements.txt to:

  • Allow consumers to use newer compatible versions
  • Avoid unnecessary conflicts with other packages
  • Follow standard library packaging practices

The original requirements.txt remains available for users who prefer exact pinned versions.

Testing

Verified that the package can be installed with:

pip install -e .

Related Issue

Fixes #38


Note

Low Risk
Packaging-only change that doesn’t alter runtime logic; main risk is dependency/version resolution differences for consumers due to >= constraints.

Overview
Adds a new pyproject.toml to make the repo installable as a standard Python package (setuptools/wheel build backend) with declared metadata and Python >=3.9 support.

Moves runtime requirements into the package definition as minimum-version dependencies, adds optional dev extras (pytest, pre-commit), and configures setuptools package discovery to include agents*.

Written by Cursor Bugbot for commit c0131a2. This will update automatically on new commits. Configure here.

Enable installation via package managers (pip, uv, poetry) directly
from Git sources:

    uv add git+https://github.com/Polymarket/agents.git
    pip install git+https://github.com/Polymarket/agents.git

The pyproject.toml includes:
- Core dependencies extracted from requirements.txt
- Flexible version constraints for better compatibility
- Optional dev dependencies for testing/linting
- Python 3.9+ support as per README
- Proper package discovery for the agents module

Fixes Polymarket#38
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to Polymarket Agents. Thank you for creating your first PR. Cheers!

Adds scheduler>=0.8.7 to dependencies list. This package is required
by agents/application/cron.py which imports Scheduler and Monday trigger.
@thecaptain789
Copy link
Author

Good catch! Just pushed a fix adding scheduler>=0.8.7 to the dependencies list. Thanks for the review!

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


[tool.setuptools.packages.find]
where = ["."]
include = ["agents*"]
Copy link

Choose a reason for hiding this comment

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

Package discovery fails without init.py files

High Severity

The [tool.setuptools.packages.find] configuration uses the default find_packages() behavior, which requires __init__.py files in each package directory. The agents directory and its subdirectories do not contain __init__.py files (the README even instructs users to set PYTHONPATH="." as a workaround). Without adding namespaces = true to enable PEP 420 implicit namespace package discovery, setuptools won't find any packages to include. The installation will succeed but the agents module won't be importable.

Fix in Cursor Fix in Web

"scheduler>=0.8.7",
"tavily-python>=0.3.0",
"web3>=6.0.0",
]
Copy link

Choose a reason for hiding this comment

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

Missing httpx dependency in pyproject.toml

High Severity

The httpx library is imported and used in agents/polymarket/polymarket.py and agents/polymarket/gamma.py, but it's not listed in the dependencies array. Users who install the package will encounter ModuleNotFoundError: No module named 'httpx' when trying to use the Polymarket or GammaMarketClient classes.

Fix in Cursor Fix in Web

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.

Add packaging metadata (pyproject.toml/setup.py) to support installation via package managers

1 participant