Skip to content

Fix EnvVar template parsing on Python 3.14#116

Merged
rsgalloway merged 4 commits into
masterfrom
issue115/python314-compatibility
Jul 23, 2026
Merged

Fix EnvVar template parsing on Python 3.14#116
rsgalloway merged 4 commits into
masterfrom
issue115/python314-compatibility

Conversation

@rsgalloway

@rsgalloway rsgalloway commented Jul 23, 2026

Copy link
Copy Markdown
Owner

This pull request updates the project to support Python 3.14 and improves compatibility and test reliability across Python versions. It adds Python 3.14 to the test matrix and metadata, addresses compatibility issues with Python 3.14 and 3.8, and makes test discovery more robust. The following are the most important changes:

Bumps version to 1.0.3.

Python 3.14 Support and Compatibility:

  • Added Python 3.14 to the GitHub Actions test matrix in .github/workflows/tests.yml and updated the CHANGELOG.md to reflect this addition. [1] [2]
  • Updated pyproject.toml to include Python 3.14 in the classifiers and to set the package version to 1.0.3 in both pyproject.toml and lib/envstack/__init__.py. [1] [2] [3]
  • Restored Python 3.14 compatibility in EnvVar.vars() by avoiding direct access to string.Template internals that now raise errors under Python 3.14.

Python 3.8 Compatibility and Dependency Management:

  • Constrained the cryptography dependency to <47 for Python 3.8 in pyproject.toml to avoid incompatibilities, while allowing newer versions for Python 3.9+.
  • Suppressed the cryptography Python 3.8 deprecation warning during import in lib/envstack/encrypt.py to keep the CLI and tests quiet on supported 3.8 installs. [1] [2]

Test Suite Improvements:

  • Limited pytest test discovery to the tests/ directory and excluded the tmp/ directory to prevent accidental test collection from helper files, as configured in pytest.ini.

@rsgalloway rsgalloway linked an issue Jul 23, 2026 that may be closed by this pull request
@rsgalloway rsgalloway self-assigned this Jul 23, 2026
@rsgalloway rsgalloway added the bug Something isn't working label Jul 23, 2026
@rsgalloway rsgalloway changed the title Fix EnvVar template parsing on Python 3.14 and test 3.14 in CI Fix EnvVar template parsing on Python 3.14 Jul 23, 2026
@rsgalloway
rsgalloway marked this pull request as ready for review July 23, 2026 13:01
@rsgalloway
rsgalloway requested a review from Copilot July 23, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates envstack to support Python 3.14 and improves cross-version compatibility (notably Python 3.8) by adjusting template parsing behavior, dependency markers, and test discovery/configuration.

Changes:

  • Add Python 3.14 to CI and published metadata (classifiers), and bump version to 1.0.3.
  • Fix EnvVar.vars() to avoid string.Template access patterns that error on Python 3.14.
  • Improve test reliability by constraining pytest discovery to tests/ and excluding tmp/, and silence a Python 3.8 cryptography deprecation warning during import.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pytest.ini Restricts pytest discovery to tests/ and avoids collecting from tmp/.
pyproject.toml Bumps version, adds Python 3.14 classifier, and constrains cryptography on Python 3.8.
lib/envstack/env.py Adjusts variable extraction to avoid Python 3.14 template parsing issues.
lib/envstack/encrypt.py Suppresses Python 3.8 cryptography import warning for cleaner CLI/tests.
lib/envstack/init.py Bumps library version constant to 1.0.3.
CHANGELOG.md Documents changes/fixes for release 1.0.3.
.gitignore Ignores additional local agent/tool directories/files.
.github/workflows/tests.yml Extends CI matrix to include Python 3.14.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/envstack/encrypt.py
@rsgalloway
rsgalloway merged commit a498493 into master Jul 23, 2026
42 checks passed
@rsgalloway
rsgalloway deleted the issue115/python314-compatibility branch July 23, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error test with Python 3.14

2 participants