Skip to content

Commit 7c727d6

Browse files
committed
Downgrade to python 3.10
Signed-off-by: Rahul Krishna <[email protected]>
1 parent cb4fec1 commit 7c727d6

File tree

8 files changed

+44
-160
lines changed

8 files changed

+44
-160
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source .venv/bin/activate

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.1] - 2025-07-14
9+
10+
### Changed
11+
- **BREAKING CHANGE**: Updated Python version requirement from `>=3.12` to `==3.10` for improved backwards compatibility
12+
- Enhanced backwards compatibility by supporting Python 3.10 environments commonly used in enterprise and CI/CD systems
13+
14+
### Fixed
15+
- Fixed Python version compatibility issue that was unnecessarily blocking installation on Python 3.10 and 3.11 systems
16+
- Resolved adoption barriers for users on older but still supported Python versions
17+
18+
### Technical Notes
19+
- All codebase features are fully compatible with Python 3.10 (ast.unparse, built-in generics, type hints)
20+
- No Python 3.11+ or 3.12+ specific features are used in the implementation
21+
- All dependencies support Python 3.10+
22+
23+
## [0.2.0] - 2025-07-11
24+
25+
### Changed
26+
- **BREAKING CHANGE**: Renamed `AnalyzerCore` class to `Codeanalyzer` for better library naming consistency
27+
- Refactored core class to support direct library import: `from codeanalyzer import Codeanalyzer`
28+
- Updated all internal references and documentation to use the new class name
29+
- Enhanced library interface for programmatic usage while maintaining CLI compatibility
30+
31+
### Added
32+
- Direct library import support allowing users to import and use `Codeanalyzer` as a library
33+
- Proper `__all__` export in `__init__.py` for clean package interface
34+
835
## [0.1.5] - 2025-07-11
936

1037
### Fixed

RELEASE.md

Lines changed: 0 additions & 146 deletions
This file was deleted.

codeanalyzer/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Python code analyzer library."""
2+
3+
from codeanalyzer.core import Codeanalyzer
4+
5+
__all__ = ["Codeanalyzer"]

codeanalyzer/__main__.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
from pathlib import Path
22
from typing import Annotated, Optional
3-
from enum import Enum
43

54
import typer
65

7-
from codeanalyzer.core import AnalyzerCore
6+
from codeanalyzer.core import Codeanalyzer
87
from codeanalyzer.utils import _set_log_level, logger
9-
10-
11-
class OutputFormat(str, Enum):
12-
JSON = "json"
13-
MSGPACK = "msgpack"
8+
from codeanalyzer.config import OutputFormat, AnalysisOptions, CLIOptions
149

1510

1611
def main(
@@ -67,7 +62,7 @@ def main(
6762
logger.error(f"Input path '{input}' does not exist.")
6863
raise typer.Exit(code=1)
6964

70-
with AnalyzerCore(
65+
with Codeanalyzer(
7166
input, analysis_level, using_codeql, rebuild_analysis, cache_dir, clear_cache
7267
) as analyzer:
7368
artifacts = analyzer.analyze()

codeanalyzer/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from codeanalyzer.utils import logger
1414

1515

16-
class AnalyzerCore:
16+
class Codeanalyzer:
1717
"""Core functionality for CodeQL analysis.
1818
1919
Args:
@@ -196,7 +196,7 @@ def _get_base_interpreter() -> Path:
196196
f"a working Python interpreter that can create virtual environments."
197197
)
198198

199-
def __enter__(self) -> "AnalyzerCore":
199+
def __enter__(self) -> "Codeanalyzer":
200200
# If no virtualenv is provided, try to create one using requirements.txt or pyproject.toml
201201
venv_path = self.cache_dir / self.project_dir.name / "virtualenv"
202202
# Ensure the cache directory exists for this project

codeanalyzer/syntactic_analysis/symbol_table_builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,9 @@ def build_param(
503503

504504
return params
505505

506-
def _accessed_symbols(self, fn_node: ast.FunctionDef, script: Script) -> List[str]:
506+
def _accessed_symbols(
507+
self, fn_node: ast.FunctionDef, script: Script
508+
) -> List[PySymbol]:
507509
"""Analyzes the function body to extract all accessed symbols."""
508510
symbols = []
509511
for node in ast.walk(fn_node):

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "codeanalyzer-python"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
description = "Static Analysis on Python source code using Jedi, CodeQL and Treesitter."
55
readme = "README.md"
66
authors = [
77
{ name = "Rahul Krishna", email = "[email protected]" }
88
]
9-
requires-python = ">=3.12"
9+
requires-python = "==3.10"
1010

1111
dependencies = [
1212
"jedi>=0.19.2",
@@ -86,4 +86,4 @@ exclude_lines = [
8686
]
8787

8888
[tool.coverage.html]
89-
directory = "htmlcov"
89+
directory = "htmlcov"

0 commit comments

Comments
 (0)