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

Commit 3428037

Browse files
authored
Updated files to match project template (#26)
1 parent 53b3b4a commit 3428037

17 files changed

+733
-180
lines changed

.github/release-drafter.yml renamed to .github/release-drafter.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ categories:
77
- title: "🐛 Bug Fixes"
88
labels:
99
- "bug"
10+
- title: "🧽 Cleanup"
11+
labels:
12+
- "cleanup"
1013
exclude-labels:
1114
- "skip-changelog"
1215
change-title-escapes: '\<*_&'

.github/workflows/docs.yml renamed to .github/workflows/docs.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
# trigger only on changes to the following files
1010
paths:
1111
- "kilroy_module_pytorch_py_sdk/docs/**"
12-
- ".github/workflows/docs.yml"
12+
- ".github/workflows/docs.yaml"
1313

1414
# env for all jobs
1515
env:
@@ -24,17 +24,17 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout code
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2828
- name: Cache packages
29-
uses: actions/cache@v2
29+
uses: actions/cache@v3
3030
with:
3131
path: |
3232
${{ env.PIP_CACHE_DIR }}
3333
key: ${{ runner.os }}-pkgs-${{ env.CACHE_NUMBER }}
3434
- name: Set up Python
35-
uses: actions/setup-python@v2
35+
uses: actions/setup-python@v4
3636
with:
37-
python-version: "3.9.7"
37+
python-version: "3.10.6"
3838
- name: Set up pip cache
3939
run: python3 -m pip config set global.cache-dir ${{ env.PIP_CACHE_DIR }}
4040
- name: Install mkdocs

.github/workflows/draft.yml renamed to .github/workflows/draft.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ on:
1313
- "kilroy_module_pytorch_py_sdk/README.md"
1414
- "kilroy_module_pytorch_py_sdk/poetry.lock"
1515
- "kilroy_module_pytorch_py_sdk/pyproject.toml"
16-
- ".github/workflows/draft.yml"
17-
- ".github/release-drafter.yml"
16+
- ".github/workflows/draft.yaml"
17+
- ".github/release-drafter.yaml"
1818

1919
jobs:
2020
draft:
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- uses: release-drafter/release-drafter@v5
2626
with:
27-
config-name: release-drafter.yml
27+
config-name: release-drafter.yaml
2828
disable-autolabeler: true
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Lint
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+
- ".github/workflows/test-docker.yaml"
14+
pull_request:
15+
# trigger only on main branch
16+
branches:
17+
- main
18+
# trigger only on changes to the following files
19+
paths:
20+
- "kilroy_module_pytorch_py_sdk/src/**"
21+
- "kilroy_module_pytorch_py_sdk/tests/**"
22+
- ".github/workflows/test-docker.yaml"
23+
24+
jobs:
25+
lint:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v3
29+
- uses: psf/black@stable
30+
with:
31+
src: "./kilroy_module_pytorch_py_sdk"

.github/workflows/pypi.yml renamed to .github/workflows/pypi.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
steps:
2020
- # get repository code
2121
name: Checkout code
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323
- # get conda, poetry and pip cache (persistent between runs)
2424
name: Cache packages
25-
uses: actions/cache@v2
25+
uses: actions/cache@v3
2626
with:
2727
path: |
2828
${{ env.POETRY_CACHE_DIR }}
2929
${{ env.PIP_CACHE_DIR }}
3030
key: ${{ runner.os }}-pkgs-${{ env.CACHE_NUMBER }} }}
3131
- name: Set up Python
32-
uses: actions/setup-python@v2
32+
uses: actions/setup-python@v4
3333
with:
34-
python-version: "3.9.7"
34+
python-version: "3.10.6"
3535
- name: Set up pip cache
3636
run: python3 -m pip config set global.cache-dir ${{ env.PIP_CACHE_DIR }}
3737
- name: Install poetry

.github/workflows/test-multiplatform.yml renamed to .github/workflows/test-multiplatform.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ on:
1212
- "kilroy_module_pytorch_py_sdk/tests/**"
1313
- "kilroy_module_pytorch_py_sdk/poetry.lock"
1414
- "kilroy_module_pytorch_py_sdk/pyproject.toml"
15-
- "environment.yml"
15+
- "environment.yaml"
1616
- "requirements.txt"
17-
- ".github/workflows/test-multiplatform.yml"
17+
- ".github/workflows/test-multiplatform.yaml"
1818
pull_request:
1919
# trigger only on main branch
2020
branches:
@@ -25,9 +25,9 @@ on:
2525
- "kilroy_module_pytorch_py_sdk/tests/**"
2626
- "kilroy_module_pytorch_py_sdk/poetry.lock"
2727
- "kilroy_module_pytorch_py_sdk/pyproject.toml"
28-
- "environment.yml"
28+
- "environment.yaml"
2929
- "requirements.txt"
30-
- ".github/workflows/test-multiplatform.yml"
30+
- ".github/workflows/test-multiplatform.yaml"
3131

3232
# env for all jobs
3333
env:
@@ -57,20 +57,20 @@ jobs:
5757
steps:
5858
- # get repository code
5959
name: Checkout code
60-
uses: actions/checkout@v2
60+
uses: actions/checkout@v3
6161
- # get conda, poetry and pip cache (persistent between runs)
6262
name: Cache packages
63-
uses: actions/cache@v2
63+
uses: actions/cache@v3
6464
with:
6565
path: |
6666
${{ env.CONDA_CACHE_DIR }}
6767
${{ env.POETRY_CACHE_DIR }}
6868
${{ env.PIP_CACHE_DIR }}
6969
key: ${{ runner.os }}-pkgs-${{ env.CACHE_NUMBER }}
7070
- name: Set up Python
71-
uses: actions/setup-python@v2
71+
uses: actions/setup-python@v4
7272
with:
73-
python-version: "3.9.7"
73+
python-version: "3.10.6"
7474
- name: Set up pip cache
7575
run: python3 -m pip config set global.cache-dir ${{ env.PIP_CACHE_DIR }}
7676
- name: Install poetry
@@ -82,13 +82,13 @@ jobs:
8282
uses: conda-incubator/setup-miniconda@v2
8383
with:
8484
activate-environment: kilroy-module-pytorch-py-sdk
85-
environment-file: environment.yml
85+
environment-file: environment.yaml
8686
# necessary for caching to work
8787
use-only-tar-bz2: true
8888
- # install only dependencies
8989
name: Install dependencies
9090
working-directory: kilroy_module_pytorch_py_sdk
91-
run: poetry install --no-root --extras test
91+
run: poetry install --no-root --only main,test
9292
- # workaround for non-editable install, waiting for https://github.com/python-poetry/poetry/issues/1382
9393
name: Build package
9494
working-directory: kilroy_module_pytorch_py_sdk

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,5 @@ dmypy.json
129129
.pyre/
130130

131131
.idea/
132+
133+
!.gitkeep

README.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
SDK for kilroy modules using PyTorch 🧰
66

7-
[![Tests](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yml)
8-
[![Docs](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yml)
7+
[![Lint](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/lint.yaml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/lint.yaml)
8+
[![Tests](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yaml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yaml)
9+
[![Docs](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yaml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yaml)
910

1011
</div>
1112

@@ -27,10 +28,10 @@ $ curl -sSL https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86
2728
$ bash miniconda.sh && exec bash
2829
(base) $ git clone https://github.com/kilroybot/kilroy-module-pytorch-py-sdk
2930
(base) $ cd kilroy_module_pytorch_py_sdk
30-
(base) $ conda env create -f environment.yml
31+
(base) $ conda env create -f environment.yaml
3132
(base) $ conda activate kilroy-module-pytorch-py-sdk
3233
(kilroy-module-pytorch-py-sdk) $ cd kilroy_module_pytorch_py_sdk
33-
(kilroy-module-pytorch-py-sdk) $ poetry install --extras dev
34+
(kilroy-module-pytorch-py-sdk) $ poetry install --sync
3435
```
3536

3637
## Quickerstart
@@ -54,7 +55,7 @@ The first step is of course to install [`conda`](https://conda.io).
5455
To create an environment, run from project root:
5556

5657
```sh
57-
conda env create -f environment.yml
58+
conda env create -f environment.yaml
5859
```
5960

6061
And then activate it by:
@@ -66,11 +67,11 @@ conda activate kilroy-module-pytorch-py-sdk
6667
Creating the environment is performed only once, but you need to activate it
6768
every time you start a new shell.
6869

69-
If the configuration file `environment.yml` changes, you can update the
70+
If the configuration file `environment.yaml` changes, you can update the
7071
environment by:
7172

7273
```sh
73-
conda env update -f environment.yml
74+
conda env update -f environment.yaml
7475
```
7576

7677
## Package management
@@ -83,12 +84,11 @@ To install the package, you need to `cd`
8384
into `kilroy_module_pytorch_py_sdk` directory and run:
8485

8586
```sh
86-
poetry install --extras dev --remove-untracked
87+
poetry install --sync
8788
```
8889

89-
This will download and install all package dependencies (including optional
90-
development ones) and install the package in editable mode into the activated
91-
environment.
90+
This will download and install all package dependencies (including development
91+
ones) and install the package in editable mode into the activated environment.
9292

9393
Editable mode means that you don't have to reinstall the package if you change
9494
something in the code. The changes are reflected automatically.
@@ -108,10 +108,10 @@ We are using [`pytest`](https://pytest.org) for tests. It's already installed
108108
in the environment, because it's a development-time dependency. To start first
109109
write the tests and put them in `kilroy_module_pytorch_py_sdk/tests`.
110110

111-
To execute the tests, run from project root:
111+
To execute the tests, `cd` into `kilroy_module_pytorch_py_sdk` and run:
112112

113113
```sh
114-
pytest kilroy_module_pytorch_py_sdk
114+
poe test
115115
```
116116

117117
## Building docs
@@ -124,14 +124,14 @@ creates a nice webpage for them.
124124
Docs should be placed in `kilroy_module_pytorch_py_sdk/docs/docs`. They
125125
are pretty straightforward to write.
126126

127-
To build the docs,
128-
`cd` into `kilroy_module_pytorch_py_sdk/docs` and run:
127+
To build and serve the docs,
128+
`cd` into `kilroy_module_pytorch_py_sdk` and run:
129129

130130
```sh
131-
mkdocs build
131+
poe docs
132132
```
133133

134-
It will generate `site` directory with the webpage source.
134+
It will generate `site` directory with the webpage source and serve it.
135135

136136
## Adding new dependencies
137137

@@ -144,7 +144,7 @@ After that update the installation by running
144144
from `kilroy_module_pytorch_py_sdk` directory:
145145

146146
```sh
147-
poetry update
147+
poe update
148148
```
149149

150150
This will install anything new in your environment and update the `poetry.lock`
@@ -172,8 +172,8 @@ it means the commit broke something (or workflows themselves are broken).
172172

173173
Every time you merge a pull request into main, a draft release is automatically
174174
updated, adding the pull request to changelog. Changes can be categorized by
175-
using labels. You can configure that in `.github/release-drafter.yml` file.
175+
using labels. You can configure that in `.github/release-drafter.yaml` file.
176176

177-
Every time you publish a release the package is uploaded to PyPI
178-
with version taken from release tag
177+
Every time you publish a release the package is uploaded to PyPI
178+
with version taken from release tag
179179
(you should store your PyPI token in `PYPI_TOKEN` secret).

environment.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: kilroy-module-pytorch-py-sdk
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- python==3.10.6
7+
- pip==22.2.2

environment.yml

-4
This file was deleted.

kilroy_module_pytorch_py_sdk/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
SDK for kilroy modules using PyTorch 🧰
66

7-
[![Tests](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yml)
8-
[![Docs](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yml)
7+
[![Lint](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/lint.yaml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/lint.yaml)
8+
[![Tests](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yaml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/test-multiplatform.yaml)
9+
[![Docs](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yaml/badge.svg)](https://github.com/kilroybot/kilroy-module-pytorch-py-sdk/actions/workflows/docs.yaml)
910

1011
</div>
1112

Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
click==8.0.3
2-
ghp-import==2.0.2
3-
importlib-metadata==4.11.1
4-
Jinja2==3.0.3
5-
Markdown==3.3.6
6-
MarkupSafe==2.0.1
1+
charset-normalizer==2.1.1
2+
click==8.1.3
3+
ghp-import==2.1.0
4+
idna==3.4
5+
importlib-metadata==4.12.0
6+
Jinja2==3.1.2
7+
Markdown==3.3.7
8+
MarkupSafe==2.1.1
79
mergedeep==1.3.4
8-
mkdocs==1.2.3
9-
mkdocs-material==8.1.11
10+
mkdocs==1.3.1
11+
mkdocs-material==8.5.3
1012
mkdocs-material-extensions==1.0.3
1113
packaging==21.3
12-
Pygments==2.11.2
13-
pymdown-extensions==9.2
14-
pyparsing==3.0.7
14+
Pygments==2.13.0
15+
pymdown-extensions==9.5
16+
pyparsing==3.0.9
1517
python-dateutil==2.8.2
1618
PyYAML==6.0
1719
pyyaml_env_tag==0.1
20+
requests==2.28.1
1821
six==1.16.0
19-
watchdog==2.1.6
20-
zipp==3.7.0
22+
urllib3==1.26.12
23+
watchdog==2.1.9
24+
zipp==3.8.1

0 commit comments

Comments
 (0)