Skip to content

Conversation

@darshdinger
Copy link
Contributor

@darshdinger darshdinger commented Oct 8, 2025

Description of the changes

This PR modernizes the Python packaging configuration for all three applications in the data_workflow repository by migrating from the deprecated setup.cfg format to the current standard pyproject.toml format, following PEP 518 and PEP 621 specifications.

Changes Made

  • dasmon_app: Migrated package metadata and two console script entry points (dasmon_listener, reduction_update) to pyproject.toml
  • webmon_app: Migrated package metadata and package data specifications (SQL files, fixtures, templates, static assets) to pyproject.toml
  • workflow_app: Migrated package metadata and console script entry point (workflowmgr) to pyproject.toml
  • Removed deprecated setup.cfg files from all three packages
  • Updated Python requirement from >=3.7 to >=3.10 to align with current standards
  • Updated documentation to reference pyproject.toml instead of setup.cfg
  • Added packaging configuration section to developer documentation

All three packages build successfully with identical functionality. Entry points work correctly, and package data is properly included.

Check all that apply:

  • updated documentation
  • Source added/refactored
  • Added unit tests
  • Added integration tests
  • (If applicable) Verified that manual tests requiring the /SNS and /HFIR filesystems pass without fail

References:

⚠️ Manual test for the reviewer

  1. Verify all wheels build successfully:
    make wheel/clean
    make wheel/all
  2. Check that wheels are created in each package's dist/ directory:
    ls -lh src/*/dist/*.whl
  3. Verify entry points are correctly configured:
    unzip -p src/dasmon_app/dist/django_nscd_dasmon-*.whl django_nscd_dasmon-*/entry_points.txt
    unzip -p src/workflow_app/dist/django_nscd_workflow-*.whl django_nscd_workflow-*/entry_points.txt
  4. Confirm package metadata is correct:
    unzip -p src/webmon_app/dist/django_nscd_webmon-*.whl django_nscd_webmon-*/METADATA | head -20
  5. (Optional) Test local deployment to ensure Docker containers build and run correctly with the new wheels

Check list for the reviewer

  • best software practices
    • clearly named variables (better to be verbose in variable names)
    • code comments explaining the intent of code blocks
  • All the tests are passing
  • The documentation is up to date
  • code comments added when explaining intent

@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.67%. Comparing base (af8264a) to head (c2e94ae).

Additional details and impacted files
@@           Coverage Diff           @@
##             next     #275   +/-   ##
=======================================
  Coverage   82.67%   82.67%           
=======================================
  Files          60       60           
  Lines        4434     4434           
=======================================
  Hits         3666     3666           
  Misses        768      768           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@darshdinger
Copy link
Contributor Author

darshdinger commented Oct 20, 2025

I have addressed the comments you left above. I've regressively tested by building the package and haven't noticed any warnings or errors left. Please let me know if you are still seeing anything on your end. Thanks!

@backmari
Copy link
Contributor

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

✅ Actions performed

Full review triggered.

1 similar comment
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

📝 Walkthrough

Walkthrough

This pull request migrates packaging configuration for three Python packages (dasmon_app, webmon_app, workflow_app) from setup.cfg files into per-package pyproject.toml files. Each package now declares a [project] table (metadata, dynamic versioning, Python requirement, license, classifiers), optional test dependencies, setuptools packaging/find settings, and VersioningIt configuration (vcs, next-version, format, write). The original setup.cfg files are removed. Documentation is updated with a new "Python package configuration" section and per-package wheel build notes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Modernize Python packaging: migrate from setup.cfg to pyproject.toml" directly and accurately reflects the primary change in the changeset. The title is concise, clear, and specific—it immediately conveys to a teammate scanning the history that the PR involves migrating packaging configuration from setup.cfg to pyproject.toml across the three applications. The title avoids vague language and noise, and it fully captures the essence of the work without needing to enumerate every detail.
Description Check ✅ Passed The pull request description is comprehensive and well-structured, following the provided template closely. It includes all major required sections: a detailed "Description of the changes" explaining the migration to pyproject.toml, a "Changes Made" section specifying what was migrated for each application, properly checked checkboxes indicating the types of changes made, a "References" section with links to EWM-13217 and the related standards, detailed "Manual test for the reviewer" instructions with specific commands and verification steps, and a completed "Check list for the reviewer" with all assessment criteria addressed. The description is neither vague nor generic; it provides concrete information about the migration, Python version updates, and testing verification.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ewm13217-replace-setup.cfg

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af8264a and d93ca24.

📒 Files selected for processing (7)
  • docs/developer/instruction/build.rst (1 hunks)
  • src/dasmon_app/pyproject.toml (1 hunks)
  • src/dasmon_app/setup.cfg (0 hunks)
  • src/webmon_app/pyproject.toml (1 hunks)
  • src/webmon_app/setup.cfg (0 hunks)
  • src/workflow_app/pyproject.toml (1 hunks)
  • src/workflow_app/setup.cfg (0 hunks)
💤 Files with no reviewable changes (3)
  • src/workflow_app/setup.cfg
  • src/webmon_app/setup.cfg
  • src/dasmon_app/setup.cfg
🔇 Additional comments (10)
src/workflow_app/pyproject.toml (4)

5-18: ✓ Project metadata configured correctly.


26-31: ✓ Setuptools package discovery configured appropriately.


20-24: Entry point target verified and properly defined.

The module workflow.sns_post_processing exists with a run() function correctly defined to handle command-line arguments via argparse. The entry point declaration is valid.


45-46: No issues found; versioningit configuration is correct.

All versioningit write target paths are properly configured and will function correctly. The parent directories (workflow/, dasmon_listener/, reporting/) exist as valid Python packages with __init__.py files, and all generated _version.py files are correctly listed in .gitignore. The configuration is sound.

src/dasmon_app/pyproject.toml (2)

5-18: ✓ Project metadata configured correctly.


27-31: ✓ Setuptools package discovery configured appropriately.

src/webmon_app/pyproject.toml (2)

5-27: ✓ Project metadata and setuptools configuration correct.

The include-package-data = true setting is appropriate for this package given its SQL files, templates, and static assets. The unqualified exclude pattern ["tests*"] differs from the qualified patterns in other packages (workflow.tests*, dasmon_listener.tests*) but is appropriate for this package structure.


29-40: Now I'll create a verification script to check the directory structure and configuration:

Now let me verify the package structure and configuration:

Let me run a final verification script to check the complete package structure:Based on my verification, I can now generate the rewritten review comment. Here are the key findings:

  1. Setuptools now supports recursive globs, using **, in package_data (as of v62.3.0, released May 2022)
  2. All glob patterns in the configuration match actual files in the reporting/ directory (verified via script execution)
  3. W002 — Wheel contains duplicate files is a valid concern for Django apps with migrations
  4. W004 = "Module is not located at importable path", not specifically about Django migrations as the original comment stated

The configuration is sound with correctly functioning patterns and appropriate warning suppressions for a Django application.


Package data configuration is correct; recursive globs are properly supported and all patterns match existing files.

Recursive glob patterns using ** in package_data are supported since setuptools v62.3.0 (May 2022). Verification confirms all specified patterns match files in the reporting/ directory:

  • SQL files present in dasmon/sql/, pvmon/sql/, report/sql/
  • Fixture present: db_init.json
  • Static and template assets present with subdirectories

The check-wheel-contents configuration appropriately ignores W002 (duplicate files from Django migrations) and W004 (module import path issues), which is standard for Django applications.

docs/developer/instruction/build.rst (2)

78-82: ✓ Unit test section correctly updated to reference pyproject.toml.

The documentation now accurately reflects that the unit test configuration is in the root-level pyproject.toml rather than setup.cfg.


53-76: ✓ Documentation is accurate and all make targets verified.

All four wheel-building make targets referenced in the documentation exist and are correctly configured in the Makefile (lines 42, 48, 54, 60). The build instructions provided are actionable and consistent with the actual build system.

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)
src/dasmon_app/pyproject.toml (1)

30-31: Setuptools exclude pattern differs from webmon_app.

This package uses exclude = ["dasmon_listener.tests*"] (dotted module path) while webmon_app uses the simplified glob pattern exclude = ["tests*"]. Both are valid, but for consistency across the three packages in this PR, consider standardizing on one format. The simplified glob pattern is generally preferred unless your package structure requires the more explicit dotted path form.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af8264a and d93ca24.

📒 Files selected for processing (7)
  • docs/developer/instruction/build.rst (1 hunks)
  • src/dasmon_app/pyproject.toml (1 hunks)
  • src/dasmon_app/setup.cfg (0 hunks)
  • src/webmon_app/pyproject.toml (1 hunks)
  • src/webmon_app/setup.cfg (0 hunks)
  • src/workflow_app/pyproject.toml (1 hunks)
  • src/workflow_app/setup.cfg (0 hunks)
💤 Files with no reviewable changes (3)
  • src/workflow_app/setup.cfg
  • src/dasmon_app/setup.cfg
  • src/webmon_app/setup.cfg
🔇 Additional comments (6)
src/workflow_app/pyproject.toml (2)

20-21: Entry point configuration looks correct.

The single console script entry point is properly configured and targeting workflow.sns_post_processing:run should resolve correctly.


26-31: Setuptools configuration is appropriate.

The include-package-data = false setting is suitable for this package since it contains only Python source code with no data files, and the exclude pattern correctly targets test packages.

src/webmon_app/pyproject.toml (2)

39-40: Wheel contents ignores are appropriately justified.

Ignoring W004 (Django migrations) is standard for Django apps. The W002 (duplicate files) ignore should be acceptable if intentional—ensure there's a legitimate reason for duplicate files in the wheel.


29-37: All package-data paths verified and correctly configured.

The verification confirms that all specified paths in the [tool.setuptools.package-data] section exist and contain the expected files:

  • SQL files: 6 total across dasmon, pvmon, and report
  • Fixtures: db_init.json present
  • Static assets: 80 files
  • Templates: 29 files

The pyproject.toml configuration is correct and requires no changes.

docs/developer/instruction/build.rst (2)

53-77: Documentation update is clear and well-organized.

The new "Python package configuration" section provides helpful guidance for developers on the three packages, their build process, and packaging standards. The section is well-written and includes practical examples of the build commands.


75-76: Note dependency on dasmon_app entry point resolution.

The documentation correctly describes the new packaging structure and Docker wheel usage. However, ensure the critical entry point issue flagged in src/dasmon_app/pyproject.toml (reduction_update targeting a non-existent module) is resolved before merging, as it will cause runtime failures for users who attempt to use that command.

Comment on lines 20 to 22
[project.scripts]
dasmon_listener = "dasmon_listener.dasmon_listener:run"
reduction_update = "dasmon_listener.reduction_script_update:run"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🔴 Critical: Entry point targets non-existent module.

The reduction_update entry point on Line 22 references dasmon_listener.reduction_script_update:run, but this module does not exist in the codebase (verified in previous review). This entry point will fail at runtime when invoked.

Action required: Either:

  1. Implement the missing module src/dasmon_app/dasmon_listener/reduction_script_update.py with a public run() callable, or
  2. Remove the reduction_update entry point if the feature is not yet ready for release.

After resolving this, verify the entry points work by installing the package locally and testing both commands:


🏁 Script executed:

pip install -e src/dasmon_app/
dasmon_listener --help
reduction_update --help  # This will fail until the module is implemented

Length of output: 1655


The pip installation succeeded and both entry points were registered successfully. This indicates the modules likely exist. Let me verify:Now let me search the codebase directly to verify if the module exists:


🏁 Script executed:

#!/bin/bash
# Check if reduction_script_update.py exists
find src/dasmon_app -name "reduction_script_update.py" -type f

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Also list the structure of dasmon_listener directory to verify what modules exist
ls -la src/dasmon_app/dasmon_listener/ 2>/dev/null || echo "Directory not found"

Length of output: 550


🏁 Script executed:

#!/bin/bash
# Search for any references to reduction_script_update in the codebase
rg -i "reduction_script_update" src/dasmon_app/

Length of output: 217


🏁 Script executed:

#!/bin/bash
# Verify the content of pyproject.toml entry points
cat src/dasmon_app/pyproject.toml | grep -A 2 "\[project.scripts\]"

Length of output: 138


🏁 Script executed:

#!/bin/bash
# Look for any Python function named 'run' in files within dasmon_listener
rg -n "^\s*def run\s*\(" src/dasmon_app/dasmon_listener/

Length of output: 63


🏁 Script executed:

#!/bin/bash
# Check specifically for dasmon_listener.py with a run function
cat src/dasmon_app/dasmon_listener/dasmon_listener.py | head -50

Length of output: 1283


🏁 Script executed:

#!/bin/bash
# Look at the exact content generated in the entry points during build
cat src/dasmon_app/pyproject.toml

Length of output: 1292


🏁 Script executed:

#!/bin/bash
# Search for any __main__.py or main functions
fd "(__main__|main)" src/dasmon_app/dasmon_listener --type f

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Try to understand if modules are created dynamically or missing
find src/dasmon_app/dasmon_listener -name "*.py" | sort

Length of output: 299


🏁 Script executed:

#!/bin/bash
# Attempt to trace what happens when entry point is called
python3 -c "from dasmon_listener.reduction_script_update import run; print('SUCCESS')" 2>&1 || echo "Failed to import"

Length of output: 169


🏁 Script executed:

#!/bin/bash
# Check if there are any recent git changes related to this
git log --oneline -20 -- "*reduction*" 2>/dev/null || echo "Git history unavailable"

Length of output: 1084


🏁 Script executed:

#!/bin/bash
# List all Python files in the package
find src/dasmon_app -name "*.py" -type f | head -20

Length of output: 299


🔴 Critical: Entry point targets non-existent module—verification confirms the issue.

The reduction_update entry point on lines 20-22 references dasmon_listener.reduction_script_update:run, but the module does not exist in the codebase. Direct import test confirms: ModuleNotFoundError: No module named 'dasmon_listener.reduction_script_update'. The entry point will fail when invoked.

Action required: Either:

  1. Implement src/dasmon_app/dasmon_listener/reduction_script_update.py with a public run() callable, or
  2. Remove the reduction_update entry point from lines 20-22 if the feature is not ready for release.
🤖 Prompt for AI Agents
In src/dasmon_app/pyproject.toml around lines 20 to 22, the [project.scripts]
entry reduction_update points to a non-existent module
dasmon_listener.reduction_script_update:run which causes ModuleNotFoundError;
either add src/dasmon_app/dasmon_listener/reduction_script_update.py exporting a
public run() function (implementing the intended behavior and tests), or remove
the reduction_update entry from pyproject.toml to prevent a broken entry point
before the feature is implemented.

@darshdinger darshdinger merged commit fed070d into next Oct 20, 2025
4 checks passed
@darshdinger darshdinger deleted the ewm13217-replace-setup.cfg branch October 20, 2025 16:38
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