Skip to content

Commit

Permalink
chore: initial code base structure setup. still missing some stuff li…
Browse files Browse the repository at this point in the history
…ke linting/mypy setup.
  • Loading branch information
William Bakst committed Nov 8, 2023
1 parent bd9580d commit cc8562e
Show file tree
Hide file tree
Showing 16 changed files with 2,054 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Upload To PyPI On Release
run-name: ${{ github.actor }} is uploading a new release to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set Up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Poetry
uses: snok/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

- name: Get Release Version
run: echo "RELEASE_VERSION=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV

- name: Build And Publish Python Package
run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PYTORCH_LATTICE_RELEASE_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test
run-name: ${{ github.actor }} is testing the package

on:
push:
pull_request:
branches: [main]

jobs:
release:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/[email protected]

- name: Install dependencies
run: poetry install --with dev

- name: Run Tests
run: poetry run pytest tests/
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.pytest_cache
**__pycache__
.ipynb_checkpoints
.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

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

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

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.envrc
17 changes: 17 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"recommendations": [
"eamodio.gitlens",
"github.vscode-github-actions",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-python.mypy",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"files.autoSave": "onFocusChange",
"editor.rulers": [88],
"editor.formatOnSaveMode": "file",
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[python]": {
"editor.tabSize": 4,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 ControlAI
Copyright (c) 2023 SOTAI Labs Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
69 changes: 69 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Home Page

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Code Annotation Examples

### Codeblocks

Some `code` goes here.

### Plain codeblock

A plain codeblock:

```
Some code here
def myfunction():
pass
// some comment
```

#### Code for a specific language

Some more code with the `py` at the start:

```py
def whatever():
pass
```

#### Code with a title

```py title="bubble_sort.py"
def bubble_sort(items):
for i in range(leng(items)):
for j in range(len(items) - 1 - 1):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```

#### Code with line numbers

```py linenums="1"
def bubble_sort(items):
for i in range(leng(items)):
for j in range(len(items) - 1 - 1):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```

#### Code with highlited lines

```py hl_lines="2 3"
def bubble_sort(items):
for i in range(leng(items)):
for j in range(len(items) - 1 - 1):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```

## Icons & Emojis

:smile:

:fontawesome-regular-face-laugh-wink:

:fontawesome-brands-twitter:{ .twitter }

:octicons-heart-fill-24:{ .heart }
5 changes: 5 additions & 0 deletions docs/page2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Page 2

## Another heading

example text
56 changes: 56 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
site_name: PyTorch Lattice
theme:
name: material
features:
- content.code.annotation
- content.code.copy
- content.code.link
- navigation.footer
- navigation.sections
- navigation.tabs
- navigation.top
- search.highlight
- search.suggest
- toc.integrate
language: en
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
primary: blue-grey
accent: deep-orange
- scheme: slate
toggle:
icon: material/toggle-switch-outline
name: Switch to light mode
primary: blue-grey
accent: deep-orange

extra:
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/ControlAI
- icon: fontawesome/brands/twitter
link: https://twitter.com/WilliamBakst
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/wbakst/

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- admonition
- pymdownx.arithmatex:
generic: true
- footnotes
- pymdownx.details
- pymdownx.superfences
- pymdownx.mark
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg

copyright: Copyright © 2023 SOTAI Labs Inc.
Loading

0 comments on commit cc8562e

Please sign in to comment.