Skip to content

Single-source package version via setuptools dynamic versioning#850

Open
anevolbap wants to merge 1 commit into
pymc-labs:mainfrom
anevolbap:issue_155-dynamic_version
Open

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

Conversation

@anevolbap

Copy link
Copy Markdown
Collaborator

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.

@read-the-docs-community

read-the-docs-community Bot commented Apr 15, 2026

Copy link
Copy Markdown

Documentation build overview

📚 causalpy | 🛠️ Build #33074668 | 📁 Comparing 8c7bed5 against latest (1cf3387)

  🔍 Preview build  

249 files changed · + 58 added · ± 190 modified · - 1 deleted

+ Added

± Modified

- Deleted

@codecov

codecov Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.14%. Comparing base (f2b082e) to head (8c7bed5).
⚠️ Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #850      +/-   ##
==========================================
+ Coverage   94.97%   95.14%   +0.17%     
==========================================
  Files          87       92       +5     
  Lines       13898    14860     +962     
  Branches      840      890      +50     
==========================================
+ Hits        13199    14138     +939     
- Misses        490      505      +15     
- Partials      209      217       +8     

☔ View full report in Codecov by Harness.
📢 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

anevolbap commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator Author

@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!

@drbenvincent

Copy link
Copy Markdown
Collaborator

Thanks @anevolbap — this is a clean, well-scoped change for #155. CI is green but the last run is from late April and the branch is now ~39 commits behind main, so those checks no longer validate against current packaging. Could you sync the branch with main (merge or rebase) so CI re-runs against the latest? Once it's green I'll review and we can get this merged.

@anevolbap anevolbap force-pushed the issue_155-dynamic_version branch from 9d13f20 to 8c7bed5 Compare June 10, 2026 12:13
@anevolbap

anevolbap commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

> Thanks @anevolbap — this is a clean, well-scoped change for #155. CI is green but the last run is from late April and the branch is now ~39 commits behind main, so those checks no longer validate against current packaging. Could you sync the branch with main (merge or rebase) so CI re-runs against the latest? Once it's green I'll review and we can get this merged.

Green, ready to merge.

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

2 participants