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
8 changes: 7 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[flake8]
max-line-length = 120
max-line-length = 120
exclude =
.git,
.eggs,
__pycache__,
doc/examples,
**/__init__.py
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run CI make command

on:
push:
branches:
- "*"
- "!master"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build
working-directory: .
run: make ci
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [


{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Pytest",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"purpose": ["debug-test"],
"justMyCode": false
}
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.testing.unittestArgs": [
"-v",
"tests/test_*.py"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"python.analysis.exclude": [
"**/.venv",
"**/docker",
"**/mypy_cache",
"**/pytest_cache"
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
SHELL := /bin/bash -e -o pipefail
PROJECT ?= fx-lib
PROJECT ?= pytrade
BRANCH_NAME ?= local
BUILD_NUMBER ?= 0
IMAGE ?= ${PROJECT}:${BRANCH_NAME}-${BUILD_NUMBER}
COMPOSE_FILE=docker/docker-compose.yaml
COMPOSE_BASE_FILE=docker/docker-compose.base.yaml
DC=docker compose -p ${PROJECT} -f ${COMPOSE_FILE} -f ${COMPOSE_BASE_FILE}
SERVICE := fx_lib
SERVICE := pytrade
POETRY ?= "poetry"
VERSION := $(shell head VERSION | grep -Eo "\d+.\d+.\d+")

Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN apt-get update \
curl \
build-essential

ENV PATH="/app/${PROJECT_DIR}/.venv/bin:$PATH"
ENV PATH="/app/.venv/bin:$PATH"
ENV APP_USER app
ENV APP_GROUP app
RUN groupadd ${APP_GROUP}
Expand All @@ -55,15 +55,15 @@ COPY --from=base /app .
WORKDIR /app/${PROJECT_DIR}
USER ${APP_USER}

ENTRYPOINT ["/app/${PROJECT_DIR}/scripts/entrypoint.sh"]
ENTRYPOINT ["/app/scripts/entrypoint.sh"]

##################################################
## DEVELOPMENT ##
##################################################

FROM base as development

ENV PATH="/app/${PROJECT_DIR}/.venv/bin:$PATH"
ENV PATH="/app/.venv/bin:$PATH"
ENV APP_USER app
ENV APP_GROUP app
RUN groupadd ${APP_GROUP}
Expand All @@ -81,4 +81,4 @@ RUN poetry install
RUN chown ${APP_USER}:${APP_GROUP} .
USER ${APP_USER}

ENTRYPOINT ["/app/${PROJECT_DIR}/scripts/entrypoint.sh"]
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
2 changes: 1 addition & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ services:
extends:
file: docker-compose.base.yaml
service: base
entrypoint: ["/app/fx-lib/scripts/test.sh"]
entrypoint: ["/app/scripts/test.sh"]
207 changes: 0 additions & 207 deletions fx_lib/_util.py

This file was deleted.

22 changes: 0 additions & 22 deletions fx_lib/broker.py

This file was deleted.

7 changes: 0 additions & 7 deletions fx_lib/models/granularity.py

This file was deleted.

6 changes: 0 additions & 6 deletions fx_lib/models/granularity.pyi

This file was deleted.

Loading
Loading