Importspy

Latest version: v0.1.11

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.1.11

Enhancements
- **Improved Error Messages for Validation:**
- Enhanced error messages for class methods, attributes, and superclass mismatches to provide clearer, more actionable feedback during validation.
- Added specific error messages for missing and mismatched functions, classes, attributes, and environment variables.

- **Modular Validation Refactoring:**
- Refactored the `is_subset` function for better modularity:
- Introduced helper functions `list_compare` and `dict_compare` to simplify validation logic and improve code readability.

How to Upgrade
Update to the latest version using pip:
bash
pip install --upgrade importspy

0.1.10

🔥 New Features:
- **Environment Variable Support**:
- You can now define `env_vars` as a dictionary in `SpyModel`, enabling validation of required environment variables and their values.
- Example:
python
env_vars: dict = {
"CI": "true",
"DATA_PATH": "/data/"
}


🔧 Improvements:
- **Enhanced Variables Validation**:
- Variables are now represented as a dictionary in `SpyModel` (`variables: dict`), allowing developers to validate both the names and the expected values of module-level variables.
- Example:
python
variables: dict = {
"default_timeout": "30",
"max_connections": "100"
}

- **`name` Field in Classes Now Mandatory**:
- The `name` field in `ClassModel` is now required, ensuring clarity and consistency in class validation.

---

How to Update:
1. Update your package:
bash
pip install --upgrade importspy

0.1.9

- **Proactive Validation Enhancements**: Enhanced the `is_subset` function to raise descriptive `ValueErrors` for each validation failure, improving the clarity and maintainability of error handling.
- **Documentation Updates**: Updated all documentation to reflect changes in code and added examples on how to handle new validation exceptions.

Continuous Integration Improvements
- **Python Package Testing Workflow**: Introduced a new GitHub Actions workflow to automate the testing process, ensuring that each push or pull request to the 'main' branch triggers a series of actions that validate the codebase across different environments and Python versions.
- Setup steps for Python environment and dependencies using Poetry.
- Code linting with flake8 to enforce coding standards and identify issues early.
- Automated tests with pytest to verify that new changes do not break existing functionalities.
- Documentation build using Sphinx to keep the project documentation up to date.

Documentation and README Updates
- **Enhanced Documentation**: Updated the documentation and README files to better reflect the current functionalities and how to implement the module within other projects.
- **Workflow Integration**: Detailed the inclusion of a new GitHub Actions workflow that automates testing across multiple Python versions (3.9, 3.10, 3.11, 3.12) to ensure compatibility and reliability.
- **Example Code Added**: New example codes and usage scenarios have been added to the documentation to assist users in understanding how to use the validation features effectively.

Other Improvements
- **Simplified File Path Extraction**: Refactored string handling to ensure compatibility with Python versions 3.9 to 3.11, making the codebase more future-proof.

Improvements
- Improved error message clarity in the validation process.

We encourage all users to update to this latest version to benefit from these improvements.

0.1.8

This release introduces the following changes:

Features:
- Added support for class and instance attributes in SpyModel and ClassModel.
- Implemented `extract_variables` to retrieve variables from modules.
- Enhanced `extract_classes` to extract class attributes, instance attributes, methods, and superclasses.

Documentation:
- Updated `README.rst` to reflect the new validation capabilities, including examples of variable, class, and instance attribute validation.

Version:
- Version bump to `0.1.8`.

0.1.7

ersion v0.1.7 brings significant improvements and optimizations to **ImportSpy**, including code restructuring, documentation enhancements, and new usage examples to streamline the adoption of the package.

---

Key Highlights

- **Documentation Improvements:**
- The README has been converted to `.rst` format for better compatibility with **Sphinx**.
- New usage examples have been added to demonstrate how to use **ImportSpy** in modular systems and plugin-based architectures.
- Documentation has been updated to version 0.1.7, including enhanced API references for better understanding.

- **Code Refactoring:**
- Code has been reorganized to improve readability and maintainability.
- Docstrings have been enhanced to adhere to Python and Sphinx standards, making it easier to automatically generate documentation.
- Removed outdated examples and migrated the README to `.rst` format.

- **New Import Validation Example:**
- A complete new example demonstrates how **ImportSpy** can enforce rules on modules importing your code.
- This example includes both rule definitions in `developer_code.py` and the implementation of those rules in `importing_module.py`.

---

How to Upgrade

To upgrade to the latest version of **ImportSpy**, run the following command:

bash
pip install --upgrade importspy

0.1.6

This release introduces significant improvements to ImportSpy:

- **SpyModel with Pydantic**: Enhanced validation using Pydantic for structured module metadata (filenames, versions, functions, classes).
- **Refactored Module Utilities**: Improved clarity and reorganization of utilities for module inspection and validation.
- **PluginSpy Enhancements**: Added functionality for better plugin and extension management.
- **Comprehensive Tests**: Expanded test coverage, including new validations and logging improvements.
- **Documentation Updates**: Improved examples, docstrings, and integration documentation.

This update focuses on better validation, clearer utilities, and enhanced testing.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.