From e873002b86487a4978db607339b1a0142a38d5ac Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 14:19:53 +0300 Subject: [PATCH 01/16] build: Drop Python 3.9 support --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 - .github/workflows/commit_checks.yaml | 2 +- .pre-commit-config.yaml | 2 +- README.md | 2 +- conda.recipe/meta.yaml | 2 +- environment-dev.yaml | 5 ++--- environment.yaml | 2 +- pyproject.toml | 11 +++++------ 8 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 90b657b..f5355bf 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -33,7 +33,6 @@ body: label: Python Version description: What Python version are you using? options: - - '3.9' - '3.10' - '3.11' - '3.12' diff --git a/.github/workflows/commit_checks.yaml b/.github/workflows/commit_checks.yaml index 10a1a83..45fd5c0 100644 --- a/.github/workflows/commit_checks.yaml +++ b/.github/workflows/commit_checks.yaml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] env: MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }} MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc71b5d..427250b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -111,7 +111,7 @@ repos: rev: v3.20.0 hooks: - id: pyupgrade - args: [--py39-plus, --keep-runtime-typing] + args: [--py310-plus, --keep-runtime-typing] - repo: https://github.com/charliermarsh/ruff-pre-commit # Ruff version. diff --git a/README.md b/README.md index 255213b..2bd0468 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Check out all the resources and Python code examples in the official [Mailjet Do This library `mailjet_rest` officially supports the following Python versions: -- Python >=3.9,\<3.14 +- Python >=3.10,\<3.14 It's tested up to 3.13 (including). diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index a160382..f608dde 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -16,7 +16,7 @@ source: build: number: 0 - skip: True # [py<39] + skip: True # [py<310] script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv script_env: - SETUPTOOLS_SCM_PRETEND_VERSION={{ version }} diff --git a/environment-dev.yaml b/environment-dev.yaml index cb42993..e82d0e2 100644 --- a/environment-dev.yaml +++ b/environment-dev.yaml @@ -3,7 +3,7 @@ name: mailjet-dev channels: - defaults dependencies: - - python >=3.9 + - python >=3.10 # build & host deps - pip - setuptools-scm @@ -52,8 +52,7 @@ dependencies: - pyment >=0.3.3 - pytype - pyupgrade - # refurb doesn't support py39 - #- refurb + - refurb - scalene >=1.3.16 - snakeviz - typos diff --git a/environment.yaml b/environment.yaml index 4303c29..b8654d0 100644 --- a/environment.yaml +++ b/environment.yaml @@ -3,7 +3,7 @@ name: mailjet channels: - defaults dependencies: - - python >=3.9 + - python >=3.10 # build & host deps - pip # runtime deps diff --git a/pyproject.toml b/pyproject.toml index 6917321..25ed5c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ license = {text = "MIT"} # TODO: Enable license-files when setuptools >=77.0.0 will be available #license-files = ["LICENSE"] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = ["requests>=2.32.3"] @@ -54,7 +54,6 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -136,7 +135,7 @@ other = ["toml"] [tool.black] line-length = 88 -target-version = ["py39", "py310", "py311", "py312", "py313"] +target-version = ["py310", "py311", "py312", "py313"] skip-string-normalization = false skip-magic-trailing-comma = false extend-exclude = ''' @@ -190,8 +189,8 @@ extend-exclude = ["tests", "test"] line-length = 88 #indent-width = 4 -# Assume Python 3.9. -target-version = "py39" +# Assume Python 3.10. +target-version = "py310" # Enumerate all fixed violations. show-fixes = true @@ -334,7 +333,7 @@ ignore_patterns = [ strict = true # Adapted from this StackOverflow post: # https://stackoverflow.com/questions/55944201/python-type-hinting-how-do-i-enforce-that-project-wide -python_version = "3.9" +python_version = "3.10" mypy_path = "type_stubs" namespace_packages = true # This flag enhances the user feedback for error messages From 21839466635f1245564ab28ec7228db64662e013 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:35:04 +0300 Subject: [PATCH 02/16] docs: Add the Security Policy file SECURITY.md --- .pre-commit-config.yaml | 16 ++++++-- SECURITY.md | 82 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 SECURITY.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 427250b..b436de4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,8 @@ # pre-commit run --all-files # Update this file: # pre-commit autoupdate +default_language_version: + python: python3 exclude: ^(.*/versioneer\.py|.*/_version\.py|.*/.*\.svg) ci: @@ -123,6 +125,13 @@ repos: # Run the formatter. - id: ruff-format + - repo: https://github.com/pycqa/pydocstyle + rev: 6.3.0 + hooks: + - id: pydocstyle + args: [--select=D200,D213,D400,D415] + additional_dependencies: [tomli] + - repo: https://github.com/dosisod/refurb rev: v2.1.0 hooks: @@ -133,10 +142,9 @@ repos: rev: v1.16.1 hooks: - id: mypy - args: - [ - --config-file=./pyproject.toml, - ] + args: [--config-file=./pyproject.toml] + additional_dependencies: + - types-requests exclude: ^samples/ - repo: https://github.com/RobertCraigie/pyright-python diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..d15ee9f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,82 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 1.4.x | :white_check_mark: | +| < 1.4.0 | :x: | + +# Vulnerability Disclosure + +If you think you have found a potential security vulnerability in +mailjet-rest, please open a [draft Security Advisory](https://github.com/mailjet/mailjet-apiv3-python/security/advisories/new) +via GitHub. We will coordinate verification and next steps through +that secure medium. + +If English is not your first language, please try to describe the +problem and its impact to the best of your ability. For greater detail, +please use your native language and we will try our best to translate it +using online services. + +Please also include the code you used to find the problem and the +shortest amount of code necessary to reproduce it. + +Please do not disclose this to anyone else. We will retrieve a CVE +identifier if necessary and give you full credit under whatever name or +alias you provide. We will only request an identifier when we have a fix +and can publish it in a release. + +We will respect your privacy and will only publicize your involvement if +you grant us permission. + +## Process + +This following information discusses the process the project +follows in response to vulnerability disclosures. If you are disclosing +a vulnerability, this section of the documentation lets you know how we +will respond to your disclosure. + +### Timeline + +When you report an issue, one of the project members will respond to you +within five days *at the outside*. In most cases responses will be +faster, usually within 72 hours. This initial response will at the very +least confirm receipt of the report. + +If we were able to rapidly reproduce the issue, the initial response +will also contain confirmation of the issue. If we are not, we will +often ask for more information about the reproduction scenario. + +Our goal is to have a fix for any vulnerability released within two +weeks of the initial disclosure. This may potentially involve shipping +an interim release that simply disables function while a more mature fix +can be prepared, but will in the vast majority of cases mean shipping a +complete release as soon as possible. + +Throughout the fix process we will keep you up to speed with how the fix +is progressing. Once the fix is prepared, we will notify you that we +believe we have a fix. Often we will ask you to confirm the fix resolves +the problem in your environment, especially if we are not confident of +our reproduction scenario. + +At this point, we will prepare for the release. We will obtain a CVE +number if one is required, providing you with full credit for the +discovery. We will also decide on a planned release date, and let you +know when it is. This release date will *always* be on a weekday. + +At this point we will reach out to our major downstream packagers to +notify them of an impending security-related patch so they can make +arrangements. In addition, these packagers will be provided with the +intended patch ahead of time, to ensure that they are able to promptly +release their downstream packages. + +On release day, we will push the patch to our public repository, along +with an updated changelog that describes the issue and credits you. We +will then issue a PyPI release containing the patch. + +At this point, we will publicise the release. + +We will also explicitly mention which commits contain the fix to make it +easier for other distributors and users to easily patch their own +versions of mailjet-rest if upgrading is not an option. From 9d28e5fb334b7b1b9aebb52868945603c8db19f4 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:37:09 +0300 Subject: [PATCH 03/16] ci: Use commit hashes to ensure reproducible builds; use read permissions --- .github/workflows/commit_checks.yaml | 13 ++++++++----- .github/workflows/issue-triage.yml | 5 ++++- .github/workflows/pr_validation.yml | 9 ++++++--- .github/workflows/publish.yml | 9 ++++++--- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/commit_checks.yaml b/.github/workflows/commit_checks.yaml index 45fd5c0..a1e5609 100644 --- a/.github/workflows/commit_checks.yaml +++ b/.github/workflows/commit_checks.yaml @@ -7,15 +7,18 @@ on: - main pull_request: +permissions: + contents: read + jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.12' # Specify a Python version explicitly - - uses: pre-commit/action@v3.0.1 + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 test: name: test py${{ matrix.python-version }} on ${{ matrix.os }} @@ -32,10 +35,10 @@ jobs: MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }} MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 # Get full history with tags (required for setuptools-scm) - - uses: conda-incubator/setup-miniconda@v3 + - uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 with: python-version: ${{ matrix.python-version }} channels: defaults diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml index e500793..d2f0460 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/issue-triage.yml @@ -4,6 +4,9 @@ on: issues: types: [opened, labeled, unlabeled, reopened] +permissions: + contents: read + jobs: triage: runs-on: ubuntu-latest @@ -11,7 +14,7 @@ jobs: issues: write steps: - name: Initial triage - uses: actions/github-script@v6 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/pr_validation.yml b/.github/workflows/pr_validation.yml index a699c1f..543a2ea 100644 --- a/.github/workflows/pr_validation.yml +++ b/.github/workflows/pr_validation.yml @@ -4,22 +4,25 @@ on: pull_request: branches: [main] +permissions: + contents: read + jobs: validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.12' - name: Build package run: | - pip install --upgrade build setuptools wheel setuptools-scm + pip install --upgrade build setuptools setuptools-scm python -m build - name: Test installation diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 14b1b1c..903a1f4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,9 @@ on: types: [published] # Triggers when a GitHub release is published workflow_dispatch: # Manual trigger +permissions: + contents: read + jobs: publish: runs-on: ubuntu-latest @@ -15,17 +18,17 @@ jobs: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.12' - name: Install build tools - run: pip install --upgrade build setuptools wheel setuptools-scm twine + run: pip install --upgrade build setuptools setuptools-scm twine - name: Extract version id: get_version From 399055726d250b3c2e09a035c3a826e18c8e6b25 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:38:26 +0300 Subject: [PATCH 04/16] build: Update dependency pinning --- environment-dev.yaml | 2 +- environment.yaml | 2 +- pyproject.toml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/environment-dev.yaml b/environment-dev.yaml index e82d0e2..6644524 100644 --- a/environment-dev.yaml +++ b/environment-dev.yaml @@ -10,7 +10,7 @@ dependencies: - # PyPI publishing only - python-build # runtime deps - - requests >=2.32.3 + - requests >=2.32.4 # tests - conda-forge::pyfakefs - coverage >=4.5.4 diff --git a/environment.yaml b/environment.yaml index b8654d0..051b9e9 100644 --- a/environment.yaml +++ b/environment.yaml @@ -7,7 +7,7 @@ dependencies: # build & host deps - pip # runtime deps - - requests >=2.32.3 + - requests >=2.32.4 # tests - pytest >=7.0.0 # other diff --git a/pyproject.toml b/pyproject.toml index 25ed5c0..aa2718f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0", "wheel", "setuptools-scm"] +requires = ["setuptools>=77.0.0", "setuptools-scm"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] @@ -37,7 +37,7 @@ license = {text = "MIT"} readme = "README.md" requires-python = ">=3.10" -dependencies = ["requests>=2.32.3"] +dependencies = ["requests>=2.32.4"] keywords = [ "Mailjet API v3 / v3.1 Python Wrapper", @@ -65,10 +65,10 @@ classifiers = [ ] [project.urls] -"Issue Tracker" = "https://github.com/mailjet/mailjet-apiv3-python" -"Repository" = "https://github.com/mailjet/mailjet-apiv3-python" "Homepage" = "https://dev.mailjet.com" "Documentation" = "https://dev.mailjet.com" +"Repository" = "https://github.com/mailjet/mailjet-apiv3-python" +"Issue Tracker" = "https://github.com/mailjet/mailjet-apiv3-python/issues" [project.optional-dependencies] linting = [ From ad6b53ac3f8d70820289959a31735b31439fcf82 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:43:31 +0300 Subject: [PATCH 05/16] style: Import Callable from collections.abc --- mailjet_rest/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailjet_rest/client.py b/mailjet_rest/client.py index a41ae97..e0b7531 100644 --- a/mailjet_rest/client.py +++ b/mailjet_rest/client.py @@ -37,7 +37,6 @@ from re import Match from typing import TYPE_CHECKING from typing import Any -from typing import Callable import requests # type: ignore[import-untyped] from requests.compat import urljoin # type: ignore[import-untyped] @@ -46,12 +45,13 @@ if TYPE_CHECKING: + from collections.abc import Callable from collections.abc import Mapping from requests.models import Response # type: ignore[import-untyped] -requests.packages.urllib3.disable_warnings() +requests.packages.urllib3.disable_warnings() # type: ignore[attr-defined] def prepare_url(key: Match[str]) -> str: From 5455a7df2e47f91fa4ab07cf88eefaf95988f320 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:49:42 +0300 Subject: [PATCH 06/16] docs: Update CHANGELOG.md --- CHANGELOG.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9468a..0522fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,35 @@ We [keep a changelog.](http://keepachangelog.com/) ## [Unreleased] +## [1.5.0] - 2025-07-XX + +### Added + +- Add class `TestCsvImpor` with a test suite for testing CSV import functionality to `test.py`. +- Add `types-requests` to `mypy`'s `additional_dependencies` in `pre-commit` hooks +- Add `pydocstyle` pre-commit's hook +- style: Import Callable from collections.abc + +### Fixed + +- Fix a csvimport error 'List index (0) out of bounds': renamed `json_data` back to `data`. Corrected behavior broken since v1.4.0. + +### Changed + +- Update pre-commit hooks to the latest versions +- Breaking changes: drop support for Python 3.9 + +### Security + +- docs: Add the Security Policy file `SECURITY.md` +- ci: Use `permissions: contents: read` in all CI workflow files explicitly +- ci: Use commit hashes to ensure reproducible builds +- build: Update dependency pinning: `requests >=2.32.4` + +### Pull Requests Merged + +- [PR_120](https://github.com/mailjet/mailjet-apiv3-python/pull/120) - Fix a csvimport error 'List index (0) out of bounds' + ## [1.4.0] - 2025-05-07 ### Added @@ -141,4 +170,5 @@ We [keep a changelog.](http://keepachangelog.com/) \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* [1.4.0]: https://github.com/mailjet/mailjet-apiv3-python/releases/tag/v1.4.0 -[unreleased]: https://github.com/mailjet/mailjet-apiv3-python/releases/tag/v1.4.0...HEAD +[1.5.0]: https://github.com/mailjet/mailjet-apiv3-python/releases/tag/v1.5.0 +[unreleased]: https://github.com/mailjet/mailjet-apiv3-python/releases/tag/v1.5.0...HEAD From 88bc11d761f2b12c07a42ae750442ffdfaefa71e Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:15:55 +0300 Subject: [PATCH 07/16] build: Improve conda recipe --- CHANGELOG.md | 17 +++++++++-------- conda.recipe/meta.yaml | 11 ++++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0522fda..44810d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,34 +4,35 @@ We [keep a changelog.](http://keepachangelog.com/) ## [Unreleased] -## [1.5.0] - 2025-07-XX +## [1.5.0] - 2025-07-11 ### Added -- Add class `TestCsvImpor` with a test suite for testing CSV import functionality to `test.py`. +- Add class `TestCsvImpor` with a test suite for testing CSV import functionality to `test.py` - Add `types-requests` to `mypy`'s `additional_dependencies` in `pre-commit` hooks - Add `pydocstyle` pre-commit's hook -- style: Import Callable from collections.abc ### Fixed -- Fix a csvimport error 'List index (0) out of bounds': renamed `json_data` back to `data`. Corrected behavior broken since v1.4.0. +- Fix a csvimport error 'List index (0) out of bounds': renamed `json_data` back to `data`. Corrected behavior broken since v1.4.0 ### Changed - Update pre-commit hooks to the latest versions - Breaking changes: drop support for Python 3.9 +- Import Callable from collections.abc ### Security -- docs: Add the Security Policy file `SECURITY.md` -- ci: Use `permissions: contents: read` in all CI workflow files explicitly -- ci: Use commit hashes to ensure reproducible builds -- build: Update dependency pinning: `requests >=2.32.4` +- Add the Security Policy file `SECURITY.md` +- Use `permissions: contents: read` in all CI workflow files explicitly +- Use commit hashes to ensure reproducible builds +- Update pinning for runtime dependency `requests >=2.32.4` ### Pull Requests Merged - [PR_120](https://github.com/mailjet/mailjet-apiv3-python/pull/120) - Fix a csvimport error 'List index (0) out of bounds' +- [PR_123](https://github.com/mailjet/mailjet-apiv3-python/pull/123) - Release 1.5.0 ## [1.4.0] - 2025-05-07 diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index f608dde..677b1f4 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -41,6 +41,8 @@ test: - samples source_files: - tests/test_client.py + - test.py + - tests/doc_tests/files/data.csv requires: - pip - pytest @@ -48,15 +50,14 @@ test: - pip check # TODO: Add environment variables for tests - pytest tests/test_client.py -vv + - pytest test.py -vv about: home: {{ project['urls']['Homepage'] }} dev_url: {{ project['urls']['Repository'] }} doc_url: {{ project['urls']['Documentation'] }} summary: {{ project['description'] }} - # TODO: Add the description - # description: | - # - license: {{ project['license']['text'] }} - license_family: {{ project['license']['text'].split('-')[0] }} + description: {{ project['description'] }} + license: {{ project['license'] }} + license_family: {{ project['license'].split('-')[0] }} license_file: LICENSE From 6865c7141ee8a3332e4f8a463632207aabd3a84a Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:17:51 +0300 Subject: [PATCH 08/16] docs: Use project.license and license-files for setuptools >=77; add test.py to the package --- pyproject.toml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa2718f..b7f1f01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ write_to_template = '__version__ = "{version}"' py-modules = ["mailjet_rest._version"] [tool.setuptools.packages.find] -include = ["mailjet_rest", "mailjet_rest.*", "samples", "tests", "test.py"] +include = ["mailjet_rest", "mailjet_rest.*", "samples", "tests", "tests.*", "test.py"] [tool.setuptools.package-data] mailjet_rest = ["py.typed", "*.pyi"] @@ -31,9 +31,8 @@ authors = [ maintainers = [ {name = "Serhii Kupriienko", email = "kupriienko.serhii@gmail.com"} ] -license = {text = "MIT"} -# TODO: Enable license-files when setuptools >=77.0.0 will be available -#license-files = ["LICENSE"] +license = "MIT" +license-files = ["LICENSE"] readme = "README.md" requires-python = ">=3.10" From 4d99c0a1f8f2da6ed0d19164521fc0b1a5f90b93 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:19:20 +0300 Subject: [PATCH 09/16] Release 1.5.0rc1 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44810d6..2c22cae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ We [keep a changelog.](http://keepachangelog.com/) - Update pre-commit hooks to the latest versions - Breaking changes: drop support for Python 3.9 - Import Callable from collections.abc +- Improve a conda recipe ### Security From 8b1b3c017fd861e95aee05a07b863907bad21d14 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:32:53 +0300 Subject: [PATCH 10/16] Release 1.5.0rc1: update _version.py --- mailjet_rest/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailjet_rest/_version.py b/mailjet_rest/_version.py index 3e8d9f9..04c709a 100644 --- a/mailjet_rest/_version.py +++ b/mailjet_rest/_version.py @@ -1 +1 @@ -__version__ = "1.4.0" +__version__ = "1.5.0rc1" \ No newline at end of file From 1422da100f00ecf17c9baade93b63d622ebcdec3 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:49:55 +0300 Subject: [PATCH 11/16] docs: Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2bd0468..8fd1a30 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ To build the `mailjet_rest` package from the sources you need `setuptools` (as a ### Runtime dependencies -At runtime the package requires only `requests >=2.32.3`. +At runtime the package requires only `requests >=2.32.4`. ### Test dependencies @@ -443,5 +443,5 @@ If you have suggestions on how to improve the guides, please submit an issue in - [@skupriienko](https://github.com/skupriienko) [api_credential]: https://app.mailjet.com/account/apikeys -[doc]: http://dev.mailjet.com/guides/?python# -[mailjet]: (http://www.mailjet.com/) +[doc]: https://dev.mailjet.com/email/guides/?python# +[mailjet]: (https://www.mailjet.com) From 701cf50b89b4fbdf2506d4d5cce1c22464f6472d Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:51:28 +0300 Subject: [PATCH 12/16] Release 1.5.0rc2 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c22cae..54b720c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ We [keep a changelog.](http://keepachangelog.com/) - Breaking changes: drop support for Python 3.9 - Import Callable from collections.abc - Improve a conda recipe +- Update `README.md` ### Security From 461db9afdf9d8fc06fda80d7b3df84c60947c8cf Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:54:41 +0300 Subject: [PATCH 13/16] Release 1.5.0rc2: update _version.py --- mailjet_rest/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailjet_rest/_version.py b/mailjet_rest/_version.py index 04c709a..2bd8d7a 100644 --- a/mailjet_rest/_version.py +++ b/mailjet_rest/_version.py @@ -1 +1 @@ -__version__ = "1.5.0rc1" \ No newline at end of file +__version__ = "1.5.0rc2" \ No newline at end of file From 56e154f2e3b7163cfa847b092d928441b9b6fe21 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 23:34:31 +0300 Subject: [PATCH 14/16] Add */_version.py to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c2134aa..074ef42 100644 --- a/.gitignore +++ b/.gitignore @@ -234,3 +234,5 @@ dev/ # pytest cache .pytest_cache/ pytestdebug.log + +*/_version.py From 86f40e9fbb1bdb143769809b3ab801dc8796b0a6 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 23:39:56 +0300 Subject: [PATCH 15/16] test: Update version in test_user_agent --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 28f51df..98779ec 100644 --- a/test.py +++ b/test.py @@ -215,7 +215,7 @@ def test_user_agent(self) -> None: None """ self.client = Client(auth=self.auth, version="v3.1") - self.assertEqual(self.client.config.user_agent, "mailjet-apiv3-python/v1.4.0") + self.assertEqual(self.client.config.user_agent, "mailjet-apiv3-python/v1.5.0") class TestCsvImport(unittest.TestCase): From ecf452d4e449cf3405c207eb6a5748be554a3710 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko <61395455+skupriienko@users.noreply.github.com> Date: Fri, 11 Jul 2025 23:51:01 +0300 Subject: [PATCH 16/16] Release 1.5.0 --- CHANGELOG.md | 1 + mailjet_rest/_version.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 mailjet_rest/_version.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 54b720c..2581d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ We [keep a changelog.](http://keepachangelog.com/) - Add class `TestCsvImpor` with a test suite for testing CSV import functionality to `test.py` - Add `types-requests` to `mypy`'s `additional_dependencies` in `pre-commit` hooks - Add `pydocstyle` pre-commit's hook +- Add `*/_version.py` to `.gitignore` ### Fixed diff --git a/mailjet_rest/_version.py b/mailjet_rest/_version.py deleted file mode 100644 index 2bd8d7a..0000000 --- a/mailjet_rest/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "1.5.0rc2" \ No newline at end of file