Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish to PyPI

on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*' # Trigger only on tags like 2.1.6
- '[0-9]*.[0-9]*.[0-9]*.post*' # Trigger only on tags like 2.1.6.post1

permissions:
contents: read
id-token: write # For PyPI Trusted Publishing

jobs:
build-and-publish:
name: Build and publish Python distribution
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build package
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
35 changes: 35 additions & 0 deletions .github/workflows/test_cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to TestPyPI

on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*.test*' # Trigger only on tags like 2.1.6.test1

jobs:
build-and-publish:
name: Build and publish Python distribution
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build package
run: python -m build

- 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
61 changes: 61 additions & 0 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Unittest

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
test-py27:
runs-on: ubuntu-24.04
container: python:2.7
services:
redis:
image: redis:6.2
ports:
- 6379:6379
mongodb:
image: mongo:5.0
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
pip install --upgrade pip
pip install "pytest<5" mock pytest-cov
pip install .[redis,memory,mongodb]

- name: Test with pytest
run: |
python -m pytest app/

test-py38:
runs-on: ubuntu-24.04
container: python:3.8
services:
redis:
image: redis:6.2
ports:
- 6379:6379
mongodb:
image: mongo:5.0
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pytest pytest-cov
pip install .[redis,memory,mongodb]

- name: Test with pytest
run: |
python -m pytest app/
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,21 @@ def get_version():
"apscheduler[gevent] == 3.8.1;python_version == '2.7'",
"apscheduler[gevent] < 4.0;python_version >= '3.7'",
],
"docs": [
"sphinx",
"sphinxawesome-theme",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent",
],
)