Skip to content

Conversation

@harryswift01
Copy link
Contributor

Summary

This PR modernizes the project's packaging and execution structure by migrating to pyproject.toml and refining the entry point.

Changes

Packaging Updates

  • Implement pyproject.toml with relevant metadata from setup.py.
  • Remove legacy packaging files: setup.py, setup.cfg, and MANIFEST.in.
  • Add versioning info directly to __init__.py, removing versioneer and version_check.py.
  • Remove the devtools directory.

Executable and Entry Point Refactor

  • Define the main_mcc.py as an entry point in pyproject.toml.
  • Implement if __name__ == "__main__" for proper script execution.
  • Execution Logic Consolidation
  • Removal of the bin directory

Migrate all execution logic to main.py, ensuring it handles:

  • Processing CLI and file input.
  • Calling initialization and application entry-point functions.

Impact

  • Simplifies package management and installation using pyproject.toml.
  • Standardizes version management within __init__.py.
  • Improves script execution consistency and maintainability.
  • Enhances overall project structure by centralizing execution logic.

@harryswift01 harryswift01 requested a review from jimboid March 5, 2025 15:51
@harryswift01 harryswift01 self-assigned this Mar 5, 2025
…rg_dict is not needed. Removing arg_dict and replacing uses of it with args.variable_name.
@jimboid
Copy link
Member

jimboid commented Mar 5, 2025

@skfegan Please don't push to a branch that is being worked on actively by somebody else, especially when it is part of an ongoing PR that you are not a reviewer of. This time it is fine but there is a danger of introducing clashes on the repo, duplicating work and causing the code review to restart.

Copy link
Member

@jimboid jimboid left a comment

Choose a reason for hiding this comment

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

All looks good. There is just the script line in pyproject.toml that we should uncomment. The entry-point looks good. There is probably a consideration to be made here whether we call the exec:

CodeEntropy, codeentropy or code_entropy

I hate capitalisation in execs, though the all lower case looks a bit weird.

@harryswift01 harryswift01 marked this pull request as ready for review March 6, 2025 09:28
@harryswift01 harryswift01 merged commit d15d6b1 into main Mar 6, 2025
@harryswift01 harryswift01 deleted the 36-migrate-from-setuptools branch March 6, 2025 09:36
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.

Refactor Executable & Main Script Migrate from setuptools to flit (PEP 621)

4 participants