Skip to content

Commit 67cf734

Browse files
authored
Add support for the Tags New API endpoint (#20)
* Update pre-commit hooks * Add the Tags New API endpoint, examples, update metrics handler; fix metrics & logs docstrings * Rename a file * Set line-length=100 as a pragmatic value across configs * Improve pre-commit hooks, apply linters * Apply linters * Add a warning message about deprecation of Tags API in favor of Tags New * Add class TagsNewTests, use ordering for some tests, remane some test classes * Remove debugging stuff * Add new Tags examples to README.md * Improve TagsNewTests docstrings * Fix checking multiple keys * Add Python 3.14 support * Fix dev environment yaml for py314 * Disable py314 in CI * Fix markdown table * Update the changelog * Fix indentation * Add a comment about running update and delete account tag tests
1 parent e5b6d2d commit 67cf734

29 files changed

+613
-301
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body:
3737
- '3.11'
3838
- '3.12'
3939
- '3.13'
40+
- '3.14'
4041
validations:
4142
required: true
4243
- type: textarea

.github/workflows/commit_checks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
33+
# TODO: Enable Python 3.14 when conda and conda-build will have py314 support.
3334
python-version: ["3.10", "3.11", "3.12", "3.13"]
3435
env:
3536
APIKEY: ${{ secrets.APIKEY }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Python
2525
uses: actions/setup-python@v6
2626
with:
27-
python-version: '3.12'
27+
python-version: '3.13'
2828

2929
- name: Install build tools
3030
run: pip install --upgrade build setuptools wheel setuptools-scm twine

.pre-commit-config.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ repos:
5858
hooks:
5959
- id: gitlint
6060

61+
- repo: https://github.com/Yelp/detect-secrets
62+
rev: v1.5.0
63+
hooks:
64+
- id: detect-secrets # Detect accidentally committed secrets
65+
6166
- repo: https://github.com/codespell-project/codespell
6267
rev: v2.4.1
6368
hooks:
@@ -66,15 +71,10 @@ repos:
6671
exclude: ^tests
6772

6873
- repo: https://github.com/python-jsonschema/check-jsonschema
69-
rev: 0.34.0
74+
rev: 0.34.1
7075
hooks:
7176
- id: check-github-workflows
72-
73-
# - repo: https://github.com/pre-commit/mirrors-autopep8
74-
# rev: v2.0.4
75-
# hooks:
76-
# - id: autopep8
77-
# exclude: ^docs/
77+
files: ^\.github/workflows/.*\.ya?ml$
7878

7979
- repo: https://github.com/akaihola/darker
8080
rev: v3.0.0
@@ -104,21 +104,21 @@ repos:
104104
exclude: ^tests
105105

106106
- repo: https://github.com/PyCQA/pylint
107-
rev: v3.3.8
107+
rev: v4.0.2
108108
hooks:
109109
- id: pylint
110110
args:
111111
- --exit-zero
112112

113113
- repo: https://github.com/asottile/pyupgrade
114-
rev: v3.20.0
114+
rev: v3.21.0
115115
hooks:
116116
- id: pyupgrade
117117
args: [--py310-plus, --keep-runtime-typing]
118118

119119
- repo: https://github.com/charliermarsh/ruff-pre-commit
120120
# Ruff version.
121-
rev: v0.13.1
121+
rev: v0.14.2
122122
hooks:
123123
# Run the linter.
124124
- id: ruff
@@ -148,7 +148,7 @@ repos:
148148
exclude: ^mailgun/examples/
149149

150150
- repo: https://github.com/RobertCraigie/pyright-python
151-
rev: v1.1.405
151+
rev: v1.1.407
152152
hooks:
153153
- id: pyright
154154

@@ -162,12 +162,12 @@ repos:
162162
additional_dependencies: [".[toml]"]
163163

164164
- repo: https://github.com/crate-ci/typos
165-
rev: v1.36.2
165+
rev: v1.38.1
166166
hooks:
167167
- id: typos
168168

169169
- repo: https://github.com/executablebooks/mdformat
170-
rev: 0.7.22
170+
rev: 1.0.0
171171
hooks:
172172
- id: mdformat
173173
additional_dependencies:

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,36 @@ We [keep a changelog.](http://keepachangelog.com/)
44

55
## [Unreleased]
66

7+
## [1.3.0] - 2025-11-08
8+
9+
### Added
10+
11+
- Add the `Tags New` endpoint:
12+
- Add `tags` to the `analytics` key of special cases in the class `Endpoint`.
13+
- Add `mailgun/examples/tags_new_examples.py` with `post_analytics_tags()`, `update_analytics_tags()`, `delete_analytics_tags()`, `get_account_analytics_tag_limit_information()`.
14+
- Add `Tags New` sections with examples to `README.md`.
15+
- Add class `TagsNewTests` to tests/tests.py.
16+
- Add `# pragma: allowlist secret` for pseudo-passwords.
17+
- Add the `pytest-order` package to `pyproject.toml`'s test dependencies and to `environment-dev.yaml` for ordering some `DomainTests`, `Messages` and `TagsNewTests`.
18+
- Add docstrings to the test classes.
19+
- Add Python 3.14 support.
20+
21+
### Changed
22+
23+
- Update `metrics_handler.py` to parse Tags New API.
24+
- Mark deprecated `Tags API` in `README.md` with a warning.
25+
- Fix `Metrics` & `Logs` docstrings.
26+
- Format `README.md`.
27+
- Use ordering for some tests by adding `@pytest.mark.order(N)` to run specific tests sequentionally. It allows to remove some unnecessary `@pytest.mark.skip()`
28+
- Rename some test classes, e.i., `ComplaintsTest` -> `ComplaintsTests` for consistency.
29+
- Use `datetime` for `LogsTests` data instead of static date strings.
30+
- Update CI workflows: update `pre-commit` hooks to the latest versions; add py314 support (limited).
31+
- Set `line-length` to `100` across the linters in `pyproject.toml`.
32+
33+
### Pull Requests Merged
34+
35+
- [PR_20](https://github.com/mailgun/mailgun-python/pull/20) - Add support for the Tags New API endpoint
36+
737
## [1.2.0] - 2025-10-02
838

939
### Added
@@ -98,7 +128,8 @@ We [keep a changelog.](http://keepachangelog.com/)
98128

99129
### Changed
100130

101-
- Breaking changes! It's a new Python SKD for [Mailgun](http://www.mailgun.com/); an obsolete v0.1.1 on [PyPI](https://pypi.org/project/mailgun/0.1.1/) is deprecated.
131+
- Breaking changes! It's a new Python SKD for [Mailgun](http://www.mailgun.com/); an obsolete v0.1.1 on
132+
[PyPI](https://pypi.org/project/mailgun/0.1.1/) is deprecated.
102133

103134
### Pull Requests Merged
104135

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ coverage: ## check code coverage quickly with the default Python
134134
$(BROWSER) htmlcov/index.html
135135

136136
lint-black:
137-
black --line-length=80 $(SRC_DIR) $(TEST_DIR)
137+
black --line-length=100 $(SRC_DIR) $(TEST_DIR)
138138
lint-isort:
139-
isort --profile black --line-length=80 $(SRC_DIR) $(TEST_DIR)
139+
isort --profile black --line-length=100 $(SRC_DIR) $(TEST_DIR)
140140
lint-flake8:
141141
@flake8 $(SRC_DIR) $(TEST_DIR)
142142
lint-pylint:
@@ -145,7 +145,7 @@ lint-refurb:
145145
@refurb $(SRC_DIR)
146146

147147
format-black:
148-
@black --line-length=88 $(SRC_DIR) $(TEST_DIR) $(SCRIPTS_DIR)
148+
@black --line-length=100 $(SRC_DIR) $(TEST_DIR) $(SCRIPTS_DIR)
149149
format-isort:
150150
@isort --profile black --line-length=88 $(SRC_DIR) $(TEST_DIR) $(SCRIPTS_DIR)
151151
format: format-black format-isort

0 commit comments

Comments
 (0)