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
36 changes: 36 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install .
- 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
run: |
pytest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
dist
*.egg-info
*.pyc
1 change: 0 additions & 1 deletion build/lib/numpyencoder/__init__.py

This file was deleted.

33 changes: 0 additions & 33 deletions build/lib/numpyencoder/numpyencoder.py

This file was deleted.

Binary file removed dist/numpyencoder-0.2.0-py3-none-any.whl
Binary file not shown.
Binary file removed dist/numpyencoder-0.2.0.tar.gz
Binary file not shown.
31 changes: 0 additions & 31 deletions numpyencoder.egg-info/PKG-INFO

This file was deleted.

9 changes: 0 additions & 9 deletions numpyencoder.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion numpyencoder.egg-info/dependency_links.txt

This file was deleted.

1 change: 0 additions & 1 deletion numpyencoder.egg-info/requires.txt

This file was deleted.

1 change: 0 additions & 1 deletion numpyencoder.egg-info/top_level.txt

This file was deleted.

Binary file removed numpyencoder/__init__.pyc
Binary file not shown.
Binary file removed numpyencoder/numpyencoder.pyc
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def test_array_of_int():
import json
import numpy as np
from numpyencoder import NumpyEncoder

numpy_data = np.array([np.int64(0), np.int32(1), 2, 3])
baseline_data = [0, 1, 2, 3]

j_np = json.dumps(numpy_data, sort_keys=True,
separators=(', ', ': '), ensure_ascii=False,
cls=NumpyEncoder)

assert json.dumps(baseline_data, sort_keys=True) == j_np