Skip to content

Commit 69d5caa

Browse files
committed
feat: mongoengine async v0.1.0
1 parent 284a350 commit 69d5caa

21 files changed

+2877
-1
lines changed

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Lint
5+
6+
on: [push, pull_request]
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
strategy:
17+
matrix:
18+
python: ["3.12"]
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip poetry
29+
poetry install --only dev
30+
- name: ruff check
31+
run: |
32+
poetry run ruff check .
33+
poetry run ruff format --diff .
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
name: Publish to PyPI
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
python: ["3.12", "3.13"]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip poetry
29+
poetry install --with dev
30+
- name: Ruff check
31+
run: |
32+
poetry run ruff check .
33+
poetry run ruff format --diff .
34+
- name: Test with pytest
35+
run: |
36+
poetry run pytest
37+
38+
deploy:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Set up Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.12'
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install poetry
52+
- name: Build & Release package
53+
env:
54+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
55+
run: |
56+
poetry publish --build

.github/workflows/test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Test Package
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
test:
22+
strategy:
23+
matrix:
24+
os: [ubuntu-latest]
25+
# supercharge/[email protected] works only on linux
26+
# os: [ubuntu-latest, macos-latest, windows-latest]
27+
python: ["3.12", "3.13"]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up Python ${{ matrix.python }}
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python }}
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip poetry
38+
poetry install --with dev
39+
- name: Start MongoDB
40+
uses: supercharge/[email protected]
41+
with:
42+
mongodb-replica-set: local-rs
43+
- name: Ruff check
44+
run: |
45+
poetry run ruff check .
46+
poetry run ruff format --diff .
47+
- name: Test with pytest
48+
run: |
49+
poetry run pytest
50+
51+
build:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: Set up Python 3.12
56+
uses: actions/setup-python@v5
57+
with:
58+
python-version: "3.12"
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade poetry
62+
- name: Build package
63+
run: |
64+
poetry version "$(poetry version --short | cut -f1 -d + )+build-$(date +'%Y%m%d%H%M%S')"
65+
poetry build
66+
- name: Upload to GitHub Artifacts
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: build-dist
70+
path: dist/

0 commit comments

Comments
 (0)