Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit fe062c4

Browse files
authored
Added initial project structure (#1)
1 parent 8041df8 commit fe062c4

27 files changed

+895
-1
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/** linguist-documentation
2+
kilroy_module_pytorch_py_sdk/docs/** linguist-documentation

.github/release-drafter.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name-template: "$RESOLVED_VERSION"
2+
tag-template: "$RESOLVED_VERSION"
3+
categories:
4+
- title: "🚀 Features"
5+
labels:
6+
- "feature"
7+
- title: "🐛 Bug Fixes"
8+
labels:
9+
- "bug"
10+
exclude-labels:
11+
- "skip-changelog"
12+
change-title-escapes: '\<*_&'
13+
template: |
14+
```
15+
16+
##########
17+
### ###
18+
## ##
19+
## ##
20+
## ### ### ##
21+
#### ## # o # # # # o # ## ####
22+
------# #--------------- # # ---------------# #------
23+
| #### # # #### |
24+
| ## |
25+
| |
26+
| |
27+
| |
28+
| WHAT'S NEW |
29+
| |
30+
| |
31+
| |
32+
| |
33+
------------------------------------------------------------
34+
35+
```
36+
37+
$CHANGES

.github/workflows/docs.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
# trigger only on main branch
7+
branches:
8+
- main
9+
# trigger only on changes to the following files
10+
paths:
11+
- "kilroy_module_pytorch_py_sdk/docs/**"
12+
- ".github/workflows/docs.yml"
13+
14+
# env for all jobs
15+
env:
16+
PIP_CACHE_DIR: ~/.cache/pip
17+
# increase this value to manually reset cache
18+
CACHE_NUMBER: 0
19+
20+
jobs:
21+
docs:
22+
name: Deploy docs
23+
# better to use pinned version here
24+
runs-on: ubuntu-20.04
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
- name: Cache packages
29+
uses: actions/cache@v2
30+
with:
31+
path: |
32+
${{ env.PIP_CACHE_DIR }}
33+
key: ${{ runner.os }}-pkgs-${{ env.CACHE_NUMBER }}
34+
- name: Set up Python
35+
uses: actions/setup-python@v2
36+
with:
37+
python-version: "3.9.7"
38+
- name: Set up pip cache
39+
run: python3 -m pip config set global.cache-dir ${{ env.PIP_CACHE_DIR }}
40+
- name: Install mkdocs
41+
working-directory: kilroy_module_pytorch_py_sdk/docs
42+
run: python3 -m pip install -r requirements.txt
43+
- name: Deploy docs
44+
working-directory: kilroy_module_pytorch_py_sdk/docs
45+
run: mkdocs gh-deploy --force

.github/workflows/draft.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Draft
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
# trigger only on main branch
7+
branches:
8+
- main
9+
# trigger only on changes to the following files
10+
paths:
11+
- "kilroy_module_pytorch_py_sdk/src/**"
12+
- "kilroy_module_pytorch_py_sdk/LICENSE"
13+
- "kilroy_module_pytorch_py_sdk/README.md"
14+
- "kilroy_module_pytorch_py_sdk/poetry.lock"
15+
- "kilroy_module_pytorch_py_sdk/pyproject.toml"
16+
- ".github/workflows/draft.yml"
17+
- ".github/release-drafter.yml"
18+
19+
jobs:
20+
draft:
21+
name: Update draft release
22+
# better to use pinned version here
23+
runs-on: ubuntu-20.04
24+
steps:
25+
- uses: release-drafter/release-drafter@v5
26+
with:
27+
config-name: release-drafter.yml
28+
disable-autolabeler: true
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pypi.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
# env for all jobs
9+
env:
10+
POETRY_CACHE_DIR: ~/.cache/pypoetry
11+
PIP_CACHE_DIR: ~/.cache/pip
12+
# increase this value to manually reset cache
13+
CACHE_NUMBER: 0
14+
15+
jobs:
16+
pypi:
17+
name: Deploy to PyPI
18+
runs-on: ubuntu-20.04
19+
steps:
20+
- # get repository code
21+
name: Checkout code
22+
uses: actions/checkout@v2
23+
- # get conda, poetry and pip cache (persistent between runs)
24+
name: Cache packages
25+
uses: actions/cache@v2
26+
with:
27+
path: |
28+
${{ env.POETRY_CACHE_DIR }}
29+
${{ env.PIP_CACHE_DIR }}
30+
key: ${{ runner.os }}-pkgs-${{ env.CACHE_NUMBER }} }}
31+
- name: Set up Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: "3.9.7"
35+
- name: Set up pip cache
36+
run: python3 -m pip config set global.cache-dir ${{ env.PIP_CACHE_DIR }}
37+
- name: Install poetry
38+
run: python3 -m pip install -r requirements.txt
39+
- name: Set up poetry cache
40+
run: poetry config cache-dir ${{ env.POETRY_CACHE_DIR }}
41+
- name: Bump version
42+
working-directory: kilroy_module_pytorch_py_sdk
43+
run: poetry version '${{ github.event.release.tag_name }}'
44+
- name: Publish the package
45+
working-directory: kilroy_module_pytorch_py_sdk
46+
run: poetry publish --build -u '__token__' -p '${{ secrets.PYPI_TOKEN }}'
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Multiplatform tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
# trigger only on main branch
7+
branches:
8+
- main
9+
# trigger only on changes to the following files
10+
paths:
11+
- "kilroy_module_pytorch_py_sdk/src/**"
12+
- "kilroy_module_pytorch_py_sdk/tests/**"
13+
- "kilroy_module_pytorch_py_sdk/poetry.lock"
14+
- "kilroy_module_pytorch_py_sdk/pyproject.toml"
15+
- "environment.yml"
16+
- "requirements.txt"
17+
- ".github/workflows/test-multiplatform.yml"
18+
pull_request:
19+
# trigger only on main branch
20+
branches:
21+
- main
22+
# trigger only on changes to the following files
23+
paths:
24+
- "kilroy_module_pytorch_py_sdk/src/**"
25+
- "kilroy_module_pytorch_py_sdk/tests/**"
26+
- "kilroy_module_pytorch_py_sdk/poetry.lock"
27+
- "kilroy_module_pytorch_py_sdk/pyproject.toml"
28+
- "environment.yml"
29+
- "requirements.txt"
30+
- ".github/workflows/test-multiplatform.yml"
31+
32+
# env for all jobs
33+
env:
34+
CONDA_CACHE_DIR: ~/conda_pkgs_dir
35+
POETRY_CACHE_DIR: ~/.cache/pypoetry
36+
PIP_CACHE_DIR: ~/.cache/pip
37+
# increase this value to manually reset cache
38+
CACHE_NUMBER: 0
39+
40+
jobs:
41+
test:
42+
name: Run tests
43+
strategy:
44+
# don't stop all tests if one fails
45+
fail-fast: false
46+
matrix:
47+
# better to use pinned versions here
48+
config:
49+
- { os: ubuntu-20.04, shell: bash -l }
50+
- { os: macos-10.15, shell: bash -l }
51+
- { os: windows-2019, shell: cmd /C CALL }
52+
runs-on: ${{ matrix.config.os }}
53+
defaults:
54+
run:
55+
# necessary for conda to work
56+
shell: ${{ matrix.config.shell }} {0}
57+
steps:
58+
- # get repository code
59+
name: Checkout code
60+
uses: actions/checkout@v2
61+
- # get conda, poetry and pip cache (persistent between runs)
62+
name: Cache packages
63+
uses: actions/cache@v2
64+
with:
65+
path: |
66+
${{ env.CONDA_CACHE_DIR }}
67+
${{ env.POETRY_CACHE_DIR }}
68+
${{ env.PIP_CACHE_DIR }}
69+
key: ${{ runner.os }}-pkgs-${{ env.CACHE_NUMBER }}
70+
- name: Set up Python
71+
uses: actions/setup-python@v2
72+
with:
73+
python-version: "3.9.7"
74+
- name: Set up pip cache
75+
run: python3 -m pip config set global.cache-dir ${{ env.PIP_CACHE_DIR }}
76+
- name: Install poetry
77+
run: python3 -m pip install -r requirements.txt
78+
- name: Set up poetry cache
79+
run: poetry config cache-dir ${{ env.POETRY_CACHE_DIR }}
80+
- # create and activate conda environment
81+
name: Set up environment
82+
uses: conda-incubator/setup-miniconda@v2
83+
with:
84+
activate-environment: kilroy-module-pytorch-py-sdk
85+
environment-file: environment.yml
86+
# necessary for caching to work
87+
use-only-tar-bz2: true
88+
- # install only dependencies
89+
name: Install dependencies
90+
working-directory: kilroy_module_pytorch_py_sdk
91+
run: poetry install --no-root --extras test
92+
- # workaround for non-editable install, waiting for https://github.com/python-poetry/poetry/issues/1382
93+
name: Build package
94+
working-directory: kilroy_module_pytorch_py_sdk
95+
run: poetry build -f wheel
96+
- # use pip to install wheel produced in previous step
97+
name: Install package
98+
working-directory: kilroy_module_pytorch_py_sdk
99+
# python from conda should be called just by 'python', not 'python3'
100+
run: python -m pip install --no-deps --no-index --no-cache-dir --find-links=dist kilroy-module-pytorch-py-sdk[test]
101+
- name: Run tests
102+
run: pytest kilroy_module_pytorch_py_sdk

.gitignore

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
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+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
site/
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
.idea/

0 commit comments

Comments
 (0)