Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop setup.py #363

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Drop setup.py #363

merged 2 commits into from
Jan 14, 2025

Conversation

AntObi
Copy link
Collaborator

@AntObi AntObi commented Jan 14, 2025

Drop setup.py

Description

This PR completes the migration from setup.py to pyproject.toml

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Verified that all submodules are included in the source tarbell upon building and distributing the package.

Test Configuration:

  • Python version: 3.10
  • Operating System: macOS

Reviewers

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • Build Configuration

    • Enhanced project packaging configuration by updating pyproject.toml
    • Added new sections for package discovery and data inclusion
    • Configured pytest test paths
  • Project Structure

    • Removed setup.py file
    • Migrated installation configuration to pyproject.toml
  • Testing

    • Updated testing configuration to improve package testing capabilities

@AntObi AntObi added pkg Package Health housekeeping House-Keeping labels Jan 14, 2025
Copy link
Contributor

coderabbitai bot commented Jan 14, 2025

Walkthrough

The pull request introduces significant changes to the project's packaging and configuration. The setup.py file has been completely removed, with its functionality now migrated to the pyproject.toml file. New sections have been added to pyproject.toml to handle package discovery, package data inclusion, and pytest configuration. These changes modernise the project's build and testing setup, leveraging contemporary Python packaging standards.

Changes

File Change Summary
pyproject.toml - Added [tool.setuptools] section with include-package-data = true
- Added [tool.setuptools.packages.find] to define package discovery
- Added [tool.setuptools.package-data] to specify includable data files
- Added [tool.pytest.ini_options] for pytest configuration
setup.py - Entire file removed, replacing its functionality with pyproject.toml configurations

Possibly related PRs

Suggested labels

enhancement, bug

Poem

🐰 Hop, hop, config's new dance!
Setuptools twirls with a glance
Package data now takes flight
No more setup.py in sight
Pytest smiles, the rabbit grins
A packaging transformation begins! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pyproject.toml (1)

134-136: Consider updating the pytest minimum version requirement.

The current minimum version (6.0) is quite old. Pytest 7.x offers improved features and bug fixes. Consider updating to a more recent minimum version.

-minversion = 6.0
+minversion = 7.0
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92e4cc9 and 95a23b8.

📒 Files selected for processing (2)
  • pyproject.toml (1 hunks)
  • setup.py (0 hunks)
💤 Files with no reviewable changes (1)
  • setup.py
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: test (3.12, windows-latest)
  • GitHub Check: test (3.12, macos-latest)
  • GitHub Check: test (3.12, ubuntu-latest)
  • GitHub Check: test (3.11, windows-latest)
  • GitHub Check: test (3.11, macos-latest)
  • GitHub Check: test (3.11, ubuntu-latest)
  • GitHub Check: test (3.10, windows-latest)
  • GitHub Check: test (3.10, macos-latest)
  • GitHub Check: test (3.10, ubuntu-latest)
🔇 Additional comments (1)
pyproject.toml (1)

124-132: Setuptools configuration looks good, but let's verify data files inclusion.

The configuration correctly sets up package discovery and data files inclusion. The patterns for package data look comprehensive for a scientific package.

Let's verify that all necessary data files are included in the patterns:

✅ Verification successful

All data files are properly covered by the package data patterns

The current configuration in pyproject.toml correctly includes all existing data files in the smact/data directory, including those in the species_rep subdirectory. No files are being missed by the specified patterns.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any data files that might be missed by the current patterns

# Find all files in the smact/data directory
echo "Files in smact/data directory:"
fd . "smact/data" -t f

# Check if there are any files that don't match the configured patterns
echo -e "\nFiles that might be missed by current patterns:"
fd . "smact/data" -t f -E "*.txt" -E "*.csv" -E "*.data" -E "*.xlsx" -E "*.json"

Length of output: 1363

Comment on lines +124 to +136
[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["."]
include = ["smact","smact.*"]

[tool.setuptools.package-data]
"smact" = ["data/*.txt", "data/*.csv", "data/*.data", "data/*.xlsx", "data/*.json", "data/species_rep/*.json"]

[tool.pytest.ini_options]
minversion = 6.0
testpaths = ["smact/tests"]
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Migration from setup.py is incomplete

Essential configurations are missing in pyproject.toml:

  • Package metadata (name, version, description, author details, etc.)
  • Dependencies list (scipy, numpy, spglib, etc.)
  • Python version requirements (>=3.10)
  • Project classifiers

Add these under the [project] table in pyproject.toml. Example:

[project]
name = "SMACT"
version = "3.0.2"
description = "Semiconducting Materials by Analogy and Chemical Theory"
requires-python = ">=3.10"
dependencies = [
    "scipy",
    "numpy<3",
    # ... other dependencies
]
🔗 Analysis chain

Verify completeness of setup.py migration.

The migration to pyproject.toml appears complete, but let's verify that no configurations were missed from the old setup.py.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any setup.py configurations that might need migration

# Look for the old setup.py in git history
echo "Checking setup.py configurations in last commit:"
git show HEAD^:setup.py 2>/dev/null || echo "setup.py not found in previous commit"

# Check for any remaining setup.py files
echo -e "\nChecking for any remaining setup.py files:"
fd "setup.py"

Length of output: 2733

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.47%. Comparing base (a92e123) to head (95a23b8).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #363   +/-   ##
========================================
  Coverage    75.47%   75.47%           
========================================
  Files           31       31           
  Lines         2642     2642           
========================================
  Hits          1994     1994           
  Misses         648      648           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AntObi AntObi merged commit eb7ef2a into develop Jan 14, 2025
14 checks passed
@AntObi AntObi deleted the drop_setup.py branch January 14, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping House-Keeping pkg Package Health
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant