Skip to content

Version 0.9.3#79

Merged
rsgalloway merged 15 commits intomasterfrom
v0.9.3
Dec 20, 2025
Merged

Version 0.9.3#79
rsgalloway merged 15 commits intomasterfrom
v0.9.3

Conversation

@rsgalloway
Copy link
Owner

@rsgalloway rsgalloway commented Dec 19, 2025

This pull request introduces several new features and improvements to the envstack project, with a focus on adding an interactive shell mode, enhancing environment variable handling, updating encryption logic, and improving documentation and test coverage. The most significant changes are grouped below.

New Interactive Shell Feature:

  • Added a new envshell command and --shell option to envstack, allowing users to launch an interactive shell with the environment stack loaded. This includes a new EnvshellWrapper class that detects and configures the shell appropriately for different platforms (lib/envstack/envshell.py, lib/envstack/cli.py, setup.py). [1] [2] [3] [4] [5]

Environment Variable and Configuration Updates:

  • Added platform-specific prompt variables (PS1 for Unix, PROMPT for Windows) to env/default.env and updated corresponding test expectations. Also updated the Windows ROOT path. [1] [2] [3] [4] [5] [6] [7]
  • Added a new env/project.env file as a template for project-specific environment settings.
  • Removed env/test.env, to reduce redundancy or simplify environment configuration.

Encryption and Security Improvements:

  • Improved handling of missing or unavailable cryptography libraries by setting Fernet = None and handling related logic more gracefully in lib/envstack/encrypt.py. Also, changed key generation to avoid using the Base64Node wrapper and improved error logging. [1] [2] [3] [4] [5]

CLI and Core Logic Enhancements:

  • Simplified argument parsing in the CLI, improved shell detection, and updated help/documentation text. [1] [2]
  • Changed the Source class in lib/envstack/env.py to use a defaultdict(dict) for self.data, and improved error handling when writing environment files. [1] [2] [3]
  • Minor improvements and bug fixes in YAML handling and process output logic. [1] [2] [3]

Documentation Updates:

  • Updated the README.md to clarify the difference between ENV (tier) and STACK (namespace), and improved instructions for encrypting and decrypting environment files. [1] [2]

Version Bump:

  • Bumped the version from 0.9.2 to 0.9.3 in both lib/envstack/__init__.py and setup.py. [1] [2]

@rsgalloway rsgalloway self-assigned this Dec 19, 2025
@rsgalloway rsgalloway added bug Something isn't working enhancement New feature or request labels Dec 19, 2025
@rsgalloway rsgalloway added this to the Version 0.9.3 milestone Dec 19, 2025
@rsgalloway rsgalloway linked an issue Dec 19, 2025 that may be closed by this pull request
@rsgalloway rsgalloway requested a review from Copilot December 19, 2025 23:53
@rsgalloway rsgalloway marked this pull request as ready for review December 19, 2025 23:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces version 0.9.3 of envstack with significant new features, particularly an interactive shell mode (envshell), alongside improvements to encryption handling, environment variable management, and documentation. The changes also include renaming test.env to project.env for better clarity about its purpose.

  • Added interactive shell feature with platform-specific shell detection and configuration
  • Improved encryption library handling to gracefully manage missing cryptography dependencies
  • Enhanced environment variable management with platform-specific prompt variables (PS1/PROMPT)

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/envstack/envshell.py New module implementing interactive shell wrapper with platform-specific shell detection
bin/envshell New executable entry point for the envshell command
bin/envshell.bat Windows batch wrapper for envshell
lib/envstack/cli.py Added --shell flag, envshell() function, and updated argument parsing
setup.py Version bump to 0.9.3 and added envshell console script entry point
lib/envstack/init.py Version bump to 0.9.3
lib/envstack/encrypt.py Improved handling of missing Fernet library and removed Base64Node wrapper from key generation
lib/envstack/env.py Changed Source.data to use defaultdict and added error handling to write method
lib/envstack/util.py Removed required keys validation for more flexible YAML structure
lib/envstack/node.py Added defensive str() conversion to prevent errors on non-string node values
lib/envstack/wrapper.py Updated comment to mark communicate() code as dead code for reference
env/default.env Added PS1 prompt for Unix systems and PROMPT for Windows, updated Windows ROOT path
env/project.env New template file replacing test.env with updated ENVPATH using STACK variable
env/test.env Removed (replaced by project.env)
tests/test_node.py Updated test to reference project.env instead of test.env
tests/test_env.py Updated tests to skip PS1 in comparisons and renamed test.env references to project.env
tests/test_cmds.py Updated all tests for new PS1 variable, Windows ROOT path, and project.env naming
README.md Clarified ENV vs STACK terminology and fixed encryption/decryption documentation
Comments suppressed due to low confidence (1)

lib/envstack/wrapper.py:135

  • The comment indicates this is dead code but it's still present in the codebase. If this code is truly unreachable after the exception handling above, it should be removed rather than kept with a comment. Dead code adds confusion and maintenance burden. If it's needed for reference, consider moving it to documentation or commit history instead.
            stdout, stderr = process.communicate()  # dead code, kept for reference
            while stdout and stderr:
                self.log.info(stdout)
                self.log.error(stderr)
            exitcode = process.poll()

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

@rsgalloway rsgalloway changed the title [WIP] Version 0.9.3 Version 0.9.3 Dec 20, 2025
@rsgalloway rsgalloway merged commit 6874fda into master Dec 20, 2025
@rsgalloway rsgalloway deleted the v0.9.3 branch December 20, 2025 01:18
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.

TypeError if keys are base64 encoded if fernet encryption not availble, then envstack raises a TypeError custom prompt strings

2 participants