Skip to content

Commit 470d30b

Browse files
authored
Merge pull request #125 from mailjet/refactor-client
Refactor client
2 parents f0719b4 + 842adef commit 470d30b

44 files changed

Lines changed: 3715 additions & 2085 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8+
open-pull-requests-limit: 10
89
groups:
10+
minor-and-patch:
11+
update-types: [ "minor", "patch" ]
912
python-packages:
1013
patterns:
1114
- "*"
15+
16+
# Enable version updates for GitHub Actions
17+
- package-ecosystem: 'github-actions'
18+
# Workflow files stored in the default location of `.github/workflows`
19+
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
20+
directory: '/'
21+
schedule:
22+
interval: 'weekly'

.github/workflows/commit_checks.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@ name: CI
33

44
on:
55
push:
6-
branches:
7-
- main
6+
branches: [master]
87
pull_request:
8+
branches: [master]
99

1010
permissions:
1111
contents: read
1212

1313
jobs:
1414
pre-commit:
15+
name: Lint & Format
1516
runs-on: ubuntu-latest
1617
steps:
17-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
18+
- uses: actions/checkout@v6
19+
- uses: actions/setup-python@v6
1920
with:
20-
python-version: '3.12' # Specify a Python version explicitly
21+
python-version: '3.13' # Specify a Python version explicitly
2122
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
2223

2324
test:
24-
name: test py${{ matrix.python-version }} on ${{ matrix.os }}
25+
name: Test py${{ matrix.python-version }} on ${{ matrix.os }}
2526
runs-on: ${{ matrix.os }}
2627
defaults:
2728
run:
@@ -30,24 +31,36 @@ jobs:
3031
fail-fast: false
3132
matrix:
3233
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
33-
python-version: ["3.10", "3.11", "3.12", "3.13"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3435
env:
3536
MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }}
3637
MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }}
3738
steps:
38-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
- uses: actions/checkout@v6
3940
with:
4041
fetch-depth: 0 # Get full history with tags (required for setuptools-scm)
41-
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
4244
with:
4345
python-version: ${{ matrix.python-version }}
4446
channels: defaults
4547
show-channel-urls: true
4648
environment-file: environment.yaml
49+
cache: 'pip' # Drastically speeds up CI by caching pip dependencies
4750

48-
- name: Install the package
51+
- name: Install dependencies and package
4952
run: |
53+
python -m pip install --upgrade pip
5054
pip install .
5155
conda info
56+
5257
- name: Test package imports
5358
run: python -c "import mailjet_rest"
59+
60+
- name: Install test dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install pytest
64+
65+
- name: Run unit tests
66+
run: pytest tests/unit/ -v

.github/workflows/issue-triage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
issues: write
1515
steps:
1616
- name: Initial triage
17-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
17+
uses: actions/github-script@v9
1818
with:
1919
github-token: ${{ secrets.GITHUB_TOKEN }}
2020
script: |

.github/workflows/pr_validation.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PR Validation
22

33
on:
44
pull_request:
5-
branches: [main]
5+
branches: [master]
66

77
permissions:
88
contents: read
@@ -11,21 +11,23 @@ jobs:
1111
validate:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- uses: actions/checkout@v6
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
19+
uses: actions/setup-python@v6
2020
with:
21-
python-version: '3.12'
21+
python-version: '3.13'
2222

2323
- name: Build package
2424
run: |
25-
pip install --upgrade build setuptools setuptools-scm
25+
pip install --upgrade build setuptools setuptools-scm twine
2626
python -m build
27+
twine check dist/*
2728
28-
- name: Test installation
29+
- name: Test isolated installation
2930
run: |
31+
# Install the built wheel to ensure packaging didn't miss files
3032
pip install dist/*.whl
31-
python -c "from importlib.metadata import version; print(version('mailjet_rest'))"
33+
python -c "import mailjet_rest; from importlib.metadata import version; print(f'Successfully installed v{version(\"mailjet_rest\")}')"

.github/workflows/publish.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@ permissions:
1212

1313
jobs:
1414
publish:
15+
name: Build and Publish to PyPI
1516
runs-on: ubuntu-latest
17+
1618
permissions:
1719
id-token: write # Required for trusted publishing
1820
contents: read
1921

2022
steps:
21-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- uses: actions/checkout@v6
2224
with:
23-
fetch-depth: 0
25+
fetch-depth: 0 # MANDATORY: Required for setuptools_scm to read the git tag
2426

2527
- name: Set up Python
26-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
28+
uses: actions/setup-python@v6
2729
with:
28-
python-version: '3.12'
30+
python-version: '3.13'
2931

3032
- name: Install build tools
3133
run: pip install --upgrade build setuptools setuptools-scm twine
@@ -61,11 +63,15 @@ jobs:
6163
export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
6264
python -m build
6365
64-
- name: Check dist
66+
- name: Verify package (check dist)
6567
run: |
6668
ls -alh
6769
twine check dist/*
6870
71+
- name: Verify wheel contents
72+
run: |
73+
unzip -l dist/*.whl
74+
6975
# Always publish to TestPyPI for all tags and releases
7076
# TODO: Enable it later.
7177
# - name: Publish to TestPyPI

0 commit comments

Comments
 (0)