Skip to content

fix: correct package name, dependencies, and URL in setup.py#4

Open
haoyu-haoyu wants to merge 1 commit intoCogStack:mainfrom
haoyu-haoyu:fix/setup-py-package-name-and-deps
Open

fix: correct package name, dependencies, and URL in setup.py#4
haoyu-haoyu wants to merge 1 commit intoCogStack:mainfrom
haoyu-haoyu:fix/setup-py-package-name-and-deps

Conversation

@haoyu-haoyu
Copy link
Copy Markdown

Summary

setup.py has three critical bugs that make the package completely uninstallable via pip install -e . or pip install .:

Bug 1: Wrong package name

# Before — looks for medgpt/ directory which doesn't exist
packages=['medgpt', 'medgpt.datasets', ...]

# After — matches the actual foresight/ directory
packages=['foresight', 'foresight.datasets', ...]

Bug 2: Missing comma causes string concatenation

# Before — Python concatenates into 'datasets==2.15.0transformers==4.35.2'
install_requires=[
    'datasets==2.15.0'      # <-- missing comma!
    'transformers==4.35.2',
]

# After
install_requires=[
    "datasets>=2.15",
    "transformers>=4.35",
]

Bug 3: URL points to old repository

# Before
url="https://github.com/w-is-h/medgpt"

# After
url="https://github.com/CogStack/Foresight"

Additional improvements

  • Removed non-existent foresight.models sub-package (relates to no 'models' provided #1)
  • Relaxed version pins (>= instead of ==) for compatibility
  • Moved flash-attn to extras_require (requires CUDA build env)
  • Added missing torch and numpy dependencies
  • Added python_requires=">=3.9"

Test plan

git clone https://github.com/CogStack/Foresight.git
cd Foresight
pip install -e .     # Before: fails. After: succeeds
python -c "import foresight; print('OK')"

Partially addresses #1 (the foresight.models module is still missing from the repo, but at least setup.py no longer references it).

Three critical bugs made the package completely uninstallable:

1. Package name was "medgpt" but the source directory is foresight/ —
   setuptools could not find any modules to install.

2. Missing comma after 'datasets==2.15.0' caused Python implicit
   string concatenation, producing the nonsensical requirement
   'datasets==2.15.0transformers==4.35.2'.

3. URL pointed to the old repo (github.com/w-is-h/medgpt) instead
   of github.com/CogStack/Foresight.

Additional improvements:
- Removed the non-existent foresight.models sub-package (see CogStack#1)
- Relaxed version pins (>=X.Y instead of ==X.Y.Z) so the package
  can coexist with other libraries
- Moved flash-attn to extras_require since it requires a CUDA build
  environment and is not needed for CPU-only usage
- Added python_requires=">=3.9"
- Added torch and numpy as explicit dependencies (imported by the
  package but previously missing from install_requires)
- Removed unused setuptools command imports
- Added encoding="utf-8" to open()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant