Skip to content

Commit

Permalink
Merge pull request #1 from treebeardtech/init
Browse files Browse the repository at this point in the history
Init
  • Loading branch information
alex-treebeard authored Oct 24, 2023
2 parents 45d2568 + f8f74aa commit 95ac2e2
Show file tree
Hide file tree
Showing 33 changed files with 6,710 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/python-3/.devcontainer/base.Dockerfile
ARG VARIANT="3.11"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
USER vscode
RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
'poetry==1.1.13' \
'pip==22.1.2'
RUN npm install -g @devcontainers/[email protected]
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "3.10",
"INSTALL_NODE": "true",
"NODE_VERSION": "18.7"
}
},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind,consistency=cached",
// Add the paths below if you know you use them on your local machine and want them to be available in your container.
//
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshrc,target=/home/vscode/.zshrc,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zsh_history,target=/home/vscode/.zsh_history,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshenv,target=/home/vscode/.zshenv,type=bind,consistency=cached",
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.kube/config,target=/home/vscode/.kube/config,type=bind,consistency=cached",
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.kc,target=/home/vscode/.kc,type=bind,consistency=cached",
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.azure/msal_http_cache.bin,target=/home/vscode/.azure/msal_http_cache.bin,type=bind,consistency=cached",
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/.azure/msal_token_cache.json,target=/home/vscode/.azure/msal_token_cache.json,type=bind,consistency=cached",
],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"python.pythonPath": "/usr/local/bin/python"
},
"extensions": [
"ms-python.python"
]
}
},
// "containerEnv": {
// "OPENAI_API_KEY": "${localEnv:OPENAI_API_KEY}",
// "PINECONE_API_KEY": "${localEnv:PINECONE_API_KEY}"
// },
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/starship:1": {},
},
"postCreateCommand": "poetry install",
"remoteUser": "vscode"
}
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
22 changes: 22 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to PYPI
on:
release:
types: [published]
jobs:
build-n-publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
- run: pip install poetry
- run: poetry version ${GITHUB_REF:10}
- run: poetry build
- run: pip install twine==4.0.1
- run: twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
- uses: EndBug/[email protected]
with:
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
add: pyproject.toml
branch: main
message: Published new version
44 changes: 44 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pytest
on:
schedule:
- cron: 0 13 * * 1 # Every Monday at 1PM UTC (9AM EST)
pull_request:
# test in containerised and OS environments
jobs:
test-container:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: npm install -g @devcontainers/[email protected]
- run: devcontainer up --workspace-folder=.
- run: devcontainer exec --workspace-folder=. poetry run pre-commit run --verbose --all-files
- run: devcontainer exec --workspace-folder=. poetry run pytest --cov-report=xml --cov=src
- uses: codecov/codecov-action@v1
with:
file: coverage.xml
pytest:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
python-version:
- "3.8"
# - "3.9"
# - "3.10"
- "3.11"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install poetry
- run: poetry install
- run: poetry run pytest --cov-report=xml --cov=src
- uses: codecov/codecov-action@v1
with:
file: coverage.xml

# TODO README and workflows for e2e test, package release, devcon build
24 changes: 24 additions & 0 deletions .github/workflows/test-publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test Publish to PYPI
on:
push:
branches:
- main
jobs:
build-n-publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
- run: pip install poetry
- name: Set poetry version to dev
run: |
build_version="$(poetry version -s).dev$(date +%s)"
poetry version $build_version
- run: poetry build
- run: pip install 'pytest==7.1'
- run: pip install dist/*gz --force-reinstall
- run: nbwrite tests/resources/nbwrite-in/example.yaml
- run: pip install dist/*whl --force-reinstall
- run: nbwrite tests/resources/nbwrite-in/example.yaml
- run: pip install twine==4.0.1
- run: twine upload -r testpypi dist/* -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }}
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.DS_store
typeshed

trash
**/_build

.testvenv
wandb
flagged
test-debug-out
nbwrite-out
Loading

0 comments on commit 95ac2e2

Please sign in to comment.