Skip to content

Commit

Permalink
Merge pull request #1 from OpenDataServices/setup
Browse files Browse the repository at this point in the history
Setup project boilerplate
  • Loading branch information
tillywoodfield authored Feb 5, 2025
2 parents b1f65f9 + 2b6b9ba commit 059d9d7
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI
on: [push]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dev requirements
run: pip install -r requirements_dev.txt
- name: Check black
run: black --check oc4ids_datastore_pipeline/ tests/
- name: Check isort
run: isort --check-only oc4ids_datastore_pipeline/ tests/
- name: Check flake8
run: flake8 oc4ids_datastore_pipeline/ tests/
- name: Check mypy
run: mypy oc4ids_datastore_pipeline/ tests/
- name: Run tests
run: pytest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv
__pycache__
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
# oc4ids-datastore-pipeline
# OC4IDS Datastore Pipeline

A Python application to validate and store published OC4IDS datasets.

## Local Development

### Prerequisites

- Python 3.12

### Install Python requirements

```
python -m venv .venv
source .venv/bin/activate
pip install -r requirements_dev.txt
```

### Run app

```
pip install -e .
oc4ids-datastore-pipeline
```

### Run linting and type checking

```
black oc4ids_datastore_pipeline/ tests/
isort oc4ids_datastore_pipeline/ tests/
flake8 oc4ids_datastore_pipeline/ tests/
mypy oc4ids_datastore_pipeline/ tests/
```

### Run tests

```
pytest
```
9 changes: 9 additions & 0 deletions oc4ids_datastore_pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import logging
import time

logging.basicConfig(
level=logging.INFO,
format="%(asctime)s:%(levelname)s:%(name)s:%(message)s",
datefmt="%Y-%m-%dT%H:%M:%S",
)
logging.Formatter.converter = time.gmtime
7 changes: 7 additions & 0 deletions oc4ids_datastore_pipeline/pipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import logging

logger = logging.getLogger(__name__)


def run() -> None:
logger.info("Hello World!")
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "oc4ids-datastore-pipeline"
description = "OC4IDS Datastore Pipeline"
version = "0.1.0"
readme = "README.md"
dependencies = []

[project.optional-dependencies]
dev = [
"black",
"isort",
"flake8",
"Flake8-pyproject",
"mypy",
"pytest",
]

[project.scripts]
oc4ids-datastore-pipeline = "oc4ids_datastore_pipeline.pipeline:run"

[tool.isort]
profile = "black"

[tool.flake8]
max-line-length = 88

[tool.mypy]
strict = true
46 changes: 46 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --extra=dev --output-file=requirements_dev.txt pyproject.toml
#
black==25.1.0
# via oc4ids-datastore-pipeline (pyproject.toml)
click==8.1.8
# via black
flake8==7.1.1
# via
# flake8-pyproject
# oc4ids-datastore-pipeline (pyproject.toml)
flake8-pyproject==1.2.3
# via oc4ids-datastore-pipeline (pyproject.toml)
iniconfig==2.0.0
# via pytest
isort==6.0.0
# via oc4ids-datastore-pipeline (pyproject.toml)
mccabe==0.7.0
# via flake8
mypy==1.14.1
# via oc4ids-datastore-pipeline (pyproject.toml)
mypy-extensions==1.0.0
# via
# black
# mypy
packaging==24.2
# via
# black
# pytest
pathspec==0.12.1
# via black
platformdirs==4.3.6
# via black
pluggy==1.5.0
# via pytest
pycodestyle==2.12.1
# via flake8
pyflakes==3.2.0
# via flake8
pytest==8.3.4
# via oc4ids-datastore-pipeline (pyproject.toml)
typing-extensions==4.12.2
# via mypy
2 changes: 2 additions & 0 deletions tests/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_hello_world() -> None:
pass

0 comments on commit 059d9d7

Please sign in to comment.