Skip to content

Remove pkg_resources from client version lookup#31

Draft
Mirochill wants to merge 1 commit into
Gr1N:masterfrom
Mirochill:fix-30-drop-pkg-resources
Draft

Remove pkg_resources from client version lookup#31
Mirochill wants to merge 1 commit into
Gr1N:masterfrom
Mirochill:fix-30-drop-pkg-resources

Conversation

@Mirochill
Copy link
Copy Markdown

@Mirochill Mirochill commented May 22, 2026

Purpose

Remove the import-time dependency on pkg_resources, fixing #30 for environments where recent setuptools no longer provides it.

Summary

  • replaced pkg_resources.get_distribution(nats-python) with importlib.metadata.version() when available
  • kept Python 3.6/3.7 compatibility by trying the importlib_metadata backport if it is already installed
  • added a fallback to the current package version string when package metadata cannot be read, so importing pynats from a source tree still works without pkg_resources

Validation

Not run locally.

Static validation performed:

  • git diff --check HEAD~1..HEAD
  • rg -n pkg_resources|get_distribution|resource_filename|resource_dir pynats tests pyproject.toml README.md (no matches)

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.

1 participant