Skip to content

Refactor Packaging: Split setup.py into setup.py and pyproject.toml for PEP 517 Compliance#657

Merged
qtuantruong merged 4 commits intoPreferredAI:masterfrom
michael-mue:feature/pyproject-toml
Feb 27, 2025
Merged

Refactor Packaging: Split setup.py into setup.py and pyproject.toml for PEP 517 Compliance#657
qtuantruong merged 4 commits intoPreferredAI:masterfrom
michael-mue:feature/pyproject-toml

Conversation

@michael-mue
Copy link
Copy Markdown
Contributor

@michael-mue michael-mue commented Jan 9, 2025

Description

This PR splits the setup.py file into setup.py and pyproject.toml to adhere to PEP 517 and modern packaging standards. This change facilitates better build isolation, dependency specification, and aligns with the latest Python packaging practices.

Changes made

  • Created a pyproject.toml file containing build system requirements and project metadata.
  • Simplified setup.py to focus on building extensions and registering custom commands.
  • Ensured that all existing setup configurations are appropriately transferred to pyproject.toml.
  • Updated README with new install from source instructions

Motivation

  • Aligns cornac with modern packaging standards and simplifies dependency installation.
  • Enhances compatibility with tools like uv and pixi that resolve dependencies simultaneously.
  • Improves compatibility with tools like pip and build that rely on pyproject.toml.
  • Simplifies the source installation process by eliminating the need to pre-install build dependencies (pip3 install git+https://github.com/PreferredAI/cornac.git works without requiring pip3 install Cython numpy scipy).
  • Improves build reproducibility and isolation.

Testing

  • All tests pass locally.
  • Built the package locally using the new configuration without issues.

Notes

  • No changes to the core functionality of the package.
  • All existing tests and CI configurations should remain valid.

Please let me know if there are any questions or if further changes are needed.

@michael-mue michael-mue closed this Jan 9, 2025
@michael-mue michael-mue reopened this Jan 9, 2025
@qtuantruong qtuantruong requested a review from darrylong January 11, 2025 19:40
Copy link
Copy Markdown
Member

@darrylong darrylong left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge, thank you!

@qtuantruong qtuantruong merged commit c942dec into PreferredAI:master Feb 27, 2025
qtuantruong pushed a commit to qtuantruong/cornac that referenced this pull request Oct 25, 2025
qtuantruong pushed a commit to qtuantruong/cornac that referenced this pull request Oct 25, 2025
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