Skip to content

Fix DeprecationWarning on import, switch to hatchling build system#128

Merged
brews merged 4 commits intomainfrom
hatch_version_fix
Aug 10, 2023
Merged

Fix DeprecationWarning on import, switch to hatchling build system#128
brews merged 4 commits intomainfrom
hatch_version_fix

Conversation

@brews
Copy link
Copy Markdown
Member

@brews brews commented Aug 9, 2023

This fixes the DeprecationWarning about the pkg_resources package when dscim is imported. The warning comes from the system used to get the package version into dscim.__version__. With this fix, the version info is written to src/dscim/_version.py whenever the package is built by hatchling, and src/dscim/__init__.py. does from dscim._version import __version__ and that's it.

This switches the build system from setuptools to hatchling. This is an internal change. Generally, people shouldn't notice this change. We prob would have switched build systems at some point anyways so might as well do it here.

Close #112

@brews brews added bug Something isn't working enhancement New feature or request labels Aug 9, 2023
@brews brews self-assigned this Aug 9, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 9, 2023

Codecov Report

Merging #128 (fc6f500) into main (edf4e1b) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ Current head fc6f500 differs from pull request most recent head fbd2cbc. Consider uploading reports for the commit fbd2cbc to get more accurate results

@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
+ Coverage   65.27%   65.29%   +0.01%     
==========================================
  Files          17       17              
  Lines        1846     1841       -5     
==========================================
- Hits         1205     1202       -3     
+ Misses        641      639       -2     
Files Changed Coverage Δ
src/dscim/__init__.py 38.46% <ø> (-0.99%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@brews brews marked this pull request as ready for review August 9, 2023 17:38
Need this to keep `dscim.__version__`.
@brews brews requested a review from kemccusker August 9, 2023 18:47
@brews brews merged commit f6e8e7f into main Aug 10, 2023
@brews brews deleted the hatch_version_fix branch August 10, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deal with deprecated pkg_resources API

2 participants