Skip to content

Commit

Permalink
feat: initial empty functions
Browse files Browse the repository at this point in the history
This adds initial, empty, functions, and the starts of tests (and CI) to test
them.
  • Loading branch information
michalc committed Jan 14, 2024
1 parent 896f97a commit 4f13e78
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
name: Run tests
strategy:
matrix:
include:
- python-version: "3.6.7"
os: "ubuntu-20.04"
- python-version: "3.7.1"
os: "ubuntu-20.04"
- python-version: "3.8.0"
os: "ubuntu-20.04"
- python-version: "3.9.0"
os: "ubuntu-20.04"
- python-version: "3.10.0"
os: "ubuntu-20.04"
- python-version: "3.11.0"
os: "ubuntu-20.04"
- python-version: "3.12.0"
os: "ubuntu-20.04"
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: '${{ matrix.python-version }}'
- name: "Install python dependencies"
run: |
pip install ".[ci]"
- name: "Run tests"
run: |
pytest
10 changes: 10 additions & 0 deletions openttdlab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def setup_experiment():
pass


def save_config():
pass


def load_config():
pass
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ classifiers = [
[project.urls]
"Source" = "https://github.com/michalc/OpenTTDLab"

[project.optional-dependencies]
dev = [
"pytest>=7.0.1",
]
ci = [
"pytest==7.0.1",
]

[tool.hatch.build]
include = [
"openttdlab.py"
Expand Down
13 changes: 13 additions & 0 deletions test_openttdlab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from openttdlab import setup_experiment, save_config, load_config


def test_setup_experiment():
setup_experiment()


def test_save_config():
save_config()


def test_load_config():
load_config()

0 comments on commit 4f13e78

Please sign in to comment.