Skip to content

Conversation

connorferster
Copy link
Collaborator

@connorferster connorferster commented Sep 8, 2025

Version is retrieved dynamically from the package after it is built by setup.py. This allows users to access the version of Pynite they have installed without @JWock82 having to manually update the version number in __init__.py whenever a new release is made.

Closes #273

In the long-term, I recommend moving away from setup.py to pyproject.toml where the version and description of the package can be dynamically retrieved from the __init__.py file (making the __init__.py file the source of truth and the package being built according to those values).

However, this is a quick fix that will allow users to easily check their Pynite version to aid in the diagnosis of potential incorrect values.

Version is retrieved dynamically from the package after it is built by setup.py. This allows users to access the version of Pynite they have installed without having to manually update the version whenever a new release is made.
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.52%. Comparing base (142633e) to head (788fd97).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #280      +/-   ##
==========================================
+ Coverage   60.49%   60.52%   +0.03%     
==========================================
  Files          22       22              
  Lines        7660     7666       +6     
==========================================
+ Hits         4634     4640       +6     
  Misses       3026     3026              
Flag Coverage Δ
unittests 60.52% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@JWock82 JWock82 merged commit e965df8 into JWock82:main Sep 9, 2025
6 checks passed
@JWock82
Copy link
Owner

JWock82 commented Sep 9, 2025

Thanks for this @connorferster

@SoundsSerious
Copy link
Contributor

@JWock82 @connorferster a bit late to the party on this one, but I've seen alot of projects switch over to using .toml pyproject format to set the authotative version number. Its easy to grab from the yaml without parsing or loading python code which I why i think its becoming the standard practice.

I've had a lot of luck with LLM's and dev ops. I think you could make this change with a prompt similar to "outline and implement changes to switch this python project from setup.py to a pyproject.toml. Review github actions and make changes to set the authoritative version number from the .toml file"

If i recall correctly setup.py will be depriciated at some point

@connorferster
Copy link
Collaborator Author

Yes, this is what I brought up above. It's not so much a matter of ability, I am happy and able to update the packaging, but @JWock82 is in the lead here and I don't want to submit an overhaul to the packaging just to get a small feature. It brings up questions of tooling, workflow, and opinions etc.

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.

__version__ should be populated in __init__.py
3 participants