Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Automatically detect text files and perform LF normalization
* text=auto

# Source files should have Unix line endings
*.py text eol=lf
*.md text eol=lf
*.toml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf

# Exclude some files from exporting
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
73 changes: 73 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 🐛 Bug Report
description: Create a bug report.
title: "[Bug]: "
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: version
attributes:
label: Version
description: What version of our package are you running?
placeholder: ex. 1.0.0
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating System
description: What operating system are you using?
options:
- Windows
- macOS
- Linux
- Other
validations:
required: true
- type: dropdown
id: python-version
attributes:
label: Python Version
description: What Python version are you using?
options:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to reproduce
description: How can we reproduce this issue?
placeholder: |
1. Install package '...'
2. Run command '...'
3. See error
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code.
render: shell
- type: textarea
id: additional
attributes:
label: Additional information
description: Add any other context about the problem here.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Documentation
description: Create a documentation-related issue.
labels:
- type::documentation
body:
- type: markdown
attributes:
value: |
> [!NOTE]
> Documentation requests that are incomplete or missing information may be closed as inactionable.
- type: checkboxes
id: checks
attributes:
label: Checklist
description: Please confirm and check all of the following options.
options:
- label: I added a descriptive title
required: true
- label: I searched open reports and couldn't find a duplicate
required: true
- type: textarea
id: what
attributes:
label: What happened?
description: Mention here any typos, broken links, or missing, incomplete, or outdated information that you have noticed in the docs.
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional Context
description: Include any additional information (or screenshots) that you think would be valuable.
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 🚀 Feature Request
description: Suggest an idea for this project
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest a new feature!

> [!NOTE]
> Feature requests that are incomplete or missing information may be closed as inactionable.
- type: checkboxes
id: checks
attributes:
label: Checklist
description: Please confirm and check all of the following options.
options:
- label: I added a descriptive title
required: true
- label: I searched open requests and couldn't find a duplicate
required: true
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of the problem. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
- type: dropdown
id: priority
attributes:
label: Priority
description: How important is this feature to you?
options:
- Low (nice to have)
- Medium
- High (would significantly improve my workflow)
validations:
required: true
13 changes: 8 additions & 5 deletions .github/workflows/commit_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12' # Specify a Python version explicitly
- uses: pre-commit/action@v3.0.1

test:
Expand All @@ -25,13 +27,14 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
#environment: mailjet
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
env:
MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }}
MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history with tags (required for setuptools-scm)
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -41,7 +44,7 @@ jobs:

- name: Install the package
run: |
pip install -e .
pip install .
conda info
- name: Test package imports
run: python -c "import mailjet_rest; print('mailjet_rest version is', mailjet_rest.utils.version.get_version())"
run: python -c "import mailjet_rest"
47 changes: 47 additions & 0 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Issue Triage

on:
issues:
types: [opened, labeled, unlabeled, reopened]

jobs:
triage:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Initial triage
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue;
// Check if this is a bug report
if (issue.title.includes('[Bug]')) {
// Add priority labels based on content
if (issue.body.toLowerCase().includes('crash') ||
issue.body.toLowerCase().includes('data loss')) {
github.rest.issues.addLabels({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['priority: high']
});
}
// Assign to bug team
github.rest.issues.addAssignees({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['']
});
}
// Check if this is a feature request
if (issue.title.includes('[Feature]')) {
github.rest.issues.addLabels({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['needs-review']
});
}
28 changes: 28 additions & 0 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Validation

on:
pull_request:
branches: [main]

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Build package
run: |
pip install --upgrade build setuptools wheel setuptools-scm
python -m build

- name: Test installation
run: |
pip install dist/*.whl
python -c "from importlib.metadata import version; print(version('mailjet_rest'))"
84 changes: 84 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Publish Package

on:
push:
tags: ['v*'] # Triggers on any tag push
release:
types: [published] # Triggers when a GitHub release is published
workflow_dispatch: # Manual trigger

jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for trusted publishing
contents: read

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

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

- name: Extract version
id: get_version
run: |
# Get clean version from the tag or release
if [[ "${{ github.event_name }}" == "release" ]]; then
# For releases, get the version from the release tag
TAG_NAME="${{ github.event.release.tag_name }}"
else
# For tags, get version from the tag
TAG_NAME="${{ github.ref_name }}"
fi

# Remove 'v' prefix
VERSION=$(echo $TAG_NAME | sed 's/^v//')

# Check if this is a stable version (no rc, alpha, beta, dev, etc.)
if [[ $TAG_NAME =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "IS_STABLE=true" >> $GITHUB_ENV
else
echo "IS_STABLE=false" >> $GITHUB_ENV
fi

echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build package
run: |
# Force clean version
export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
python -m build

- name: Check dist
run: |
ls -alh
twine check dist/*

# Always publish to TestPyPI for all tags and releases
# TODO: Enable it later.
# - name: Publish to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# skip-existing: true
# verbose: true

# Only publish to PyPI for stable GitHub releases (no RC/alpha/beta)
- name: Publish to PyPI
# TODO: Enable '&& env.IS_STABLE == 'true' only publish to PyPI for stable GitHub releases (no RC/alpha/beta)
if: github.event_name == 'release' #&& env.IS_STABLE == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
Loading
Loading