Skip to content

Commit

Permalink
Initial commit of the public cartoreader-lite python package
Browse files Browse the repository at this point in the history
This package is an inofficial reader to easily process exported CARTO3 data in Python.
It does not provide the more extensive capabilities to analyze the signals, such as OpenEP, but is rather meant as a simple reader to import CARTO data.
  • Loading branch information
thomgrand committed Jan 26, 2022
0 parents commit 71c136a
Show file tree
Hide file tree
Showing 33 changed files with 2,563 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# https://coverage.readthedocs.io/en/latest/config.html
# .coveragerc to control coverage.py
[run]
branch = True
omit =
cartoreader_lite/output/*

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
#raise AssertionError
#raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

ignore_errors = True

[html]
directory = coverage_html
59 changes: 59 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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: CI Tests

on:
push:
branches: [ public ]
pull_request:
branches: [ public ]

jobs:

test_lib_pip_ubuntu:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install with pip
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
python tests/generate_test_data.py
- name: Test with pytest
run: |
python -m pytest --cov-config=.coveragerc --cov=cartoreader_lite tests/
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
test_lib_pip_windows:

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install with pip
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
python tests/generate_test_data.py
- name: Test with pytest
run: |
python -m pytest --cov-config=.coveragerc --cov=cartoreader_lite tests/
36 changes: 36 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build -s
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*__pycache__*
*.pyc
*.egg-info*
docs/_*
cartoreader_lite/output/*
.pytest_cache*
.vscode*
coverage_html*
dist*
.coverage
Loading

0 comments on commit 71c136a

Please sign in to comment.