aws-simple 0.1.0b0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aws_simple-0.1.0b0/.dockerignore +63 -0
- aws_simple-0.1.0b0/.env.example +24 -0
- aws_simple-0.1.0b0/.github/workflows/ci.yml +111 -0
- aws_simple-0.1.0b0/.github/workflows/publish.yml +59 -0
- aws_simple-0.1.0b0/.gitignore +207 -0
- aws_simple-0.1.0b0/.pre-commit-config.yaml +38 -0
- aws_simple-0.1.0b0/CONTRIBUTING.md +220 -0
- aws_simple-0.1.0b0/DEPLOYMENT.md +330 -0
- aws_simple-0.1.0b0/Dockerfile +39 -0
- aws_simple-0.1.0b0/LICENSE +201 -0
- aws_simple-0.1.0b0/MANIFEST.in +13 -0
- aws_simple-0.1.0b0/Makefile +62 -0
- aws_simple-0.1.0b0/PKG-INFO +309 -0
- aws_simple-0.1.0b0/README.md +281 -0
- aws_simple-0.1.0b0/docker-compose.yml +25 -0
- aws_simple-0.1.0b0/examples/usage_example.py +170 -0
- aws_simple-0.1.0b0/pyproject.toml +75 -0
- aws_simple-0.1.0b0/pytest.ini +15 -0
- aws_simple-0.1.0b0/src/aws_simple/__init__.py +54 -0
- aws_simple-0.1.0b0/src/aws_simple/_clients.py +69 -0
- aws_simple-0.1.0b0/src/aws_simple/_parsers/__init__.py +5 -0
- aws_simple-0.1.0b0/src/aws_simple/_parsers/textract_parser.py +192 -0
- aws_simple-0.1.0b0/src/aws_simple/bedrock.py +169 -0
- aws_simple-0.1.0b0/src/aws_simple/config.py +71 -0
- aws_simple-0.1.0b0/src/aws_simple/exceptions.py +37 -0
- aws_simple-0.1.0b0/src/aws_simple/models/__init__.py +10 -0
- aws_simple-0.1.0b0/src/aws_simple/models/textract.py +82 -0
- aws_simple-0.1.0b0/src/aws_simple/s3.py +154 -0
- aws_simple-0.1.0b0/src/aws_simple/textract.py +179 -0
- aws_simple-0.1.0b0/tests/__init__.py +1 -0
- aws_simple-0.1.0b0/tests/conftest.py +163 -0
- aws_simple-0.1.0b0/tests/test_bedrock.py +234 -0
- aws_simple-0.1.0b0/tests/test_config.py +64 -0
- aws_simple-0.1.0b0/tests/test_s3.py +187 -0
- aws_simple-0.1.0b0/tests/test_textract.py +209 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Git
|
|
2
|
+
.git
|
|
3
|
+
.gitignore
|
|
4
|
+
.github
|
|
5
|
+
|
|
6
|
+
# Python
|
|
7
|
+
__pycache__
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*$py.class
|
|
10
|
+
*.so
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.tox/
|
|
34
|
+
|
|
35
|
+
# Environment
|
|
36
|
+
.env
|
|
37
|
+
.venv
|
|
38
|
+
env/
|
|
39
|
+
venv/
|
|
40
|
+
ENV/
|
|
41
|
+
env.bak/
|
|
42
|
+
venv.bak/
|
|
43
|
+
|
|
44
|
+
# IDE
|
|
45
|
+
.vscode/
|
|
46
|
+
.idea/
|
|
47
|
+
*.swp
|
|
48
|
+
*.swo
|
|
49
|
+
*~
|
|
50
|
+
|
|
51
|
+
# Documentation
|
|
52
|
+
docs/
|
|
53
|
+
*.md
|
|
54
|
+
!README.md
|
|
55
|
+
|
|
56
|
+
# Examples and tests
|
|
57
|
+
examples/
|
|
58
|
+
tests/
|
|
59
|
+
|
|
60
|
+
# CI/CD
|
|
61
|
+
.github/
|
|
62
|
+
Makefile
|
|
63
|
+
docker-compose.yml
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AWS Configuration for aws-simple library
|
|
2
|
+
|
|
3
|
+
# Required: AWS Region
|
|
4
|
+
AWS_REGION=us-east-1
|
|
5
|
+
|
|
6
|
+
# Optional: AWS Profile (for local development with multiple profiles)
|
|
7
|
+
# AWS_PROFILE=my-profile
|
|
8
|
+
|
|
9
|
+
# Required: Default S3 bucket name
|
|
10
|
+
AWS_S3_BUCKET=my-bucket-name
|
|
11
|
+
|
|
12
|
+
# Optional: Textract-specific region (defaults to AWS_REGION)
|
|
13
|
+
# AWS_TEXTRACT_REGION=us-east-1
|
|
14
|
+
|
|
15
|
+
# Optional: Bedrock model ID (defaults to Claude 3.5 Sonnet)
|
|
16
|
+
# AWS_BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20241022-v2:0
|
|
17
|
+
|
|
18
|
+
# Optional: Bedrock-specific region (defaults to AWS_REGION)
|
|
19
|
+
# AWS_BEDROCK_REGION=us-east-1
|
|
20
|
+
|
|
21
|
+
# Note: AWS credentials should be configured separately via:
|
|
22
|
+
# - IAM Role (recommended for production/EC2/ECS/Lambda)
|
|
23
|
+
# - ~/.aws/credentials file (for local development)
|
|
24
|
+
# - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars (not recommended)
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12","3.13","3.14"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Cache pip packages
|
|
26
|
+
uses: actions/cache@v4
|
|
27
|
+
with:
|
|
28
|
+
path: ~/.cache/pip
|
|
29
|
+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
|
|
30
|
+
restore-keys: |
|
|
31
|
+
${{ runner.os }}-pip-
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install --upgrade pip
|
|
36
|
+
pip install -e ".[dev]"
|
|
37
|
+
|
|
38
|
+
- name: Run tests with coverage
|
|
39
|
+
run: |
|
|
40
|
+
pytest tests/ -v --cov=aws_simple --cov-report=xml --cov-report=term
|
|
41
|
+
|
|
42
|
+
- name: Upload coverage to Codecov
|
|
43
|
+
uses: codecov/codecov-action@v4
|
|
44
|
+
with:
|
|
45
|
+
file: ./coverage.xml
|
|
46
|
+
flags: unittests
|
|
47
|
+
name: codecov-umbrella
|
|
48
|
+
fail_ci_if_error: false
|
|
49
|
+
|
|
50
|
+
lint:
|
|
51
|
+
name: Lint and Type Check
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v4
|
|
56
|
+
|
|
57
|
+
- name: Set up Python
|
|
58
|
+
uses: actions/setup-python@v5
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.10"
|
|
61
|
+
|
|
62
|
+
- name: Install dependencies
|
|
63
|
+
run: |
|
|
64
|
+
python -m pip install --upgrade pip
|
|
65
|
+
pip install -e ".[dev]"
|
|
66
|
+
|
|
67
|
+
- name: Run Black formatter check
|
|
68
|
+
run: |
|
|
69
|
+
black --check src/ tests/
|
|
70
|
+
|
|
71
|
+
- name: Run Ruff linter
|
|
72
|
+
run: |
|
|
73
|
+
ruff check src/
|
|
74
|
+
|
|
75
|
+
- name: Run mypy type checker
|
|
76
|
+
run: |
|
|
77
|
+
mypy src/
|
|
78
|
+
continue-on-error: true
|
|
79
|
+
|
|
80
|
+
build:
|
|
81
|
+
name: Build Package
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
needs: [test, lint]
|
|
84
|
+
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
|
|
88
|
+
- name: Set up Python
|
|
89
|
+
uses: actions/setup-python@v5
|
|
90
|
+
with:
|
|
91
|
+
python-version: "3.10"
|
|
92
|
+
|
|
93
|
+
- name: Install build tools
|
|
94
|
+
run: |
|
|
95
|
+
python -m pip install --upgrade pip
|
|
96
|
+
pip install build twine
|
|
97
|
+
|
|
98
|
+
- name: Build package
|
|
99
|
+
run: |
|
|
100
|
+
python -m build
|
|
101
|
+
|
|
102
|
+
- name: Check package
|
|
103
|
+
run: |
|
|
104
|
+
twine check dist/*
|
|
105
|
+
|
|
106
|
+
- name: Upload build artifacts
|
|
107
|
+
uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: dist-packages
|
|
110
|
+
path: dist/
|
|
111
|
+
retention-days: 7
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
environment:
|
|
9
|
+
description: 'Publish to TestPyPI or PyPI'
|
|
10
|
+
required: true
|
|
11
|
+
default: 'testpypi'
|
|
12
|
+
type: choice
|
|
13
|
+
options:
|
|
14
|
+
- testpypi
|
|
15
|
+
- pypi
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build-and-publish:
|
|
19
|
+
name: Build and Publish to PyPI
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
environment:
|
|
22
|
+
name: ${{ github.event.inputs.environment || 'pypi' }}
|
|
23
|
+
permissions:
|
|
24
|
+
id-token: write # Required for trusted publishing
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- name: Set up Python
|
|
30
|
+
uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.10"
|
|
33
|
+
|
|
34
|
+
- name: Install build tools
|
|
35
|
+
run: |
|
|
36
|
+
python -m pip install --upgrade pip
|
|
37
|
+
pip install build twine
|
|
38
|
+
|
|
39
|
+
- name: Build package
|
|
40
|
+
run: |
|
|
41
|
+
python -m build
|
|
42
|
+
|
|
43
|
+
- name: Check package
|
|
44
|
+
run: |
|
|
45
|
+
twine check dist/*
|
|
46
|
+
|
|
47
|
+
- name: Publish to Test PyPI
|
|
48
|
+
if: github.event.inputs.environment == 'testpypi'
|
|
49
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
50
|
+
with:
|
|
51
|
+
repository-url: https://test.pypi.org/legacy/
|
|
52
|
+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
53
|
+
skip-existing: true
|
|
54
|
+
|
|
55
|
+
- name: Publish to PyPI
|
|
56
|
+
if: github.event_name == 'release' || github.event.inputs.environment == 'pypi'
|
|
57
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
58
|
+
with:
|
|
59
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Pre-commit hooks configuration
|
|
2
|
+
# Install: pip install pre-commit && pre-commit install
|
|
3
|
+
# Run manually: pre-commit run --all-files
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
- repo: https://github.com/psf/black
|
|
7
|
+
rev: 25.12.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: black
|
|
10
|
+
language_version: python3.10
|
|
11
|
+
args: [--line-length=100]
|
|
12
|
+
|
|
13
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
+
rev: v0.14.9
|
|
15
|
+
hooks:
|
|
16
|
+
- id: ruff
|
|
17
|
+
args: [--fix]
|
|
18
|
+
- id: ruff-format
|
|
19
|
+
|
|
20
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
21
|
+
rev: v5.0.0
|
|
22
|
+
hooks:
|
|
23
|
+
- id: trailing-whitespace
|
|
24
|
+
- id: end-of-file-fixer
|
|
25
|
+
- id: check-yaml
|
|
26
|
+
- id: check-added-large-files
|
|
27
|
+
args: [--maxkb=1000]
|
|
28
|
+
- id: check-merge-conflict
|
|
29
|
+
- id: check-json
|
|
30
|
+
- id: pretty-format-json
|
|
31
|
+
args: [--autofix, --no-sort-keys]
|
|
32
|
+
|
|
33
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
34
|
+
rev: v1.19.1
|
|
35
|
+
hooks:
|
|
36
|
+
- id: mypy
|
|
37
|
+
additional_dependencies: [boto3-stubs, types-python-dotenv]
|
|
38
|
+
args: [--strict]
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Contributing to aws-simple
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to aws-simple!
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
- Python ≥ 3.10
|
|
9
|
+
- pip
|
|
10
|
+
- git
|
|
11
|
+
|
|
12
|
+
### Setup Development Environment
|
|
13
|
+
|
|
14
|
+
1. Clone the repository:
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/yourusername/aws-toolkit-py.git
|
|
17
|
+
cd aws-toolkit-py
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. Create a virtual environment:
|
|
21
|
+
```bash
|
|
22
|
+
python -m venv .venv
|
|
23
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. Install development dependencies:
|
|
27
|
+
```bash
|
|
28
|
+
pip install -e ".[dev]"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
4. Configure environment variables:
|
|
32
|
+
```bash
|
|
33
|
+
cp .env.example .env
|
|
34
|
+
# Edit .env with your AWS configuration
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Development Workflow
|
|
38
|
+
|
|
39
|
+
### Running Tests
|
|
40
|
+
|
|
41
|
+
Run all tests:
|
|
42
|
+
```bash
|
|
43
|
+
make test
|
|
44
|
+
# or
|
|
45
|
+
pytest tests/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Run tests with coverage:
|
|
49
|
+
```bash
|
|
50
|
+
make test-cov
|
|
51
|
+
# or
|
|
52
|
+
pytest tests/ --cov=aws_simple --cov-report=html
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Code Quality
|
|
56
|
+
|
|
57
|
+
Run linter:
|
|
58
|
+
```bash
|
|
59
|
+
make lint
|
|
60
|
+
# or
|
|
61
|
+
ruff check src/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Format code:
|
|
65
|
+
```bash
|
|
66
|
+
make format
|
|
67
|
+
# or
|
|
68
|
+
ruff format src/ tests/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Type checking:
|
|
72
|
+
```bash
|
|
73
|
+
make type-check
|
|
74
|
+
# or
|
|
75
|
+
mypy src/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Building the Package
|
|
79
|
+
|
|
80
|
+
Build distribution files:
|
|
81
|
+
```bash
|
|
82
|
+
make build
|
|
83
|
+
# or
|
|
84
|
+
python -m build
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Check package:
|
|
88
|
+
```bash
|
|
89
|
+
twine check dist/*
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## CI/CD Pipeline
|
|
93
|
+
|
|
94
|
+
### Continuous Integration
|
|
95
|
+
|
|
96
|
+
The CI pipeline runs on every push and pull request:
|
|
97
|
+
|
|
98
|
+
1. **Tests** - Run on Python 3.10, 3.11, 3.12
|
|
99
|
+
2. **Linting** - Ruff checks code quality
|
|
100
|
+
3. **Type Checking** - mypy validates types
|
|
101
|
+
4. **Build** - Builds wheel and sdist packages
|
|
102
|
+
|
|
103
|
+
See [.github/workflows/ci.yml](.github/workflows/ci.yml)
|
|
104
|
+
|
|
105
|
+
### Publishing
|
|
106
|
+
|
|
107
|
+
#### Test PyPI (Manual)
|
|
108
|
+
|
|
109
|
+
Publish to Test PyPI for testing:
|
|
110
|
+
```bash
|
|
111
|
+
make publish-test
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or via GitHub Actions:
|
|
115
|
+
1. Go to Actions → Publish to PyPI
|
|
116
|
+
2. Run workflow → Select "testpypi"
|
|
117
|
+
|
|
118
|
+
#### PyPI (Automated)
|
|
119
|
+
|
|
120
|
+
Publishing to PyPI happens automatically on release:
|
|
121
|
+
|
|
122
|
+
1. Create a new release on GitHub
|
|
123
|
+
2. Tag format: `v0.1.0`
|
|
124
|
+
3. CI/CD automatically builds and publishes
|
|
125
|
+
|
|
126
|
+
See [.github/workflows/publish.yml](.github/workflows/publish.yml)
|
|
127
|
+
|
|
128
|
+
### Docker
|
|
129
|
+
|
|
130
|
+
Build Docker image:
|
|
131
|
+
```bash
|
|
132
|
+
docker build -t aws-simple:latest .
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Run with docker-compose:
|
|
136
|
+
```bash
|
|
137
|
+
# Configure .env file first
|
|
138
|
+
docker-compose up
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Making Changes
|
|
142
|
+
|
|
143
|
+
### Branch Strategy
|
|
144
|
+
|
|
145
|
+
- `main` - Production-ready code
|
|
146
|
+
- `develop` - Development branch
|
|
147
|
+
- Feature branches: `feature/your-feature-name`
|
|
148
|
+
- Bug fixes: `fix/bug-description`
|
|
149
|
+
|
|
150
|
+
### Commit Messages
|
|
151
|
+
|
|
152
|
+
Follow conventional commits:
|
|
153
|
+
- `feat:` - New feature
|
|
154
|
+
- `fix:` - Bug fix
|
|
155
|
+
- `docs:` - Documentation changes
|
|
156
|
+
- `test:` - Test changes
|
|
157
|
+
- `refactor:` - Code refactoring
|
|
158
|
+
- `chore:` - Maintenance tasks
|
|
159
|
+
|
|
160
|
+
Example:
|
|
161
|
+
```
|
|
162
|
+
feat: add support for S3 presigned URLs
|
|
163
|
+
fix: handle empty Textract responses
|
|
164
|
+
docs: update installation instructions
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Pull Request Process
|
|
168
|
+
|
|
169
|
+
1. Create a feature branch
|
|
170
|
+
2. Make your changes
|
|
171
|
+
3. Add/update tests
|
|
172
|
+
4. Ensure all tests pass
|
|
173
|
+
5. Update documentation if needed
|
|
174
|
+
6. Submit pull request to `develop` branch
|
|
175
|
+
|
|
176
|
+
## Code Guidelines
|
|
177
|
+
|
|
178
|
+
### Python Style
|
|
179
|
+
|
|
180
|
+
- Follow PEP 8
|
|
181
|
+
- Use type hints
|
|
182
|
+
- Maximum line length: 100 characters
|
|
183
|
+
- Use ruff for formatting
|
|
184
|
+
|
|
185
|
+
### Testing
|
|
186
|
+
|
|
187
|
+
- Write tests for all new features
|
|
188
|
+
- Maintain >90% code coverage
|
|
189
|
+
- Use descriptive test names
|
|
190
|
+
- Mock external AWS calls
|
|
191
|
+
|
|
192
|
+
### Documentation
|
|
193
|
+
|
|
194
|
+
- Update README.md for user-facing changes
|
|
195
|
+
- Add docstrings to all public functions
|
|
196
|
+
- Include examples for new features
|
|
197
|
+
|
|
198
|
+
## Project Structure
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
aws-toolkit-py/
|
|
202
|
+
├── src/aws_simple/ # Source code
|
|
203
|
+
│ ├── __init__.py # Public API
|
|
204
|
+
│ ├── config.py # Configuration
|
|
205
|
+
│ ├── s3.py # S3 module
|
|
206
|
+
│ ├── textract.py # Textract module
|
|
207
|
+
│ ├── bedrock.py # Bedrock module
|
|
208
|
+
│ ├── _clients.py # Internal AWS clients
|
|
209
|
+
│ ├── exceptions.py # Custom exceptions
|
|
210
|
+
│ ├── models/ # Data models
|
|
211
|
+
│ └── _parsers/ # Internal parsers
|
|
212
|
+
├── tests/ # Test suite
|
|
213
|
+
├── examples/ # Usage examples
|
|
214
|
+
├── .github/workflows/ # CI/CD workflows
|
|
215
|
+
└── docs/ # Documentation
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Questions?
|
|
219
|
+
|
|
220
|
+
Open an issue on GitHub for questions or discussions.
|