Skip to content

Commit

Permalink
Merge pull request #33 from davidlatwe/github-action
Browse files Browse the repository at this point in the history
Use Actions
  • Loading branch information
davidlatwe authored May 29, 2021
2 parents 8497da2 + 9ac7484 commit ae08b6b
Show file tree
Hide file tree
Showing 15 changed files with 198 additions and 463 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ 2.7, 3.7, 3.8, 3.9 ]
mongodb-version: [ "3.6", "4.0", "4.2" ]
monty-storage: [ memory, flatfile, sqlite ]
experimental: [ false ]
include:
# opt-out lmdb due to the seg fault in github action is
# not reproducible on my Windows and Mac.
- monty-storage: lightning
mongodb-version: "4.0"
python-version: 3.7
experimental: true

steps:
- uses: actions/checkout@v2

- name: Set up MongoDB ${{ matrix.mongodb-version }}
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install pymongo lmdb
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest (${{ matrix.monty-storage }})
continue-on-error: ${{ matrix.experimental }}
run: >
pytest --storage ${{ matrix.monty-storage }}
- name: Test with pytest (${{ matrix.monty-storage }} + bson)
continue-on-error: ${{ matrix.experimental }}
run: >
pytest --storage ${{ matrix.monty-storage }} --use-bson
4 changes: 0 additions & 4 deletions .hound.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
---

### MontyDB is:
* A tiny version of MongoDB, against to **MongoDB 4.0.11**
* Written in pure Python, testing on **Python 2.7, 3.6, 3.7, 3.8, PyPy***
* A tiny version of MongoDB, against to **MongoDB 3.6, 4.0, 4.2**
* Written in pure Python, testing on **Python 2.7, 3.6, 3.7, 3.8, 3.9***
* Literally serverless.
* Similar to [mongomock](https://github.com/mongomock/mongomock), but a bit more than that.

Expand All @@ -27,8 +27,6 @@
- *`lmdb` (for LMDB storage `lightning`)*
- *`pymongo` (for `bson`)*

`bson` is opt-out by default even it's installed, set env var `MONTY_ENABLE_BSON=1` to enable it.

### Example Code
```python
>>> from montydb import MontyClient
Expand Down
Loading

0 comments on commit ae08b6b

Please sign in to comment.