Skip to content

Single-source package version via setuptools dynamic versioning#850

Open
anevolbap wants to merge 2 commits into
pymc-labs:mainfrom
anevolbap:issue_155-dynamic_version
Open

Single-source package version via setuptools dynamic versioning#850
anevolbap wants to merge 2 commits into
pymc-labs:mainfrom
anevolbap:issue_155-dynamic_version

Conversation

@anevolbap
Copy link
Copy Markdown
Contributor

Summary

Single-source the package version from causalpy/version.py using setuptools dynamic versioning. Removes the duplicate version = "0.8.0" from pyproject.toml.

Fixes #155

Changes

  • Replace static version in [project] with dynamic = ["version"]
  • Add [tool.setuptools.dynamic] section pointing to causalpy.version.__version__

Testing

  • pip install -e . resolves version correctly
  • python -c "import causalpy; print(causalpy.__version__)" returns 0.8.0
  • importlib.metadata.metadata('CausalPy')['Version'] returns 0.8.0
  • All pre-commit hooks pass (--all-files)
  • Full test suite passes (799 passed, 5 skipped)

Checklist

  • No new dependencies
  • Pre-commit hooks pass
  • Editable install works
  • Package metadata resolves correctly

@github-actions
Copy link
Copy Markdown
Contributor

👋 Welcome to CausalPy, @anevolbap!

Thank you for opening your first pull request! We're excited to have you contribute to the project. 🎉

Here are a few tips to help your PR get merged smoothly:

  • ✅ Make sure all CI checks pass (tests, linting, type checking)
  • 📝 Run prek run --all-files locally before pushing
  • 📖 Check our Contributing Guide for more details

A maintainer will review your changes soon. Thanks for helping make CausalPy better! 🚀


💼 LinkedIn Shoutout: Once your PR is merged, we'd love to give you a shoutout on LinkedIn to thank you for your contribution! If you're interested, just drop your LinkedIn profile URL in a comment below.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.59%. Comparing base (deb8774) to head (9d13f20).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #850      +/-   ##
==========================================
- Coverage   94.60%   94.59%   -0.02%     
==========================================
  Files          80       80              
  Lines       12764    12764              
  Branches      770      770              
==========================================
- Hits        12076    12074       -2     
- Misses        485      486       +1     
- Partials      203      204       +1     

☔ 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.

@anevolbap anevolbap marked this pull request as draft April 16, 2026 10:59
@anevolbap anevolbap marked this pull request as ready for review April 25, 2026 20:02
@anevolbap
Copy link
Copy Markdown
Contributor Author

anevolbap commented Apr 25, 2026

@drbenvincent this is ready for review. CI fully green.

Heads-up on the approach choice: the #155 thread floated flit, setuptools-scm, and bump2version. This PR sticks with the existing setuptools backend and just adds [tool.setuptools.dynamic]. Minimal change, no backend migration. Both read paths verified: causalpy.__version__ and importlib.metadata.metadata('CausalPy')['Version'] return 0.8.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

try to get dynamic version in pyproject.toml

1 participant