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

on:
pull_request:
branches:
- master
types:
- opened
- reopened
- ready_for_review
- synchronize

env:
SKIP: pytest-check

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # get full git history
- uses: actions/setup-python@v3
with:
cache: 'pip'
- name: Install pre-commit
run: |
pip install pre-commit
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v21
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run pre-commit
uses: pre-commit/action@v2.0.3
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
20 changes: 12 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ on:
jobs:

test-suite:
if: github.event.pull_request.draft == false
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.os }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -30,7 +31,10 @@ jobs:
pip install -r tests/requirements.txt
- name: Test with pytest
run: |
pytest
pytest --cov-report= --cov=btrdbextras # suppress coverage report here
- name: Coverage Report
run: |
coverage report -m


release:
Expand All @@ -39,7 +43,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -59,9 +63,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
Expand All @@ -75,4 +79,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Local development
local-setup.sh
driver.py
ignore.py

# OS trash
.DS_Store
Expand Down Expand Up @@ -122,3 +118,13 @@ dmypy.json

# Pyre type checker
.pyre/

# arrow parquet files
*.parquet

.idea
.idea/misc.xml
.idea/vcs.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/inspectionProfiles/Project_Default.xml
/.idea/
51 changes: 51 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: setup.cfg
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black-jupyter
args: [--line-length=88]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: [--profile=black, --line-length=88]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks: # Enforce that python3.6+ type annotations are used instead of type comments
- id: python-use-type-annotations
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
# args: []
#- repo: https://github.com/PyCQA/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
name: nbstripout
description: 'nbstripout: strip output from Jupyter and IPython notebooks'
entry: nbstripout
language: python
types: [jupyter]
files: kinesis/dominion_apps/ # Run only on notebooks in dominion_apps directory
# exclude: # add files here to keep output cells in Jupyter during commit
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest
language: system
pass_filenames: false
always_run: true
4 changes: 2 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Redistribution and use in source and binary forms, with or without modification,

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ global-exclude *.py[co]
global-exclude .ipynb_checkpoints
global-exclude .DS_Store
global-exclude .env
global-exclude .coverage.*
global-exclude .coverage.*
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPHINXBUILDDIR = docs/build
SPHINXSOURCEDIR = docs/source

# Export targets not associated with files
.PHONY: test grpc
.PHONY: test coverage pip clean publish uml build deploy install

# Clean build files
clean:
Expand All @@ -31,7 +31,12 @@ clean:
-rm -rf docs/build
-rm -rf platform-builds meta.yaml

# Generate new grpc code

# Publish to gh-pages
publish:
git subtree push --prefix=deploy origin gh-pages

# Autogenerate GRPC/PB files
grpc:
@echo Generating files:
python -m grpc_tools.protoc -I btrdbextras/eventproc/protobuff --python_out=btrdbextras/eventproc/protobuff --grpc_python_out=btrdbextras/eventproc/protobuff btrdbextras/eventproc/protobuff/api.proto
Expand All @@ -54,9 +59,11 @@ install:

# Deploy to PyPI
deploy:
# python setup.py register
python setup.py register
twine upload dist/* --verbose

# Build html version of docs
html:
$(SPHINXBUILD) -b html $(SPHINXOPTS) $(SPHINXSOURCEDIR) $(SPHINXBUILDDIR)
$(SPHINXBUILD) -b html $(SPHINXOPTS) $(SPHINXSOURCEDIR) $(SPHINXBUILDDIR)
@echo
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html."
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ Note that the documentation also requires Sphix and other dependencies to succes

## Versioning

This codebases uses a form of [Semantic Versioning](http://semver.org/) to structure version numbers. In general, the major version number will track with the BTrDB codebase to transparently maintain version compatibility. Planned features between major versions will increment the minor version while any special releases (bug fixes, etc.) will increment the patch number.
This codebases uses a form of [Semantic Versioning](http://semver.org/) to structure version numbers. In general, the major version number will track with the BTrDB codebase to transparently maintain version compatibility. Planned features between major versions will increment the minor version while any special releases (bug fixes, etc.) will increment the patch number.
2 changes: 1 addition & 1 deletion btrdbextras/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .conn import Connection

__version__ = 'v5.11.9'
__version__ = "v5.31.0"

__all__ = ["__version__", "Connection"]
8 changes: 6 additions & 2 deletions btrdbextras/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
## Classes
##########################################################################

class Connection():

def __init__(self, endpoint=os.environ.get("BTRDB_ENDPOINTS"), apikey=os.environ.get("BTRDB_API_KEY")):
class Connection:
def __init__(
self,
endpoint=os.environ.get("BTRDB_ENDPOINTS"),
apikey=os.environ.get("BTRDB_API_KEY"),
):
if endpoint is None or endpoint.strip() == "":
raise ValueError("invalid endpoint or BTRDB_ENDPOINTS env variable not set")

Expand Down
Loading