Skip to content

Commit c2cfa1e

Browse files
committed
Added comprehensive unit tests
1 parent 50a5492 commit c2cfa1e

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ubuntu-latest]
21-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
20+
os: [ubuntu-latest, macos-latest]
21+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
2222

2323
steps:
2424
- name: Checkout code
@@ -65,7 +65,7 @@ jobs:
6565
6666
- name: Upload coverage to Codecov
6767
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
68-
uses: codecov/codecov-action@v3
68+
uses: codecov/codecov-action@v4
6969
with:
7070
file: ./coverage.xml
7171
flags: unittests
@@ -159,7 +159,7 @@ jobs:
159159
uses: actions/checkout@v4
160160

161161
- name: Set up Python
162-
uses: actions/setup-python@v4
162+
uses: actions/setup-python@v5
163163
with:
164164
python-version: '3.14'
165165

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ flake8 .
489489

490490
This project uses GitHub Actions for continuous integration. The CI pipeline:
491491

492-
- **Tests**: Runs on Python 3.8-3.12 across Ubuntu, macOS, and Windows
492+
- **Tests**: Runs on Python 3.8-3.14 across Ubuntu and macOS
493493
- **Security**: Runs bandit security checks and safety dependency checks
494494
- **Build**: Builds and validates the package
495495
- **Integration**: Tests CLI tools and package installation

himl/remote_state.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@
1010

1111
import json
1212

13+
# boto3 is imported only when needed to avoid requiring it for basic himl functionality
14+
boto3 = None
1315
try:
1416
import boto3
15-
except ImportError as e:
16-
raise Exception('Error while trying to read remote state, package "boto3" is required and cannot be imported: %s' % e)
17+
except ImportError:
18+
# boto3 will be None, and we'll raise an error only when S3 functionality is used
19+
pass
1720

1821
class S3TerraformRemoteStateRetriever:
1922
@staticmethod
2023
def get_s3_client(bucket_name, bucket_key, boto_profile):
24+
if boto3 is None:
25+
raise ImportError('boto3 package is required for S3 remote state functionality. Install with: pip install himl[aws]')
2126
session = boto3.session.Session(profile_name=boto_profile)
2227
client = session.client('s3')
2328
try:

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ classifiers = [
2222
"Programming Language :: Python :: 3.12",
2323
"Programming Language :: Python :: 3.13",
2424
"Programming Language :: Python :: 3.14",
25+
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
2527
"Topic :: Software Development :: Libraries :: Python Modules",
2628
"Topic :: System :: Systems Administration",
2729
"Topic :: Utilities",
2830
]
2931
requires-python = ">=3.9"
3032
dependencies = [
3133
"PyYAML>=5.1",
32-
"deepmerge>=0.1.0",
34+
"deepmerge>=1.1.1,<2.0",
3335
"pathlib2>=2.3.0",
3436
]
3537

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_readme = f.read()
88

99
_install_requires = [
10-
'deepmerge==1.1.1',
10+
'deepmerge>=1.1.1,<2.0',
1111
'lru_cache==0.2.3',
1212
'backports.functools_lru_cache==2.0.0',
1313
'pathlib2==2.3.7',

0 commit comments

Comments
 (0)