Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.
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/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build

on:
push:
branches-ignore:
- deploy
tags-ignore:
- v*

jobs:

build:
runs-on: ubuntu-latest
env:
PYTHON_ENV: ci
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
strategy:
matrix:
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: run redis
run: make redis
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make install
#- name: run lint
# run: make lint-check
- name: run tests
run: make test
- name: upload coverage
if: matrix.python-version == '3.8'
run: coveralls
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: release

on:
push:
branches:
- deploy
tags-ignore:
- v*

jobs:
release:
runs-on: ubuntu-latest
env:
PYTHON_ENV: ci
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.QMBOT_GITHUB_TOKEN }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make install
- name: test version
run: make test-version
- name: build python bundle
run: "make bundle${{ matrix.python-version }}"
- name: release to pypi
run: make release-pypi
- name: release to github
if: matrix.python-version == '3.8'
run: make release-github
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*.o
*.def
dist
venv
.venv
.vscode
__pycache__
extensions/src/cparser.cpp
build
Expand Down
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
REPO_NAME = quantmind

# Fixed - dont modify these lines ==================================
K8S_NS ?= prod
LOCAL_DOCKER_NETWORK = services_default
# ==================================================================

GIT_SHA := $(shell git rev-parse HEAD)
TIMESTAMP := $(shell date -u)


.PHONY: help clean deploy env freeze install image serverless test

help:
@echo ======================== METACORE ====================================================
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
@echo ======================================================================================

clean: ## remove python cache files
../devops/dev/clean.sh


cloc: ## Count lines of code
cloc --exclude-dir=build,venv,.venv,.pytest_cache,.mypy_cache .


install: ## install python dependencies in venv
@pip install -U pip twine
@pip install -U -r ./dev/requirements-dev.txt
@pip install -U -r ./dev/requirements.txt


lint: ## run linters
isort .
./dev/run-black.sh
flake8

lint-check: ## run linters in check mode
flake8
isort . --check
./dev/run-black.sh --check


redis: ## run redis for testing
docker run --rm --network=host --name=stdnet -d redis:6
24 changes: 1 addition & 23 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ and instances of those classes with **items** in their corresponding collections
Collections and items are different for different backend databases but
are treated in the same way in the python language domain.

:Master CI: |master-build|_ |coverage|
:Dev CI: |dev-build|_ |coverage-dev|
:Documentation: http://pythonhosted.org/python-stdnet/
:Dowloads: http://pypi.python.org/pypi/python-stdnet/
:Source: https://github.com/lsbardel/python-stdnet
:Platforms: Linux, OS X, Windows. Python 2.6, 2.7, 3.2, 3.3, pypy_
:Mailing List: https://groups.google.com/group/python-stdnet
:Keywords: server, database, redis, odm


.. |master-build| image:: https://secure.travis-ci.org/lsbardel/python-stdnet.png?branch=master
.. _master-build: http://travis-ci.org/lsbardel/python-stdnet
.. |dev-build| image:: https://secure.travis-ci.org/lsbardel/python-stdnet.png?branch=dev
.. _dev-build: http://travis-ci.org/lsbardel/python-stdnet
.. |coverage| image:: https://coveralls.io/repos/lsbardel/python-stdnet/badge.png?branch=master
:target: https://coveralls.io/r/lsbardel/python-stdnet?branch=master
.. |coverage-dev| image:: https://coveralls.io/repos/lsbardel/python-stdnet/badge.png?branch=dev
:target: https://coveralls.io/r/lsbardel/python-stdnet?branch=dev


Contents
~~~~~~~~~~~~~~~
Expand All @@ -49,10 +30,7 @@ Features

Requirements
=================
* Python 2.6, 2.7, 3.2, 3.3 and pypy_. Single code-base.
* redis-py_ for redis backend.
* Optional pulsar_ when using the asynchronous connections or the test suite.
* You need access to a Redis_ server version 2.6 or above.
* Python 3.6 and up


Philosophy
Expand Down
43 changes: 0 additions & 43 deletions clean.py

This file was deleted.

11 changes: 0 additions & 11 deletions covrun.py

This file was deleted.

7 changes: 7 additions & 0 deletions dev/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
flake8
black
isort
pytest
cython
coverage
mypy
File renamed without changes.
2 changes: 2 additions & 0 deletions dev/run-black.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
black . --exclude "venv|build|docs" $1
4 changes: 2 additions & 2 deletions docs/source/_ext/sphinxtogithub.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env python
from optparse import OptionParser
import os
import sys
import shutil
import sys
from optparse import OptionParser


class NoDirectoriesError(Exception):
Expand Down
7 changes: 5 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# If your extensions are in another directory, add it here.
source_dir = os.path.split(os.path.abspath(__file__))[0]
Expand All @@ -20,9 +21,11 @@
sys.path.append(os.path.join(source_dir, "_ext"))
sys.path.append(base_dir)
import stdnet

version = stdnet.__version__
release = version
import runtests # so that it import pulsar if available
import runtests # so that it import pulsar if available

# -- General configuration -----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be extensions
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from stdnet import odm
from stdnet.contrib.timeseries.models import TimeSeries


class FinanceTimeSeries(TimeSeries):
ticker = odm.SymbolField(unique = True)
Expand Down
Loading