Skip to content

Commit cb0e474

Browse files
authored
Release 1.4.0 (#117)
* Improve CI Automation and package management (#116) * ci: Fix conda.recipe, add samples * ci: Disable TestPyPI job; Add samples to stdist * docs: Update CHANGELOG, fix Python support versions in README * docs: Fix urls * docs: Update badges * Release v1.4.0
1 parent b2d9732 commit cb0e474

File tree

19 files changed

+717
-235
lines changed

19 files changed

+717
-235
lines changed

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Automatically detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Source files should have Unix line endings
5+
*.py text eol=lf
6+
*.md text eol=lf
7+
*.toml text eol=lf
8+
*.yaml text eol=lf
9+
*.yml text eol=lf
10+
11+
# Exclude some files from exporting
12+
.gitattributes export-ignore
13+
.gitignore export-ignore
14+
.github export-ignore
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: 🐛 Bug Report
2+
description: Create a bug report.
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
- type: input
11+
id: version
12+
attributes:
13+
label: Version
14+
description: What version of our package are you running?
15+
placeholder: ex. 1.0.0
16+
validations:
17+
required: true
18+
- type: dropdown
19+
id: os
20+
attributes:
21+
label: Operating System
22+
description: What operating system are you using?
23+
options:
24+
- Windows
25+
- macOS
26+
- Linux
27+
- Other
28+
validations:
29+
required: true
30+
- type: dropdown
31+
id: python-version
32+
attributes:
33+
label: Python Version
34+
description: What Python version are you using?
35+
options:
36+
- '3.9'
37+
- '3.10'
38+
- '3.11'
39+
- '3.12'
40+
- '3.13'
41+
validations:
42+
required: true
43+
- type: textarea
44+
id: what-happened
45+
attributes:
46+
label: What happened?
47+
description: Also tell us, what did you expect to happen?
48+
placeholder: Tell us what you see!
49+
value: "A bug happened!"
50+
validations:
51+
required: true
52+
- type: textarea
53+
id: reproduction
54+
attributes:
55+
label: Steps to reproduce
56+
description: How can we reproduce this issue?
57+
placeholder: |
58+
1. Install package '...'
59+
2. Run command '...'
60+
3. See error
61+
validations:
62+
required: true
63+
- type: textarea
64+
id: logs
65+
attributes:
66+
label: Relevant log output
67+
description: Please copy and paste any relevant log output. This will be automatically formatted into code.
68+
render: shell
69+
- type: textarea
70+
id: additional
71+
attributes:
72+
label: Additional information
73+
description: Add any other context about the problem here.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Documentation
2+
description: Create a documentation-related issue.
3+
labels:
4+
- type::documentation
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
> [!NOTE]
10+
> Documentation requests that are incomplete or missing information may be closed as inactionable.
11+
- type: checkboxes
12+
id: checks
13+
attributes:
14+
label: Checklist
15+
description: Please confirm and check all of the following options.
16+
options:
17+
- label: I added a descriptive title
18+
required: true
19+
- label: I searched open reports and couldn't find a duplicate
20+
required: true
21+
- type: textarea
22+
id: what
23+
attributes:
24+
label: What happened?
25+
description: Mention here any typos, broken links, or missing, incomplete, or outdated information that you have noticed in the docs.
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: context
30+
attributes:
31+
label: Additional Context
32+
description: Include any additional information (or screenshots) that you think would be valuable.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 🚀 Feature Request
2+
description: Suggest an idea for this project
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to suggest a new feature!
10+
11+
> [!NOTE]
12+
> Feature requests that are incomplete or missing information may be closed as inactionable.
13+
- type: checkboxes
14+
id: checks
15+
attributes:
16+
label: Checklist
17+
description: Please confirm and check all of the following options.
18+
options:
19+
- label: I added a descriptive title
20+
required: true
21+
- label: I searched open requests and couldn't find a duplicate
22+
required: true
23+
- type: textarea
24+
id: problem
25+
attributes:
26+
label: Is your feature request related to a problem?
27+
description: A clear and concise description of the problem. Ex. I'm always frustrated when [...]
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: solution
32+
attributes:
33+
label: Describe the solution you'd like
34+
description: A clear and concise description of what you want to happen.
35+
validations:
36+
required: true
37+
- type: textarea
38+
id: alternatives
39+
attributes:
40+
label: Describe alternatives you've considered
41+
description: A clear and concise description of any alternative solutions or features you've considered.
42+
- type: textarea
43+
id: context
44+
attributes:
45+
label: Additional context
46+
description: Add any other context or screenshots about the feature request here.
47+
- type: dropdown
48+
id: priority
49+
attributes:
50+
label: Priority
51+
description: How important is this feature to you?
52+
options:
53+
- Low (nice to have)
54+
- Medium
55+
- High (would significantly improve my workflow)
56+
validations:
57+
required: true

.github/workflows/commit_checks.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12' # Specify a Python version explicitly
1618
- uses: pre-commit/action@v3.0.1
1719

1820
test:
@@ -25,13 +27,14 @@ jobs:
2527
fail-fast: false
2628
matrix:
2729
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
28-
python-version: ["3.9", "3.10", "3.11", "3.12"]
29-
#environment: mailjet
30+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
3031
env:
3132
MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }}
3233
MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }}
3334
steps:
34-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0 # Get full history with tags (required for setuptools-scm)
3538
- uses: conda-incubator/setup-miniconda@v3
3639
with:
3740
python-version: ${{ matrix.python-version }}
@@ -41,7 +44,7 @@ jobs:
4144

4245
- name: Install the package
4346
run: |
44-
pip install -e .
47+
pip install .
4548
conda info
4649
- name: Test package imports
47-
run: python -c "import mailjet_rest; print('mailjet_rest version is', mailjet_rest.utils.version.get_version())"
50+
run: python -c "import mailjet_rest"

.github/workflows/issue-triage.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Issue Triage
2+
3+
on:
4+
issues:
5+
types: [opened, labeled, unlabeled, reopened]
6+
7+
jobs:
8+
triage:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Initial triage
14+
uses: actions/github-script@v6
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
script: |
18+
const issue = context.payload.issue;
19+
// Check if this is a bug report
20+
if (issue.title.includes('[Bug]')) {
21+
// Add priority labels based on content
22+
if (issue.body.toLowerCase().includes('crash') ||
23+
issue.body.toLowerCase().includes('data loss')) {
24+
github.rest.issues.addLabels({
25+
issue_number: issue.number,
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
labels: ['priority: high']
29+
});
30+
}
31+
// Assign to bug team
32+
github.rest.issues.addAssignees({
33+
issue_number: issue.number,
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
assignees: ['']
37+
});
38+
}
39+
// Check if this is a feature request
40+
if (issue.title.includes('[Feature]')) {
41+
github.rest.issues.addLabels({
42+
issue_number: issue.number,
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
labels: ['needs-review']
46+
});
47+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.12'
19+
20+
- name: Build package
21+
run: |
22+
pip install --upgrade build setuptools wheel setuptools-scm
23+
python -m build
24+
25+
- name: Test installation
26+
run: |
27+
pip install dist/*.whl
28+
python -c "from importlib.metadata import version; print(version('mailjet_rest'))"

.github/workflows/publish.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags: ['v*'] # Triggers on any tag push
6+
release:
7+
types: [published] # Triggers when a GitHub release is published
8+
workflow_dispatch: # Manual trigger
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write # Required for trusted publishing
15+
contents: read
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install build tools
28+
run: pip install --upgrade build setuptools wheel setuptools-scm twine
29+
30+
- name: Extract version
31+
id: get_version
32+
run: |
33+
# Get clean version from the tag or release
34+
if [[ "${{ github.event_name }}" == "release" ]]; then
35+
# For releases, get the version from the release tag
36+
TAG_NAME="${{ github.event.release.tag_name }}"
37+
else
38+
# For tags, get version from the tag
39+
TAG_NAME="${{ github.ref_name }}"
40+
fi
41+
42+
# Remove 'v' prefix
43+
VERSION=$(echo $TAG_NAME | sed 's/^v//')
44+
45+
# Check if this is a stable version (no rc, alpha, beta, dev, etc.)
46+
if [[ $TAG_NAME =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
47+
echo "IS_STABLE=true" >> $GITHUB_ENV
48+
else
49+
echo "IS_STABLE=false" >> $GITHUB_ENV
50+
fi
51+
52+
echo "VERSION=$VERSION" >> $GITHUB_ENV
53+
echo "version=$VERSION" >> $GITHUB_OUTPUT
54+
55+
- name: Build package
56+
run: |
57+
# Force clean version
58+
export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
59+
python -m build
60+
61+
- name: Check dist
62+
run: |
63+
ls -alh
64+
twine check dist/*
65+
66+
# Always publish to TestPyPI for all tags and releases
67+
# TODO: Enable it later.
68+
# - name: Publish to TestPyPI
69+
# uses: pypa/gh-action-pypi-publish@release/v1
70+
# with:
71+
# repository-url: https://test.pypi.org/legacy/
72+
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
73+
# skip-existing: true
74+
# verbose: true
75+
76+
# Only publish to PyPI for stable GitHub releases (no RC/alpha/beta)
77+
- name: Publish to PyPI
78+
# TODO: Enable '&& env.IS_STABLE == 'true' only publish to PyPI for stable GitHub releases (no RC/alpha/beta)
79+
if: github.event_name == 'release' #&& env.IS_STABLE == 'true'
80+
uses: pypa/gh-action-pypi-publish@release/v1
81+
with:
82+
user: __token__
83+
password: ${{ secrets.PYPI_API_TOKEN }}
84+
verbose: true

0 commit comments

Comments
 (0)