Skip to content

Commit fa5166c

Browse files
committed
Initial commit
0 parents  commit fa5166c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+8641
-0
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = E203, E266, W503, F403
3+
max-line-length = 150
4+
max-complexity = 10
5+
select = B,C,E,F,W,T4,B9
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/test-package.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# inspired by https://jacobian.org/til/github-actions-poetry/
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
8+
env:
9+
POETRY_VERSION: 1.8.2
10+
API_KEY: ${{ secrets.API_KEY }}
11+
API_SECRET: ${{ secrets.API_SECRET }}
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
max-parallel: 1
18+
fail-fast: false
19+
matrix:
20+
python-version: ["3.12"]
21+
os: [ubuntu-latest, macOS-latest]
22+
env:
23+
POETRY_VIRTUALENVS_IN_PROJECT: true
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
31+
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
32+
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
33+
# manually if/when you want to upgrade Poetry, or if something goes wrong.
34+
- name: cache poetry install
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.local
38+
key: poetry-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ env.POETRY_VERSION }}
39+
40+
# Install Poetry. You could do this manually, or there are several actions that do this.
41+
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
42+
# Poetry's default install script, which feels correct. I pin the Poetry version here
43+
# because Poetry does occasionally change APIs between versions and I don't want my
44+
# actions to break if it does.
45+
#
46+
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
47+
# venv as a `.venv` in your testing directory, which allows the next step to easily
48+
# cache it.
49+
- uses: snok/install-poetry@v1
50+
with:
51+
version: 1.8.2
52+
virtualenvs-create: true
53+
virtualenvs-in-project: true
54+
55+
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`)
56+
- name: cache venv
57+
uses: actions/cache@v4
58+
with:
59+
path: .venv
60+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
61+
- run: poetry install --no-interaction --no-root
62+
if: steps.cache-deps.outputs.cache-hit != 'true'
63+
- run: poetry install --no-interaction
64+
- run: poetry run flake8 py_alpaca_api/ tests/
65+
- run: poetry run pytest

.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
.idea
9+
.vscode
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# poetry
99+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100+
# This is especially recommended for binary packages to ensure reproducibility, and is more
101+
# commonly ignored for libraries.
102+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103+
#poetry.lock
104+
105+
# pdm
106+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107+
#pdm.lock
108+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109+
# in version control.
110+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
111+
.pdm.toml
112+
.pdm-python
113+
.pdm-build/
114+
115+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
116+
__pypackages__/
117+
118+
# Celery stuff
119+
celerybeat-schedule
120+
celerybeat.pid
121+
122+
# SageMath parsed files
123+
*.sage.py
124+
125+
# Environments
126+
.env
127+
.venv
128+
env/
129+
venv/
130+
ENV/
131+
env.bak/
132+
venv.bak/
133+
134+
# Spyder project settings
135+
.spyderproject
136+
.spyproject
137+
138+
# Rope project settings
139+
.ropeproject
140+
141+
# mkdocs documentation
142+
/site
143+
144+
# mypy
145+
.mypy_cache/
146+
.dmypy.json
147+
dmypy.json
148+
149+
# Pyre type checker
150+
.pyre/
151+
sandbox.py
152+
# pytype static type analyzer
153+
.pytype/
154+
155+
# Cython debug symbols
156+
cython_debug/
157+
158+
# PyCharm
159+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161+
# and can be added to the global gitignore or merged into this file. For a more nuclear
162+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
163+
#.idea/

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# isort
2+
repos:
3+
- repo: https://github.com/PyCQA/isort
4+
rev: 5.13.2
5+
hooks:
6+
- id: isort
7+
8+
# black
9+
- repo: https://github.com/ambv/black
10+
rev: 24.4.2
11+
hooks:
12+
- id: black
13+
args: # arguments to configure black
14+
- --line-length=150
15+
- --include='\.pyi?$'
16+
17+
# these folders wont be formatted by black
18+
- --exclude="""\.git |
19+
\.__pycache__|
20+
\.hg|
21+
\.mypy_cache|
22+
\.tox|
23+
\.venv|
24+
_build|
25+
buck-out|
26+
build|
27+
dist|
28+
docs"""
29+
30+
language_version: python3.12
31+
32+
# flake8
33+
- repo: https://github.com/PyCQA/flake8
34+
rev: 7.0.0
35+
hooks:
36+
- id: flake8
37+
args: # arguments to configure flake8
38+
# making isort line length compatible with black
39+
- "--max-line-length=150"
40+
- "--max-complexity=10"
41+
- "--select=B,C,E,F,W,T4,B9"
42+
43+
# these are errors that will be ignored by flake8
44+
# check out their meaning here
45+
# https://flake8.pycqa.org/en/latest/user/error-codes.html
46+
- "--ignore=E203,E266,W503,F403"
47+
48+

.readthedocs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-20.04"
5+
tools:
6+
python: "3.12"
7+
sphinx:
8+
configuration: docs/source/conf.py
9+
10+
python:
11+
install:
12+
- requirements: docs/rtd_requirements.txt

0 commit comments

Comments
 (0)