Importspy

Latest version: v0.1.12

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

Scan your dependencies

Page 1 of 2

0.1.12

Changelog:
- **Dependency Updates**:
- **Pydantic**: Updated from `2.10.3` to `2.10.4`.
- Includes bug fixes and compatibility improvements. Notable changes:
- Resolved an `AttributeError` when using data classes with `defer_build=True`.
- Fixed URL compatibility issues between versions `2.9.2` and `2.10.X`.
- Details: [GitHub Issues](https://github.com/pydantic/pydantic/issues/10910)
- **Jinja2**: Updated from `3.1.4` to `3.1.5`.
- Introduced critical security fixes and minor bug resolutions to enhance stability.
- Details: [New Releases](https://newreleases.io/project/pypi/Jinja2/release/3.1.5)
- **Pytest**: Updated from `8.3.3` to `8.3.4`.
- General improvements and bug fixes for the Python testing framework.
- **Sphinx-rtd-theme**: Updated from `3.0.1` to `3.0.2`.
- Minor updates to improve the style and functionality of Sphinx-generated documentation.

- **Why Upgrade?**
This release ensures a more stable, secure, and feature-rich environment. Dependency updates address known issues and provide important improvements.

For further details, see the links provided for specific dependency updates.

0.1.11

Not secure
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

Not secure
🔥 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

Not secure
- **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

Not secure
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

Not secure
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

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.